[gdal-dev] Index Tiling Questions for WMTS, Bing, Google/TMS

Even Rouault even.rouault at spatialys.com
Thu Nov 17 13:21:27 PST 2016


Le jeudi 17 novembre 2016 21:53:47, esacree a écrit :
> A few questions based on the GDAL examples for Google, Bing/VirtualEarth
> and WMTS tile servers.
> 
> 1.  Google Maps has the tile/image origin in the upper left corner.  TMS
> has the tile image origin in the lower left corner.   Where should the
> tile/image origin be for Google maps when using the GDAL_WMS driver with
> the TMS service?  Does it use the Google Maps tile origin or the TMS tile
> origin?

See the example mentionned in http://gdal.org/frmt_wms.html :
http://gdal.org/frmt_wms_googlemaps_tms.xml

==> <YOrigin>top</YOrigin>


> 
> 2.  For WMTS where is the image origin?  I've read that the origin is at
> the lower left corner as for TMS. Is this correct?

No, this is top-left. See http://www.opengeospatial.org/standards/wmts page 9 
:
"Each tile in a tile matrix is identified by its TileCol and TileRow indices 
that have their
0,0 origin in the tile next to the top left corner of the tile matrix and that 
increases
towards the right and towards the bottom respectively, as shown in figure 2."


> 
> 3.  For the USGS NationalMap WMTS servers there are 2 TileMatrixSets.  One
> is default0028nm and the other is the GoogleMapsCompatible tile matrix set.
> Should both tile matrix sets be indexed the same way?

Yes ? Not sure to understand. The way WMTS works is the same of course 
whatever the tile matrix set, but indices will possibly change. That's an 
implementation detail anyway that you shouldn't care about when using the GDAL 
driver.

> 
> 3.  For Bing/VirtualEarth the GDAL example is extremely brief.  It doesn't
> show a data window or tile counts in the example.  A look at the
> minidriver_virtualearth.cpp file doesn't help.  How do you get
> Bing/VirtualEarth to retrieve more than one tile at a time?

Looking quickly at the VirtualEarth example, there's nothing particular to do 
in the definition once you've set the URL.

$ gdal_translate http://gdal.org/frmt_wms_virtualearth.xml out.tif \
		-outsize 1024 1024 --debug HTTP

HTTP: Fetch(http://gdal.org/frmt_wms_virtualearth.xml)
Input file size is 134217728, 134217728
0HTTP: Requesting [1/4] 
http://a2.ortho.tiles.virtualearth.net/tiles/a00.jpeg?g=90
HTTP: Requesting [2/4] 
http://a3.ortho.tiles.virtualearth.net/tiles/a01.jpeg?g=90
HTTP: Requesting [3/4] 
http://a0.ortho.tiles.virtualearth.net/tiles/a10.jpeg?g=90
HTTP: Requesting [4/4] 
http://a1.ortho.tiles.virtualearth.net/tiles/a11.jpeg?g=90
HTTP: Request [0] http://a2.ortho.tiles.virtualearth.net/tiles/a00.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [1] http://a3.ortho.tiles.virtualearth.net/tiles/a01.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [2] http://a0.ortho.tiles.virtualearth.net/tiles/a10.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [3] http://a1.ortho.tiles.virtualearth.net/tiles/a11.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
...10...20..HTTP: Requesting [1/4] 
http://a3.ortho.tiles.virtualearth.net/tiles/a02.jpeg?g=90
HTTP: Requesting [2/4] 
http://a0.ortho.tiles.virtualearth.net/tiles/a03.jpeg?g=90
HTTP: Requesting [3/4] 
http://a1.ortho.tiles.virtualearth.net/tiles/a12.jpeg?g=90
HTTP: Requesting [4/4] 
http://a2.ortho.tiles.virtualearth.net/tiles/a13.jpeg?g=90
HTTP: Request [0] http://a3.ortho.tiles.virtualearth.net/tiles/a02.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [1] http://a0.ortho.tiles.virtualearth.net/tiles/a03.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [2] http://a1.ortho.tiles.virtualearth.net/tiles/a12.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [3] http://a2.ortho.tiles.virtualearth.net/tiles/a13.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
.30...40...50HTTP: Requesting [1/4] 
http://a0.ortho.tiles.virtualearth.net/tiles/a20.jpeg?g=90
HTTP: Requesting [2/4] 
http://a1.ortho.tiles.virtualearth.net/tiles/a21.jpeg?g=90
HTTP: Requesting [3/4] 
http://a2.ortho.tiles.virtualearth.net/tiles/a30.jpeg?g=90
HTTP: Requesting [4/4] 
http://a3.ortho.tiles.virtualearth.net/tiles/a31.jpeg?g=90
HTTP: Request [0] http://a0.ortho.tiles.virtualearth.net/tiles/a20.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [1] http://a1.ortho.tiles.virtualearth.net/tiles/a21.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [2] http://a2.ortho.tiles.virtualearth.net/tiles/a30.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [3] http://a3.ortho.tiles.virtualearth.net/tiles/a31.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
...60...70..HTTP: Requesting [1/4] 
http://a1.ortho.tiles.virtualearth.net/tiles/a22.jpeg?g=90
HTTP: Requesting [2/4] 
http://a2.ortho.tiles.virtualearth.net/tiles/a23.jpeg?g=90
HTTP: Requesting [3/4] 
http://a3.ortho.tiles.virtualearth.net/tiles/a32.jpeg?g=90
HTTP: Requesting [4/4] 
http://a0.ortho.tiles.virtualearth.net/tiles/a33.jpeg?g=90
HTTP: Request [0] http://a1.ortho.tiles.virtualearth.net/tiles/a22.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [1] http://a2.ortho.tiles.virtualearth.net/tiles/a23.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [2] http://a3.ortho.tiles.virtualearth.net/tiles/a32.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
HTTP: Request [3] http://a0.ortho.tiles.virtualearth.net/tiles/a33.jpeg?g=90 : 
status = 200, content type = image/jpeg, error = (null)
.80...90...100 - done.


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


More information about the gdal-dev mailing list