[Geomoose-users] NFHL WMS from mapfile

Johan Forsman Johan.Forsman at LA.GOV
Fri Sep 17 09:49:16 EDT 2010


Now this is an interesting discussion. On my end using the same sources I also get similar errors.
I have seen these errors with just about every WMS I have tried as a direct source in the mapbook (I have not tried using MapServer as an intermediary before), and in every case it appears to be related to the size of the image requested by GM. I may be going about this the wrong way, but here is what I have investigated:

Using GM 2.2 under FGS 95 on linux, with EPSG:900913 mapbook.

For mapbook WMS sources I may have something like:

<map-source name="fema_wms" type="wms" tiled="false" projection="EPSG:4326" >
            <url>http://hazards.fema.gov/wmsconnector/wmsconnector/com.esri.wms.Esrimap/NFHL?</url>
            <layer name="Q3 Flood Hazards (red)" ></layer>
            <param name="format" value="image/png"/>
            <param name="TRANSPARENT" value="TRUE"/>
</map-source>

This layer will work just fine once I get to ~1:110000, presumably there is a scale limit on the WMS.

The issue is it will ONLY work if I hard-code the WIDTH and HEIGHT parameters in compiled.js using 1024 or less.

The URL GM sends if I do not restrict the sizes looks like e.g.
http://hazards.fema.gov/wmsconnector/wmsconnector/com.esri.wms.Esrimap/NFHL?FORMAT=image%2Fpng&TRANSPARENT=TRUE&STYLES=&LAYER=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&LAYERS=Q3%20Flood%20Hazards%20(red)&BBOX=-91.08713148755879,30.503635126158578,-90.62673567465326,30.80975363607718&WIDTH=1341&HEIGHT=1036

The end of that URL is the culprit I think. Max size for the FEMA WMS source is 1024x1024.

I attempted to include the 1024 size parameters in the mapbook but that did not change the requested size. It did however change the position of the size parameters in the URL:
http://hazards.fema.gov/wmsconnector/wmsconnector/com.esri.wms.Esrimap/NFHL?FORMAT=image%2Fpng&TRANSPARENT=TRUE&STYLES=&HEIGHT=1036&WIDTH=1341&LAYER=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&LAYERS=Q3%20Flood%20Hazards%20(red)&BBOX=-90.98756788893812,30.416629347292723,-90.52717207603257,30.723022605026703

If I hard-code the sizes in compiled.js, and remove the size parameter in the mapbook, then the URL looks like
http://hazards.fema.gov/wmsconnector/wmsconnector/com.esri.wms.Esrimap/NFHL?FORMAT=image%2Fpng&TRANSPARENT=TRUE&STYLES=&LAYER=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&LAYERS=Q3%20Flood%20Hazards%20(red)&BBOX=-90.98825453445235,30.411299939414775,-90.52785872152884,30.717710003563038&WIDTH=1024&HEIGHT=1024

This last one produces a successful image. Note the WIDTH and HEIGHT parameters at the end.

I noticed this in the Firefox Page Info tool for the successful image request:
Dimensions: 1,024px × 1,024px (scaled to 1,341px × 1,036px).

If I try using MapServer as the intermediary to the WMS source, copying Elizabeth’s mapfile nearly verbatim, it does not work at all. Pink screen and the following error in the logfile:
msDrawMap(): WMS connection error. Failed to draw WMS layer named 'avail_data'. 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. msDrawRaster(): Image handling error. Unrecognized or unsupported image format drawEPP(): Image handling error. /opt/fgs/tmp/ms_tmp/4c936dca_4f68_0.img.tmp is not an EPPL file.

The URL sent by GM looks like
http://geoview.dhh.la.gov:8080/cgi-bin/mapserv?map=%2Fopt%2Ffgs%2Fapps%2Fgeomoose2%2Fmaps%2Fsdwp%2Fother_agency_data%2Ffema_wms.map&layers=avail_data&mode=map&mapext=-10997759.439297+3010701.1615728+-9357726.5607032+4278332.8384272&imgext=-10997759.439297+3010701.1615728+-9357726.5607032+4278332.8384272&map_size=1341+1036&imgx=670.5&imgy=518&imgxy=1341+1036

