Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#5617 closed defect (invalid)

ImportFromEPSG(900913) fails in gdal 1.10

Reported by: hamish Owned by: hobu
Priority: normal Milestone: 1.11.1
Component: PythonBindings Version: 1.10.1
Severity: normal Keywords: python-gdal, gdal2tiles, ImportFromEPSG, 900913, spherical merc
Cc: marcelacampo@…

Description

Hi,

two part bug.

gdal2tiles.py has some code a bit like this:

from osgeo import osr
out_srs = osr.SpatialReference()
out_srs.ImportFromEPSG(900913)

which works on gdal 1.9 but not 1.10 (ubuntugis PPA package).

The error is that it doesn't know that epsg code.

there was an unresolved mailing list thread about it here:

http://lists.osgeo.org/pipermail/gdal-dev/2014-May/039209.html

We can and should patch swig/.../gdal2tiles.py to use epsg code 3857 instead, but even still, the 900913 code is super-widespread and will be around for years to come, and the /usr/share/proj/other.extra epsg file still supports it, so it would be nice to users if it still worked from ImportFromEPSG().

moreover, it would be nice if all of the contents of /usr/share/proj/other.extra made it into the GDAL_DATA .csv files. (I'm not sure of the order/toolchain of generation for those though)

thanks, Hamish

Change History (3)

comment:1 by Even Rouault, 10 years ago

Apparently the data/cubewerx_extra.wkt where 900913 definition is has been removed from Debian because of the unclear copyright : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=721343

comment:2 by hamish, 10 years ago

Resolution: invalid
Status: newclosed

Hi,

I've just tested with the gdal 1.11 package from ubuntugis, and there it recognises 900913 since cubewerx_extra.wkt still exists. For PROJ.4 the definition is now in "other.extra" not "esri.extra" (it's not clear to me, but I'm recklessly guessing someone just appended it to the end of a nearby file and this def'n didn't actually come from ESRI?)

I think there is also a strong case to be made that there isn't much copyrightable content in "mercator on a sphere using the major axis of the WGS84 ellipsoid as used by others", since there is no opportunity for original expression, but that's besides the point. :) Probably the best is to go the xtide route and make an -extra package available from the non-free/"restricted extras" package repositories on Debian/Ubuntu. At least in a large number of countries that sort of thing is not copyrightable, which is what those restricted/contrib repos exist for.

It's also not clear to me where cubewerx got theirs from, I would also recklessly guess that 900913 was not their invention or doing, and there also someone just appended the def'n to a nearby file. (all other codes there have #comments, 900913 is just tacked on the end)

Anyway & regardless, packaging issue not a gdal code one, so closing the ticket, to be pursued elsewhere. I'll open another ticket with a patch updating gdal2tiles to the modern epsg code.

regards, Hamish

comment:3 by hamish, 10 years ago

(cubewerx's version of spherical merc is epsg:41001)

Note: See TracTickets for help on using tickets.