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'
1 Answer 1
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.
-
1I feel a little silly. And the 29613 is also transposed... it should be 26913 (UTM13N, nad83). Thank you!geohyd– geohyd2016年06月10日 20:36:13 +00:00Commented Jun 10, 2016 at 20:36
Explore related questions
See similar questions with these tags.