A direct URL to MapServer using the same extents works just fine and looks like
http://geoview.dhh.la.gov:8080/cgi-bin/mapserv?map=%2Fopt%2Ffgs%2Fapps%2Fgeomoose2%2Fmaps%2Fsdwp%2Fother_agency_data%2Ffema_wms.map&layers=avail_data&mode=map&mapext=-10997759.439297+3010701.1615728+-9357726.5607032+4278332.8384272&imgext=-10997759.439297+3010701.1615728+-9357726.5607032+4278332.8384272

The only difference I see between those two URLs is the last bit about the size.

Please note for the MapServer examples I used a layer I know will draw at the full-state scale.

I have stared at this for so long I am very likely missing something terribly and embarrassingly obvious, but there appears to be an issue, at least on my version of GM2.2, with the requested image size being too large.

Perhaps we can instruct the responsible code to look for size parameters in the mapbook first, then default to a reasonably safe maximum if none is specified?

Thanks for taking the time to read all this. I hope some of it helps troubleshooting.

/Johan.
----------------------
Johan Forsman
Geologist
Safe Drinking Water Program
Louisiana Department of Health and Hospitals
Office of Public Health
Telephone: 225.342.7309
Telefax: 225.342.7303



From: Len Kne [mailto:lkne at houstoneng.com]
Sent: Wednesday, September 15, 2010 11:56 AM
To: 'Miller, Elizabeth (DOT)'; Dan Little; geomoose-users at lists.sourceforge.net
Subject: Re: [Geomoose-users] NFHL WMS from mapfile

I tried your map file and it works for me http://dev.houstoneng.net/geomoose.html  – using this as the map-source:

                <map-source name="flood" type="mapserver" tiled="true" >
                                <file>./demo/landrecords/flood.map</file>
                                <layer name="Flood Data Availability"/>
                </map-source>

Generally if there are no error messages or pink screens, the issue is in the Mapbook - like the map-source/layer does not match in the catalog.

Len

From: Miller, Elizabeth (DOT) [mailto:Elizabeth.Miller at state.mn.us]
Sent: Wednesday, September 15, 2010 9:57 AM
To: Dan Little; geomoose-users at lists.sourceforge.net
Subject: Re: [Geomoose-users] NFHL WMS from mapfile

I put tiled=”true” in the map-source and still get nothing. I’ve also tried resizing the browser window to see if that made a difference for Geomoose but it didn’t.

From: Dan Little [mailto:danlittle at yahoo.com]
Sent: Wednesday, September 15, 2010 9:07 AM
To: Miller, Elizabeth (DOT); geomoose-users at lists.sourceforge.net
Subject: Re: [Geomoose-users] NFHL WMS from mapfile

