Created
September 8, 2010 18:24
-
-
Save dracos/570562 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have an issue with co-ordinate transform from within Django, to do with SRID 29902 (Irish National Grid). | |
/usr/share/proj/epsg contains the following line: | |
<29902> +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +a=6377340.189 +b=6356034.447938534 +units=m +no_defs +datum=ire65 <> | |
And this works from the command line: | |
$ cs2cs -f "%.15f" +init=epsg:29902 +to +init=epsg:4326 | |
326905 369342 | |
-6.039196526852078 54.556479046321378 53.590400303713977 | |
In my PostGIS database I have the following: | |
=> select srid,proj4text from spatial_ref_sys where srid=29902; | |
29902 | +proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +a=6377340.189 +b=6356034.447938534 +units=m +no_defs +datum=ire65 | |
And this too works fine: | |
=> select st_astext(st_transform(st_geomfromtext('POINT(326905 369342)', 29902), 4326)); | |
POINT(-6.03919652685208 54.5564790463214) | |
However ,if I try the following from python manage.py shell this is what I get: | |
>>> from django.contrib.gis.gdal import OGRGeometry | |
>>> print OGRGeometry('POINT(326905 369342)', 29902).transform(4326, True) | |
POINT (-6.038191373300764 54.556391716974865) | |
Which is what the other two options give if I remove the needed "+datum=ire65" bit. | |
So what is GDAL calling to do the transformation, and what do I change to make it | |
work as proj/PostGIS? I'm running proj 4.6.0 (with edited epsg file to match 4.7), | |
GDAL 1.5.2, Django 1.1.1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment