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'

asked Jun 10, 2016 at 20:00

1 Answer 1

3

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

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.