[FWTools] Projections OGR OSR .prj files in Python

David Fawcett david.fawcett at gmail.com
Tue Oct 24 17:03:53 EDT 2006


I am attempting to set input and output SRSs and transform the data when
necessary.  I am stuck on a small part of it.

I am trying to set the input SRS and then convert it to WKT so I can create
a .prj file.  I am getting an error on the ExportToWkt method.

Here is a small script that I whipped up to demonstrate it:

import ogr, osr, sys, os

srs_in = osr.SpatialReference()

proj_in = srs_in.ImportFromEPSG(4326)

wkt_proj = proj_in.ExportToWkt()

print wkt_proj

The error is:

d:\datascripts>python test_srs.py
Traceback (most recent call last):
  File "test_srs.py", line 7, in ?
    wkt_proj = proj_in.ExportToWkt()
AttributeError: 'int' object has no attribute'ExportToWkt'

Any help would be appreciated!

David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20061024/4e73fdeb/attachment.html


More information about the FWTools mailing list