Opened 8 years ago

Closed 8 years ago

#4114 closed defect (fixed)

[patch]WMS mini driver and WMS driver CRS/SRS tag

Reported by: Kyle Shannon Owned by: warmerdam
Priority: normal Milestone: 1.9.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: wms, wms minidriver
Cc: nowakpl

Description

The WMS Mini driver handles the different tag name depending on the version of WMS (>1.3 is CRS, previous versions are SRS), but the driver does not read or write the proper tag in the xml string:

kyle@Lucky13:~/src/gdal/svn/trunk/gdal$ gdalinfo "WMS:http://imselev.cr.usgs.gov:80/wmsconnector/com.esri.wms.Esrimap/USGS_EDC_Elev_NED?REQUEST=GetMap&VERSION=1.3.0&LAYERS=NED.CONUS_NED&CRS=EPSG:4326&FORMAT=image/tiff&BBOX=-113.0,44.5,-112.75,44.75&WIDTH=600&HEIGHT=600"
ERROR 1: GDALWMS, WMS mini-driver: WMS version 1.3 and above expects CRS however SRS was set instead.
ERROR 1: GDALWMS: Failed to initialize minidriver.
gdalinfo failed - unable to open 'WMS:http://imselev.cr.usgs.gov:80/wmsconnector/com.esri.wms.Esrimap/USGS_EDC_Elev_NED?REQUEST=GetMap&VERSION=1.3.0&LAYERS=NED.CONUS_NED&CRS=EPSG:4326&FORMAT=image/tiff&BBOX=-113.0,44.5,-112.75,44.75&WIDTH=600&HEIGHT=600'.

even though I explicitly used the CRS tag in the url.

The patch reads the CRS tag, and uses it if the version is above 1.3. The version information was pulled from the minidriver.

wms is definitely not my realm, so I will put this up for review.

Attachments (1)

wms_patch.diff (2.4 KB) - added by Kyle Shannon 8 years ago.
wms patch to support CRS variable in wms 1.3+

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Kyle Shannon

Attachment: wms_patch.diff added

wms patch to support CRS variable in wms 1.3+

comment:1 Changed 8 years ago by warmerdam

Cc: nowakpl added

comment:2 Changed 8 years ago by Kyle Shannon

Not sure about warning/error generating, I imagine something should be emitted if the version and SRS/CRS tag don't match.

kss

comment:3 Changed 8 years ago by Even Rouault

Resolution: fixed
Status: newclosed

r22557 /trunk/gdal/frmts/wms/ (wmsdriver.cpp wmsmetadataset.cpp wmsmetadataset.h): WMS: fix handling of WMS 1.3.0 when using a WMS: connection string with VERSION=1.3.0 specified or when parsing the GetCapabilities? document. Axis inversion handling is really rough (only works with EPSG:4326 out of the box, otherwise needs to add the BBOXORDER=yxYX argument) (#4114)

Based on your patch with a few enhancements necessary to make it work with WMS 1.3.0. Thanks

Note that the ESRI WMS service doesn't support WMS 1.3.0 (and your request won't work because the BBOX needs to have x and y swapped so as to be in lat,long order when using EPSG:4326 in WMS 1.3.0). I've tested the changeset with "WMS:http://demo.mapserver.org/cgi-bin/wms?SERVICE=WMS&VERSION=1.3.0"

Note: See TracTickets for help on using tickets.