Ticket #2737 (new defect)

Opened 3 years ago

Last modified 7 weeks ago

BoundingBox and Origin elements of TMS output in GDAL2Tiles always in Lat/Lon even when map is in Mercator

Reported by: jbeverage Owned by: klokan
Priority: normal Milestone:
Component: Utilities Version: unspecified
Severity: normal Keywords: gdal2tiles
Cc:

Description

The Origin and BoundingBox? elements of the tilemapresource.xml file generated by gdal2tiles are always in lat/lon even when the output map is Mercator.

Also, the X and Y coordinates are switched in both these tags. Currently, X=Latitude and Y=Longitude. The correct output should be X=Longitude and Y=Latitude.

Change History

  Changed 3 years ago by klokan

  • keywords gdal2tiles added
  • owner changed from warmerdam to klokan
  • milestone set to 1.6.1

in reply to: ↑ description   Changed 21 months ago by hamish

Replying to jbeverage:

Also, the X and Y coordinates are switched in both these tags. Currently, X=Latitude and Y=Longitude. The correct output should be X=Longitude and Y=Latitude.

I'm not sure if it's the same place you are talking about, but this patch fixes it for tilemapresource.xml:

Index: trunk/swig/python/scripts/gdal2tiles.py
===================================================================
--- trunk/swig/python/scripts/gdal2tiles.py     (revision 19763)
+++ trunk/swig/python/scripts/gdal2tiles.py     (working copy)
@@ -1511,7 +1511,7 @@
          <Title>%(title)s</Title>
          <Abstract></Abstract>
          <SRS>%(srs)s</SRS>
-         <BoundingBox minx="%(south).14f" miny="%(west).14f" maxx="%(north).14f" maxy="%(east).14f"/>
+         <BoundingBox miny="%(south).14f" minx="%(west).14f" maxy="%(north).14f" maxx="%(east).14f"/>
          <Origin x="%(south).14f" y="%(west).14f"/>
          <TileFormat width="%(tilesize)d" height="%(tilesize)d" mime-type="image/%(tileformat)s" extension="%(tileformat)s"/>
          <TileSets profile="%(profile)s">

Hamish

  Changed 7 weeks ago by warmerdam

  • component changed from default to Utilities
  • milestone 1.6.4 deleted

Removing milestone.

Hamish's patch seems reasonable but I'm not familiar enough with TMS to know if there is a reason this would be a bad idea.

Note: See TracTickets for help on using tickets.