WMS Help please

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Mon Nov 27 22:58:33 EST 2006


Sorry for replying to my own post, but I am making some progress only to 
find additional problems.

1) it looks like the WMS UserAgent "MapServer/4.10 lubcurl..." is being 
blocked by jpl. I modified the source to maphttp.c and mangled the user 
agent string - the 403 message went away and I got an image! Well I got 
the image into the web.tmp directory.

2) then mapserver crashed trying to process the png RGBA wms image into 
map image.

3) So I tried jpeg format and it responded with:
msDrawMap(): WMS connection error. Failed to draw WMS layer named 
'global_landsat'. This most likely happened because the remote WMS 
server returned an invalid image, and XML exception or another 
unexpected result in response to the GetMap request. Also check and make 
sure that the layer's connection URL is valid.
drawJPEG(): Unable to access file. Only grayscale JPEG images are 
supported.

4) So I tried tiff format and it responded with:
msDrawMap(): WMS connection error. Failed to draw WMS layer named 
'global_landsat'. This most likely happened because the remote WMS 
server returned an invalid image, and XML exception or another 
unexpected result in response to the GetMap request. Also check and make 
sure that the layer's connection URL is valid.
drawTIFF(): Image handling error. Only colormapped and grayscale images 
are supported.

5) the issue with wms_styles looks like a code bug after reading through 
the code, if I understand it correctly. I have written a bug:
    http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1974
if anyone in interested in it.

So something is borked!

Can anyone get this mapfile to work with any wms connection on 4.10?

-Steve

