melowntech / vts-mapproxy

VTS Mapproxy
BSD 2-Clause "Simplified" License
30 stars 5 forks source link

Question how to use tiled WMS (ensure that cached tiling is being used) and a small feature request #26

Closed pjanetzek closed 1 year ago

pjanetzek commented 1 year ago

Hey it seems I took down ESA's WMS today by using it as a VTS dataset. (https://worldcover2021.esa.int/downloader)

I used

gdal_translate -of WMS "WMS:https://worldcover2020.esa.int/geoserver/gwc/service/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=esa_worldcover2021%3Aesa_worldcover2021&WIDTH=256&HEIGHT=256&SRS=EPSG:4326&tiled=true" landcover2021.xml

and modified it to

<GDAL_WMS>
  <Service name="WMS">
    <Version>1.1.1</Version>
    <ServerUrl>https://worldcover2020.esa.int/geoserver/gwc/service/wms?</ServerUrl>
    <Layers>esa_worldcover2021%3Aesa_worldcover2021</Layers>
    <SRS>EPSG:4326</SRS>
    <tiled>true</tiled>
    <WIDTH>256</WIDTH>
    <HEIGHT>256</HEIGHT>
    <ImageFormat>image/png</ImageFormat>
    <Transparent>TRUE</Transparent>
    <BBoxOrder>xyXY</BBoxOrder>
  </Service>
  <DataWindow>
    <UpperLeftX>-90.000000</UpperLeftX>
    <UpperLeftY>180.000000</UpperLeftY>
    <LowerRightX>90.000000</LowerRightX>
    <LowerRightY>-180.000000</LowerRightY>
    <SizeX>536870912</SizeX>
    <SizeY>1073741824</SizeY>
  </DataWindow>
  <BandsCount>4</BandsCount>
  <BlockSizeX>256</BlockSizeX>
  <BlockSizeY>256</BlockSizeY>
  <OverviewCount>20</OverviewCount>
</GDAL_WMS>

Changing BlockSizeX/Y to 256 was necessary to get a response from the server otherwise it fails with a gdal error about X,Y values for the tile index were calculated to be {0.5, -0.5} which had to be rounded to {1, 0} and exceeds the threshold of 10%. Perhaps the client is using the wrong origin ?

Still tile loading took ages and when I went back to the website it got unresponsive as well. Could this be an issue with their WMS setup or something VTS could handle better?

In any case it would be great if mapproxy with DEBUG loglevel shows the gdal network request url to help investigate this further.

pjanetzek commented 1 year ago

The answer here seems related https://gis.stackexchange.com/questions/119240/using-geowebcache-tiles-with-default-geoserver-url

pjanetzek commented 1 year ago

alright - found the https://trac.osgeo.org/gdal/wiki/ConfigOptions#CPL_CURL_VERBOSE env var

pjanetzek commented 1 year ago

Got it working now