liujiusheng / blog

个人博客,blog
19 stars 0 forks source link

MapServer的一次探索 #182

Closed liujiusheng closed 3 years ago

liujiusheng commented 3 years ago

近日有心对MapServer和GeoServer做一次对比,讲真,如果要想做二次开发一定是基于MapServer,如果只是简单用一下,首选肯定得是GeoServer。MapServer是基于C语言的,而且是CGI模式,很好用其它语言包装(Wrapper),

晚上研究到1.30,眼睛都快瞎了,终于找到了问题的关键。一些关键点:

配置坐标系转换参数:

CONFIG "PROJ_LIB" "D:\software\nginx-1.13.4\proj\nad"

执行命令行输出到本地文件

要使用cmd来执行,不能用powershell执行,原因未知

mapserv.exe -nh QUERY_STRING="map=../mapconfig/local-demo/local.map&layers=ocean%20countries%20lakes%20ocean-labels%20places&mode=map&map_imagetype=png&mapext=75.2755005+24.56595675+120.3506505+54.61605675&imgext=75.2755005+24.56595675+120.3506505+54.61605675&map_size=600+400&imgx=300&imgy=200&imgxy=600+400" >test.png

本地输出的时候要加上-nh ,防止http请求头被写入到文件中,导致文件读不出来。

liujiusheng commented 3 years ago

重复填写了