1

I'm in need to process a large batch of Landsat images with MapTiler and since the version I'm using (1.0 Beta 2) does not support multiple input files, I created a simple Python script that calls gdal2tiles for every file.

The problem is that using, apparently, the same settings, I get different coordinates.

This is the correct output from MapTiler:

 <?xml version="1.0" encoding="utf-8"?>
    <TileMap version="1.0.0" tilemapservice="http://tms.osgeo.org/1.0.0">
      <Title>mar_apr.tif</Title>
      <Abstract></Abstract>
      <SRS>EPSG:900913</SRS>
      <BoundingBox minx="-26.36147186954573" miny="-65.83667775218426" maxx="-21.96598523780907" maxy="-62.31334995428857"/>
      <Origin x="-26.36147186954573" y="-65.83667775218426"/>
      <TileFormat width="256" height="256" mime-type="image/png" extension="png"/>
      <TileSets profile="mercator">
        <TileSet href="6" units-per-pixel="2445.98490468750010" order="6"/>
        <TileSet href="7" units-per-pixel="1222.99245234375010" order="7"/>
        <TileSet href="8" units-per-pixel="611.49622617187504" order="8"/>
        <TileSet href="9" units-per-pixel="305.74811308593752" order="9"/>
        <TileSet href="10" units-per-pixel="152.87405654296876" order="10"/>
        <TileSet href="11" units-per-pixel="76.43702827148438" order="11"/>
        <TileSet href="12" units-per-pixel="38.21851413574219" order="12"/>
        <TileSet href="13" units-per-pixel="19.10925706787110" order="13"/>
      </TileSets>
    </TileMap>

And this is the incorrect output from gdal2Tiles:

<?xml version="1.0" encoding="utf-8"?>
    <TileMap version="1.0.0" tilemapservice="http://tms.osgeo.org/1.0.0">
      <Title>mar_apr_CLIP1.tif</Title>
      <Abstract></Abstract>
      <SRS>EPSG:900913</SRS>
      <BoundingBox minx="-25.32504747468283" miny="1.94797423573108" maxx="-21.33272919903126" maxy="5.10698976386579"/>
      <Origin x="-25.32504747468283" y="1.94797423573108"/>
      <TileFormat width="256" height="256" mime-type="image/png" extension="png"/>
      <TileSets profile="mercator">
        <TileSet href="6" units-per-pixel="2445.98490468750010" order="6"/>
        <TileSet href="7" units-per-pixel="1222.99245234375010" order="7"/>
        <TileSet href="8" units-per-pixel="611.49622617187504" order="8"/>
        <TileSet href="9" units-per-pixel="305.74811308593752" order="9"/>
        <TileSet href="10" units-per-pixel="152.87405654296876" order="10"/>
        <TileSet href="11" units-per-pixel="76.43702827148438" order="11"/>
        <TileSet href="12" units-per-pixel="38.21851413574219" order="12"/>
        <TileSet href="13" units-per-pixel="19.10925706787110" order="13"/>
      </TileSets>
    </TileMap>

Does MapTiler perform any other operations besides running gdal2Tiles?

1

There are two different ways that Tiles can be addressed, the TMS standard specifies that tile coordinates start at the bottom left, but in practice most software is using a coordinate system with the Y axis reversed from TMS: it starts at the top left instead of the bottom right. I don't know that there is really an official name for this scheme, some people refer to it as google XYZ.

gdal2tiles uses the traditional TMS scheme, and this is not likely to change, where MapTiler is using the google scheme.

There are a couple options:
- Modify gdal2tiles to change the output file names.
- Do some bulk file renaming after tiling.
- you could probably get whatever is consuming the images to read the files as is. Most software can read either addressing scheme.

  • I am not sure if you answer the question. Both outputs are TMS documents as in standard wiki.osgeo.org/wiki/Tile_Map_Service_Specification and thus the XYZ order must be the same. However, documents have different bounding boxes and origins which is the real problem. – user30184 Jul 23 '14 at 18:54
0

In your examples you are tiling two different files. In the first xml it is "mar_apr.tif" and in the second "mar_apr_CLIP1.tif". Maybe this is the reason for the difference in the output - because your input files differs in fact as well?

The old MapTiler made only color palette expansion and similar small modifications which should not affect the location and bounds of the output compared to the GDAL2Tiles (I am the author of both these software tools in fact).

This is not a difference in TMS / XYZ tile addressing (@Jesse) otherwise described at: http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/

The new version of MapTiler (http://www.maptiler.com) can render XYZ / OGC WMTS (default now) as well as the older TMS (checkbox in the Advanced options). It comes also with a command-line support in the higher versions - for complete automation and merging of multiple files for fast and direct rendering of a seamless layer for whole countries.

  • Thanks for your answer @Pert! They are actually the same file, I just renamed it before processing it. The difference I see seems to be only in the boundingbox, and in fact it is rendered in a different place on the system. – Egar Jul 24 '14 at 16:06
  • What does gdalinfo show for extents of your images? – user30184 Jul 24 '14 at 17:34
  • The corner coordinates? Upper Left ( 216847.500,-2431597.500) Lower Left ( 216847.500,-2915722.500) Upper Right ( 568507.500,-2431597.500) Lower Right ( 568507.500,-2915722.500) Center ( 392677.500,-2673660.000) – Egar Jul 24 '14 at 18:23
  • With your values the EPSG:4326 bounding box (axis order lon-lat) computed with gdaltransform is as follows: C:\data>gdaltransform -s_srs epsg:3857 -t_srs epsg:4326 216847.500 -2915722.500 1.94797423573108 -25.3250474746828 0 568507.500 -2431597.500 5.10698976386579 -21.3327291990313 0 – user30184 Jul 24 '14 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.