Opened 9 years ago

Last modified 5 years ago

#5849 closed enhancement

TMS Minidriver - support TileCache directory structure — at Version 2

Reported by: mko Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description (last modified by mko)

The TMS Minidriver may by used with local files by pointing the ServerUrl to the local file system in the local service description XML file:

<ServerUrl>file:///data/${z}/${x}/${y}.png</ServerUrl>

Unfortunately, there are other dirctory layouts besides ${z}/${x}/${y}. Please support as replacement variables:

  • for the TileCache directory layout ${x0}, ${x1}, ${x2} and ${y0}, ${y1}, ${y2} in order to generate paths/URLs like zz/xxx/xxx/xxx/yyy/yyy/yyy.format
  • inverted values such as {inv_x} (= maxx-x-1) etc.
  • a {$zz} with leading zero for levels 0-9

Change History (2)

comment:1 by Even Rouault, 9 years ago

Patch appreciated.

Part of it is already implemented by the way :

    /* Hack for some TMS like servers that require tile numbers split into 3 groups of */
    /* 3 digits, like http://tile8.geo.admin.ch/geoadmin/ch.swisstopo.pixelkarte-farbe */
    URLSearchAndReplace(url, "${xxx}", "%03d/%03d/%03d", tiri.m_x / 1000000, (tiri.m_x / 1000) % 1000, tiri.m_x % 1000);
    URLSearchAndReplace(url, "${yyy}", "%03d/%03d/%03d", tms_y / 1000000, (tms_y / 1000) % 1000, tms_y % 1000);

Not sure to understand why you mean by {$z} without leading zero. It should already be the case.

comment:2 by mko, 9 years ago

Description: modified (diff)

Thank you for pointing to ${xxx}. Any chance to get this into the docs?

Ticket description modified regaring ${z}: in order to work with local file system caches, ${zz} (levels 00, 01, .. 24 in stead of 0, 1, .. 24) would be required.

Note: See TracTickets for help on using tickets.