开发者社区> 问答> 正文

tilecache切图请教?报错

 

我做tilecache切图遇到问题:

1tilecache/index.html:文件修改切图vmap0,可以的,缓存切图basic成功

2http://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

其中提到:

1Exception: Did not get image data back.

2Content-Type Header: application/vnd.ogc.se_xml

3msWMSDispatch(): WMS server error. WMS request not enabled. Check wms/ows_enable_request settings.

第一个是说,不能将data写入image,报错信息中也提示了data返回为空

第二个看不太明白了

第三条说,url有问题。是mapserver服务有问题,可是输入map文件getmap是可用的?

将它提示的错误urlhttp://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有问题,是这样的吗?怎么跟踪问题?我哪里操作出了问题呢?

一周了,一点进展都没有,很是着急,希望得到您的指导。

展开
收起
爱吃鱼的程序员 2020-06-22 22:52:08 456 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    加上mode=map

    改为:

    url=http://127.0.0.1:80/cgi-bin/mapserv.exe?MAP=F:/ms4w/tutorial/htdocs/example1.map&mode=map

    2020-06-22 22:52:24
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
《如何制作一个水平仪》 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载

相关实验场景

更多