[gdal-dev] GDAL_WMS/TMS with local CRS and bbox problem

Stefan Keller sfkeller at gmail.com
Fri Jan 15 06:34:45 PST 2016


Thanks, Even and Andre!
:S

2016-01-15 13:04 GMT+01:00 Even Rouault <even.rouault at spatialys.com>:
> Le vendredi 15 janvier 2016 12:46:33, Stefan Keller a écrit :
>> Hi
>>
>> I have a GDAL .vrt from a GDAL_WMS/TMS which was tweaked to
>> projection/CRS EPSG:21781 [see below *].
>>
>> The problem here is, that the bbox is way too large. It should be
>> Switzerland but it's larger than europe. (in 21781 it's lowerleftX
>> 480000 loverleft Y 70000 upperrightX 840000 upperrightY 300000)
>>
>> How can I configure the correct bbox in the .vrt?
>> Or is this a problem at server side config. (http://tile.osm.ch/21781/)?
>> In fact I'm wondering anyhow about these current UpperLeftX/UpperLeftY
>> numbers...(which somehow work)?
>
> You have to figure out/find somewhere what is the extent at zoom level 0 in
> EPSG:21781 (thus representing a large part of the world) and put it in the
> GDAL_WMS definition.
>
> Then you can create a view on Switzerland with gdal_translate -srcwin -of VRT.
>
>>
>> :Stefan
>>
>> <GDAL_WMS>
>>   <Service name="TMS">
>>     <ServerUrl>http://tile.osm.ch/21781/${z}/${x}/${y}.png</ServerUrl>
>>   </Service>
>>   <DataWindow>
>>     <UpperLeftX>-20037508.34</UpperLeftX>
>>     <UpperLeftY>20037508.34</UpperLeftY>
>>     <LowerRightX>20037508.34</LowerRightX>
>>     <LowerRightY>-20037508.34</LowerRightY>
>>     <TileLevel>18</TileLevel>
>>     <TileCountX>1</TileCountX>
>>     <TileCountY>1</TileCountY>
>>     <YOrigin>top</YOrigin>
>>   </DataWindow>
>>   <Projection>EPSG:21781</Projection>
>>   <BlockSizeX>256</BlockSizeX>
>>   <BlockSizeY>256</BlockSizeY>
>>   <BandsCount>3</BandsCount>
>>   <Cache />
>> </GDAL_WMS>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com


More information about the gdal-dev mailing list