Given the email I just got from Elizabeth and looking at the results of shp2img (from Brent's email), I would bet serious money (like $20 or a couple cases of beer) that MapServer is trying to request an image greater than 1024 x 1024.  This is causing MapServer to get an invalid response and returning a blank image.

Tell GeoMOOSE to tile the layer and see if you start getting reasonable results.


From: "Miller, Elizabeth (DOT)" <Elizabeth.Miller at state.mn.us>
To: Dan Little <danlittle at yahoo.com>; "geomoose-users at lists.sourceforge.net" <geomoose-users at lists.sourceforge.net>
Sent: Wed, September 15, 2010 8:59:00 AM
Subject: RE: [Geomoose-users] NFHL WMS from mapfile
No, no pink screen. Just nothing.

From: Dan Little [mailto:danlittle at yahoo.com]
Sent: Wednesday, September 15, 2010 8:46 AM
To: Miller, Elizabeth (DOT); geomoose-users at lists.sourceforge.net
Subject: Re: [Geomoose-users] NFHL WMS from mapfile

Are you getting a Pink Screen of Death in GeoMOOSE? If the image is blank then I would be that MapServer is trying to request an image larger than the restricted size (1024x1024).

From: "Miller, Elizabeth (DOT)" <Elizabeth.Miller at state.mn.us>
To: Dan Little <danlittle at yahoo.com>; "geomoose-users at lists.sourceforge.net" <geomoose-users at lists.sourceforge.net>
Sent: Wed, September 15, 2010 8:33:21 AM
Subject: RE: [Geomoose-users] NFHL WMS from mapfile
Here is the map-source from the mapbook:

<map-source name="fema" type="mapserver" tiled="false" reference="false">
                <file>/ms4w/apps/metrogis/maps/mapfiles_metro/WMS/fema_wms.map</file>
<layer name="Flood Data Availability"/>
</map-source>

And in the catalog portion of the mapbook:

http://msc.fema.gov


I should also add that there are scale restrictions on the various layers in the service, but I have tried various layers and can’t get any of them to work. “Flood Data Availability” may not have been the best example to use here because it does not display at large scales (larger than 1:300,000).

Also, the service is not tiled and the maximum image size is 1024 x 1024 pixels. ArcMap is able to bring it in and it displays correctly.

I can get the service to display in Geomoose if I reference it directly from the mapbook but I would like to use a mapfile and bring it in that way. If I pull it in directly in the mapbook this works:

                <map-source name="fema" type="wms" tiled="false" reference="false" projection="EPSG:4326">
                                                http://hazards.fema.gov/wmsconnector/wmsconnector/Servlet/NFHL?
                                                <layer name="Flood_Hazard_Zones_General"/>
                                                <layer name="Q3 Flood Hazards (red)"/>
                                                <layer name="Floodways"/>
                                                <param name="format" value="image/jpeg"/>
                                                <param name="TRANSPARENT" value="TRUE"/>
                                                <param name="styles" value=""/>
                </map-source>



From: Dan Little [mailto:danlittle at yahoo.com]
Sent: Tuesday, September 14, 2010 3:19 PM
To: Miller, Elizabeth (DOT); geomoose-users at lists.sourceforge.net
Subject: Re: [Geomoose-users] NFHL WMS from mapfile

Can you attach the Mapbook? or Copy and paste the mapbook entry that pertains to the WMS?

From: "Miller, Elizabeth (DOT)" <Elizabeth.Miller at state.mn.us>
To: "geomoose-users at lists.sourceforge.net" <geomoose-users at lists.sourceforge.net>
Sent: Tue, September 14, 2010 11:32:59 AM
Subject: [Geomoose-users] NFHL WMS from mapfile
I have not been able to bring in the FEMA NFHL Flood Mapping WMS into my Geomoose map via a mapfile. What am I missing? Can anyone help??? Here is my mapfile. I have tried both “Flood Data Availability” and “HDM:Q3_COUNTYMAP” as the wms_name, and have tried calling both from the map-source in the mapbook file. Maybe there is a problem with the extent?

Thank you for any help.

Liesa Miller
MnDOT
Saint Paul, Minnesota

---------------------------------------------------------------------------------------------------------------------
MAP
  NAME 'fema_wms'
  SIZE 800 650
  STATUS ON
  EXTENT 189783.560000 4816309.330000 761653.524114 5472346.500000
  UNITS METERS
  IMAGETYPE PNG
  TRANSPARENT TRUE


                WEB
                                INCLUDE "../../temp_directory.map"
                END

  PROJECTION
    'init=epsg:26915'
  END


  LAYER

      NAME        Flood Data Availability
      TYPE           RASTER
      STATUS      DEFAULT
      OFFSITE     0 0 0

      CONNECTIONTYPE WMS
      CONNECTION "http://hazards.fema.gov/wmsconnector/wmsconnector/Servlet/NFHL?"



      METADATA
        "wms_title" "Flood Data Availability"
        "wms_srs" "EPSG:4326"
        "wms_name" "HDM:Q3_COUNTYMAP"
        "wms_server_version" "1.1.1"
        "wms_format" "image/png"
        "wms_styles" ""
        "wms_exceptions" "application/vnd.ogc.se_inimage"

       END

      PROJECTION
        "init=epsg:4326"
      END



  END #layer



END #Map






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20100917/32f71c8f/attachment.html


More information about the Geomoose-users mailing list