我做tilecache切图遇到问题:
1)tilecache/index.html:文件修改切图vmap0,可以的,缓存切图basic成功
2)http://127.0.0.1:80/cgi-bin/mapserv.exe?MAP=F:/ms4w/tutorial/htdocs/example1-1.map&LAYERS=ALL&MODE=MAP,可以的,看到相应的图层信息
但是.....以下是有问题的:tilecache切自己定义的map文件states图层(map文件由官网下载)
cmd中输入“python "F:/ms4w/Apache/htdocs/tilecache/tilecache_seed.py" states 0 7
”报错如下:python cannot open file error 22 invalid argument
查找错误:断点调试tilecache_seed.py报错了
tilecache.cfg定义:
[states]
type=WMS
url=http://127.0.0.1:80/cgi-bin/mapserv.exe?MAP=F:/ms4w/tutorial/htdocs/example1.map
layers=states
extension=png
bbox=-97.238976,41.619778,-82.122902,49.385620
size=256,256
srs=EPSG:4326
报错信息:
C:\Python27\python.exe "E:\Program Files\JetBrains\PyCharm 2.6.3\helpers\pydev\pydevd.py" --multiproc --client 127.0.0.1 --port 8961 --file F:/ms4w/Apache/htdocs/tilecache/tilecache_seed.py
pydev debugger: process 448 is connecting
Connected to pydev debugger (build 121.378)
###### (0, 0, 0), (2, 1, 0)
Traceback (most recent call last):
File "E:\Program Files\JetBrains\PyCharm 2.6.3\helpers\pydev\pydevd.py", line 1457, in <module>
debugger.run(setup['file'], None, None)
File "E:\Program Files\JetBrains\PyCharm 2.6.3\helpers\pydev\pydevd.py", line 1103, in run
pydev_imports.execfile(file, globals, locals) #execute the script
File "F:/ms4w/Apache/htdocs/tilecache/tilecache_seed.py", line 9, in <module>
TileCache.Client.main()
File "F:/ms4w/Apache/htdocs/tilecache\TileCache\Client.py", line 189, in main
seed(svc, layer, map(int, args[1:3]), bboxlist , padding=options.padding, force = options.force, reverse = options.reverse, delay=options.delay)
File "F:/ms4w/Apache/htdocs/tilecache\TileCache\Client.py", line 124, in seed
svc.renderTile(tile,force=force)
File "F:/ms4w/Apache/htdocs/tilecache\TileCache\Service.py", line 138, in renderTile
data = layer.render(tile, force=force)
File "F:/ms4w/Apache/htdocs/tilecache\TileCache\Layer.py", line 444, in render
return self.renderTile(tile)
File "F:/ms4w/Apache/htdocs/tilecache\TileCache\Layers\WMS.py", line 29, in renderTile
tile.data, response = wms.fetch()
File "F:/ms4w/Apache/htdocs/tilecache\TileCache\Client.py", line 69, in fetch
raise Exception("Did not get image data back. \nURL: %s\nContent-Type Header: %s\nResponse: \n%s" % (self.url(), ctype, data))
Exception: Did not get image data back.
URL: http://127.0.0.1:80/cgi-bin/mapserv.exe?MAP=F:/ms4w/tutorial/htdocs/example1.map&layers=states&styles=&service=WMS&width=256&format=image%2Fpng&request=GetMap&height=256&srs=EPSG%3A4326&version=1.1.1&bbox=-97.238976%2C41.619778%2C-89.680939%2C49.177815
Content-Type Header: application/vnd.ogc.se_xml
Response:
<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1">
<ServiceException>
msWMSDispatch(): WMS server error. WMS request not enabled. Check wms/ows_enable_request settings.
</ServiceException>
</ServiceExceptionReport>
Process finished with exit code 1
其中提到:
1)Exception: Did not get image data back.
2)Content-Type Header: application/vnd.ogc.se_xml
3)msWMSDispatch(): WMS server error. WMS request not enabled. Check wms/ows_enable_request settings.
第一个是说,不能将data写入image,报错信息中也提示了data返回为空
第二个看不太明白了
第三条说,url有问题。是mapserver服务有问题,可是输入map文件getmap是可用的?
将它提示的错误url“http://127.0.0.1:80/cgi-bin/mapserv.exe?MAP=F:/ms4w/tutorial/htdocs/example1.map&layers=states&styles=&service=WMS&width=256&format=image%2Fpng&request=GetMap&height=256&srs=EPSG%3A4326&version=1.1.1&bbox=-97.238976%2C41.619778%2C-89.680939%2C49.177815”输入,出现下载mapserver.exe的下载页面???
糊涂了,看不出来哪里出了问题?
tilecache提示的错误信息是url有问题,是这样的吗?怎么跟踪问题?我哪里操作出了问题呢?
一周了,一点进展都没有,很是着急,希望得到您的指导。加上mode=map
改为:
url=http://127.0.0.1:80/cgi-bin/mapserv.exe?MAP=F:/ms4w/tutorial/htdocs/example1.map&mode=map
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。