Stephen Woodbridge wrote:
> percy,
> 
> Thanks, but that does not seem to work for me. On 4.6.2, which has WMS 
> server but does not list WMS client, or 4.10 which has support for both.
> "wms_styles" does not seem to get picked up and added to the url but if 
> I add the styles= to the CONNECTION url it fails with the 403 error, but 
> if I copy and paster the url from the debug log into the browser I get 
> the expected image.
> 
> I think this is another bug.
> 
> Can anyone else test this and let me know if they can reproduce it. I am 
> wondering if  jpl is blocking the Mapserver client?
> 
> Here is a test mapfile:
> 
> MAP
>   NAME "wms-jpl"
>   STATUS ON
>   EXTENT -180.0 -90.0 180.0 90.0
>   SIZE 400 250
>   IMAGECOLOR 200 200 200
>   IMAGETYPE png
>   UNITS DD
>   #DEBUG ON
>   PROJECTION
>     "init=epsg:4326"
>   END
> 
>   WEB
>     IMAGEPATH "/tmp/ms_tmp/"
>     IMAGEURL "/ms_tmp/"
>   END
> 
>   LAYER
>     NAME "global_landsat"
>     TYPE RASTER
>     DEBUG TRUE
>     STATUS DEFAULT
>     MINSCALE 20000
>     CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?STYLES="
> 
> # following does not pick up the wms_styles
> #    CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?"
> 
>     CONNECTIONTYPE WMS
>     METADATA
>       "wms_srs"            "EPSG:4326"
>       "wms_name"           "modis,global_mosaic"
>       "wms_styles"         ""    #### this seems to be ignored!!!
>       "wms_server_version" "1.1.1"
>       "wms_format"         "image/png"
>     END
>   END
> 
> END
> 
> 
> -Steve
> 
> percy wrote:
>> Steve, here's mine that works in 4.6
>>
>>     LAYER
>>         NAME global_landsat
>>         TYPE RASTER
>>         STATUS on
>>         CONNECTIONTYPE WMS
>>         CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?"
>>         MINSCALE 20000
>>         METADATA
>>             "wms_server_version" "1.1.1"
>>             "wms_srs" "EPSG:4326"
>>             "wms_format" "image/jpeg"
>>             "wms_styles" ""
>>             "wms_name" "modis,global_mosaic"
>>         END
>>     END
>>
>>
>> Stephen Woodbridge wrote:
>>> Any WMS experts online, I still haven't figured this one out.
>>>
>>> Is it just me or has the list been pretty quite lately?
>>>
>>> -Steve
>>>
>>> Stephen Woodbridge wrote:
>>>> Hi all,
>>>>
>>>> Just downloaded and built mapserver 4.10 and I'm have a strange 
>>>> problem with a WMS Layer.
>>>>
>>>> The apache error log says:
>>>>
>>>> libpng warning: Incomplete compressed datastream in iCCP chunk
>>>> libpng warning: Profile size field missing from iCCP chunk
>>>> [Sun Nov 26 18:29:29 2006].383652 HTTP: Starting to prepare HTTP 
>>>> requests.
>>>> [Sun Nov 26 18:29:29 2006].383796 HTTP request: id=0, 
>>>> http://wms.jpl.nasa.gov/wms.cgi?STYLES=&LAYERS=global%5Fmosaic&REQUEST=GetMap&SERVICE=WMS&FORMAT=image%2Fpng&HEIGHT=200&VERSION=1.1.1&SRS=EPSG:4326&WIDTH=300&BBOX=35%2E2716150733968%2C33%2E7132053155979%2C35%2E7478323266032%2C34%2E0306834844021&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage 
>>>>
>>>> [Sun Nov 26 18:29:29 2006].383989 HTTP: Before download loop
>>>> [Sun Nov 26 18:29:29 2006].774669 msHTTPWriteFct(id=0, 595 bytes)
>>>> [Sun Nov 26 18:29:29 2006].774730 msHTTPWriteFct(id=0, 73 bytes)
>>>> [Sun Nov 26 18:29:29 2006].774748 msHTTPWriteFct(id=0, 9 bytes)
>>>> [Sun Nov 26 18:29:29 2006].774765 msHTTPWriteFct(id=0, 115 bytes)
>>>> [Sun Nov 26 18:29:29 2006].774780 msHTTPWriteFct(id=0, 166 bytes)
>>>> [Sun Nov 26 18:29:29 2006].774800 msHTTPWriteFct(id=0, 1 bytes)
>>>> [Sun Nov 26 18:29:29 2006].874799 HTTP: After download loop
>>>> [Sun Nov 26 18:29:29 2006].874819 msHTTPExecuteRequests() timing 
>>>> summary per layer (connect_time + time_to_first_packet + 
>>>> download_time = total_time in seconds)
>>>> [Sun Nov 26 18:29:29 2006].874886 HTTP: HTTP GET request failed with 
>>>> status 403 () for 
>>>> http://wms.jpl.nasa.gov/wms.cgi?STYLES=&LAYERS=global%5Fmosaic&REQUEST=GetMap&SERVICE=WMS&FORMAT=image%2Fpng&HEIGHT=200&VERSION=1.1.1&SRS=EPSG:4326&WIDTH=300&BBOX=35%2E2716150733968%2C33%2E7132053155979%2C35%2E7478323266032%2C34%2E0306834844021&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage 
>>>>
>>>> [Sun Nov 26 18:29:29 2006].874920 Layer 0: 0.125 + 0.266 + 0.225 = 
>>>> 0.615s
>>>> [Sun Nov 26 18:29:29 2006].875030 msDrawMap(): Layer 0 (JPL-WMS), 
>>>> 0.000s
>>>>
>>>> If I load the URL directly into the browser is returns fine, but 
>>>> from mapserver I get
>>>>
>>>> HTTP: HTTP GET request failed with status 403 () ... from above.
>>>>
>>>> The layer definition looks like:
>>>>
>>>>   LAYER
>>>>     NAME "JPL-WMS"
>>>>     TYPE RASTER
>>>>     DEBUG TRUE
>>>>     STATUS DEFAULT
>>>>     CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?STYLES="
>>>>     CONNECTIONTYPE WMS
>>>>     METADATA
>>>>       "wms_srs"            "EPSG:4326"
>>>>       "wms_name"           "global_mosaic"
>>>>       "wms_server_version" "1.1.1"
>>>>       "wms_format"         "image/png"
>>>>     END
>>>>   END
>>>>
>>>>
>>>> MapServer version 4.10.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG 
>>>> OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE 
>>>> SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT INPUT=TIFF INPUT=EPPL7 
>>>> INPUT=JPEG INPUT=POSTGIS INPUT=SHAPEFILE DEBUG=MSDEBUG
>>>>
>>>> Anyone have a clue on what I'm doing wrong, or is this a bug?
>>>>
>>>> Thanks,
>>>>   -Steve W
>>>
>>



More information about the mapserver-users mailing list