2017-05-15 57 views
0

我只是遇到了一個問題,試圖使用Mapserver顯示我的地圖與GetMap請求,但它返回一個白色的圖像。我做了搜索,但我並沒有找到答案: 我的地圖文件:GetMap請求返回白色圖像

MAP 
    IMAGETYPE  PNG 
    EXTENT  -21 20 1 36 
    SIZE   700 400 
    IMAGECOLOR  255 255 255 
     PROJECTION 
     "init=epsg:4326" 
    END 
    OUTPUTFORMAT 
    NAME png 
    MIMETYPE image/png 
    DRIVER GD/PNG 
    EXTENSION png 
    IMAGEMODE PC256 
    TRANSPARENT FALSE 
    END 
    WEB 
    METADATA 
    "wms_title" "Dans Layers and Stuff" 
    "wms_onlineresource" "http://localhost:81/cgi-bin/mapserv.exe?" 
    "wms_enable_request" "*" 
    "wms_srs" "EPSG:4326" 
    "wms_feature_info_mime_type" "text/html" 
    "wms_format" "image/png" 
    END 
END 
LAYER 

NAME map1 
TYPE polygon 
STATUS default 
CONNECTIONTYPE postgis 
CONNECTION "dbname=postgres host=localhost port=5432 user=postgres" 
DATA "geom from comgeo" 
    PROJECTION 
     "init=epsg:4326" 
    END 
    METADATA 
    "wms_title" "map1" 
    END 
PROCESSING "SCALE=AUTO" 
CLASS 
    STYLE 
    COLOR 232 232 232 
    OUTLINECOLOR 32 32 32 
END 
END 
END 
END 

這個我用我的請求,鏈接:

http://localhost:81/cgi-bin/mapserv.exe?map=/wamp64/www/wordpress/map1.map&version=1.3.0&request=GetMap&CRS=EPSG:4326&bbox=-21,20,1,36&width=760&height=360&layers=map1&styles=&FORMAT=image/png&TRANSPARENT=TRUE 

的BBOX值是否正確。謝謝 enter image description here

回答

0

我沒有解決probleme當我更換EPSG:4326與CRS:84和網址:

http://localhost:81/cgi-bin/mapserv.exe?map=/wamp64/www/wordpress/map1.map&request=GetMap&SERVICE=WMS&version=1.3.0&CRS=CRS:84&bbox=-21,20,1,36&width=700&height=400&layers=map1&styles=&FORMAT=image/png&TRANSPARENT=TRUE 
+0

或者您可以切換BBOX中的座標順序 – user27874

1

您的URL似乎缺少SERVICE = WMS參數。

+0

我試過,但我得到thesame結果:HTTP://本地主機:81/cgi-bin目錄/ mapserv.exe MAP =/wamp64 /網絡/ WordPress的/ map1.map&請求=的GetMap&SERVICE = WMS&版本= 1.3.0&CRS = EPSG:4326&BBOX = -21,20,1,36&寬度= 700 HEIGHT = 400&層= MAP1&樣式=&FORMAT =圖像/ PNG&TRANSPARENT = TRUE –

+0

在數據庫中,此查詢報告「從comgeo中選擇st_extents(geom) –

+0

從comgeo中選擇st_extent(geom)return this:Box(-17 .... 20 ..... -1 ..... 35 .....) –