[gdal-dev] gdalinfo of a WMS layer

Even Rouault even.rouault at spatialys.com
Tue Feb 26 02:03:25 PST 2019


On mardi 26 février 2019 09:42:32 CET Andrew C Aitchison wrote:
> On Tue, 26 Feb 2019, Ari Jolma wrote:
> > I'm wondering why
> > 
> > gdalinfo
> > "WMS:http://tiles.kartat.kapsi.fi/taustakartta?layers=taustakartta"
> > 
> > and
> > 
> > gdalinfo
> > "WMS:http://tiles.kartat.kapsi.fi/taustakartta?layers=taustakartta&srs=eps
> > g:3857"
> > 
> > both report corner coordinates in degrees although the second one reports
> > EPSG 3857?
> > 
> > What am I missing?
> 
> From man gdalinfo
> 
>       The gdalinfo will report all of the following (if known):
>  	...
>  	Corner coordinates in georeferenced, and if possible lat/long
>  	based on the full geotransform (but not GCPs).
> 
> ... so this is a feature of gdalinfo.

No. Ari's issue is different


Ari, if you do
gdalinfo "WMS:http://tiles.kartat.kapsi.fi/taustakartta?layers=taustakartta&srs=epsg:3857"
you go through https://github.com/OSGeo/gdal/blob/master/gdal/frmts/wms/wmsdriver.cpp#L63
which doesn't issue a GetCapabilities request at all, but take URL parameters and some default values to
create the XML definition file

What you can do is:
- the same, but without the layers= URL option
gdalinfo "WMS:http://tiles.kartat.kapsi.fi/taustakartta?srs=epsg:3857"
- and from the reported subdatasets:
gdalinfo "WMS:http://tiles.kartat.kapsi.fi/taustakartta?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=taustakartta&SRS=EPSG:3857&BBOX=1.59575e+06,8.18004e+06,3.85994e+06,1.12226e+07
"

GDALWMSDatasetGetConfigFromURL() should probably have some restrictions/warnings
in the case where SRS is defined to something else than EPSG:4326 but BBOX is not defined.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list