[Gdal-dev] PROJ.4 EPSG:28992
TomvanTilburg
tom.van.tilburg at gmail.com
Thu Dec 3 04:20:35 EST 2009
Even Rouault wrote:
>
> TomvanTilburg a écrit :
>
> hum, looks a bit like a (mysterious) PROJ.4 issue. The "unknown
> projection id" probably referes to the 'sterea' method.
>
> I've found a ticket in the PROJ trac database that seems to be very
> similar to your issue : http://trac.osgeo.org/proj/ticket/43
>
'sterea' should be okay I think, it stands for OBLIQUE_STEREOGRAPHIC as far
as I know.
What surprises me is that my transform is running ok under linux but fails
under win.
It seems that somewhere a lookup for this projection is missing.
If someone can tell me the easiest way to produce some version numbers that
might help.
Below I'll put my code that produces the error (at the point where
'point.Transform(coordTrans)' should happen from epsg=28992 to epsg=4326)
from osgeo import ogr, osr
def transf(sample,epsgIn,epsgOut):
# CREATE PROJECTION OBJECTS
srIn = osr.SpatialReference ()
srIn.ImportFromEPSG(epsgIn)
srOut = osr.SpatialReference()
srOut.ImportFromEPSG(epsgOut)
coordTrans = osr.CoordinateTransformation(srIn, srOut)
# CREATE OGR POINT OBJECT, ASSIGN PROJECTION, REPROJECT
x = sample[0]
y = sample[1]
wkt = 'POINT(%s %s)' % (x, y)
point = ogr.CreateGeometryFromWkt(wkt)
point.AssignSpatialReference(srIn)
#point.TransformTo(srOut)
point.Transform(coordTrans)
print '======================='
print 'Input: ',wkt
print srIn.ExportToProj4()
print 'Output1: ',point
# CREATE WKT STRING OF POINT COORDS
sample = (' 776041.000', ' 3386618.000')
transf(sample,26916,4326)
sample = (' 143423.00', ' 473057.00')
transf(sample,28992,4326)
Output:
=======================
Input: POINT( 776041.000 3386618.000)
+proj=utm +zone=16 +ellps=GRS80 +datum=NAD83 +units=m +no_defs
Output1: POINT (-84.121611219545073 30.5802861582041)
ERROR 6: Failed to initialize PROJ.4 with `+proj=sterea
+lat_0=52.15616055555555
+lon_0=5.387638888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel
+un
its=m +no_defs '.
unknown projection id
Traceback (most recent call last):
File "projtest.py", line 32, in <module>
transf(sample,28992,4326)
File "projtest.py", line 20, in transf
point.Transform(coordTrans)
File
"C:\Python26\lib\site-packages\gdal-1.6.1-py2.6-win32.egg\osgeo\ogr.py",
line 3173, in Transform
return _ogr.Geometry_Transform(*args)
TypeError: in method 'Geometry_Transform', argument 2 of type
'OSRCoordinateTran
sformationShadow *'
--
View this message in context: http://n2.nabble.com/PROJ-4-EPSG-28992-tp2033665p4104971.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
More information about the gdal-dev
mailing list