2

I am trying to create a spatial reference using ImportFromESPG and this is what is returned:

AttributeError: 'SpatialReference' object has not attribute 'ImportFromESPG'

Code and error are copied below. I copied this code exactly from the cookbook: https://pcjericks.github.io/py-gdalogr-cookbook/projection.html so it seems that something must be wrong with my installation?

Windows 10, Python 2.7.8 with IDLE. I get a very similar error when I use python in the command window where the canopy install of python is my default (python version 2.7.11).

Python 2.7.8 comes from the ArcGIS install (10.3.1 with 64bit geoprocessing update). I installed GDAL from the gisinternals website. Both versions of python on my system are MSC v.1500 64 bit. For Canopy, gdal is installed internally as a package.

Code and error:

from osgeo import osr
sr=osr.SpatialReference()
sr.ImportFromESPG(29613)

Traceback (most recent call last): File "", line 1, in sr.ImportFromESPG(29613) AttributeError: 'SpatialReference' object has no attribute 'ImportFromESPG'

2

sr.ImportFromEPSG()

You have the S and P transposed.

For the record, I don't see an entry for EPSG::29613 so that code may be invalid or deprecated.

http://epsg.io/?q=29613

  • 1
    I feel a little silly. And the 29613 is also transposed... it should be 26913 (UTM13N, nad83). Thank you! – geohyd Jun 10 '16 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.