Opened 4 years ago

Last modified 4 years ago

#32368 closed Uncategorized

Wrong srid when creating SpatialReference with proj4 — at Initial Version

Reported by: Eran Keydar Owned by: nobody
Component: GIS Version: 3.1
Severity: Normal Keywords: GDAL GEO-DJANGO
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I create SpatialReference with proj4 string, I expect the srid to be None but I get a number.

django 3.1.5
python 3.8.5
gdal version: 3.0.4

from django.contrib.gis.gdal import SpatialReference
sr = SpatialReference('''+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs ''')
print(sr.srid) # get 6269

sr = SpatialReference('+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ')
print(sr.srid) # get 7019

sr = SpatialReference('+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ')
print(sr.srid) # get 6326

print(sys.version)
3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0]

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top