[Django] #32368: Wrong srid when creating SpatialReference with proj4

5 views
Skip to first unread message

Django

unread,
Jan 19, 2021, 11:13:19 AM1/19/21
to django-...@googlegroups.com
#32368: Wrong srid when creating SpatialReference with proj4
-----------------------------------------+---------------------------------
Reporter: Eran Keydar | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.1
Severity: Normal | Keywords: GDAL GEO-DJANGO
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+---------------------------------
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]

}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32368>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 19, 2021, 11:13:54 AM1/19/21
to django-...@googlegroups.com
#32368: Wrong srid when creating SpatialReference with proj4
---------------------------------+--------------------------------------

Reporter: Eran Keydar | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.1
Severity: Normal | Resolution:

Keywords: GDAL GEO-DJANGO | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Description changed by Eran Keydar:

Old 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]
>
> }}}

New 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

os: ubuntu 20.04

{{{
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]

}}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32368#comment:1>

Django

unread,
Jan 19, 2021, 11:51:18 AM1/19/21
to django-...@googlegroups.com
#32368: Wrong srid when creating SpatialReference with proj4
---------------------------------+--------------------------------------

Reporter: Eran Keydar | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.1
Severity: Normal | Resolution:

Keywords: GDAL GEO-DJANGO | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Description changed by Eran Keydar:

Old 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

> os: ubuntu 20.04


>
> {{{
> 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]
>
> }}}

New description:

I create SpatialReference with proj4 string, I expect srid numbers which
are not clear (compared to ubuntu 18.04)

django 3.1.5
python 3.8.5
gdal version: 3.0.4

os: ubuntu 20.04

{{{
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 (on 1804 I get 4269)

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 (on 1804 I get None)

sr = SpatialReference('+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ')

print(sr.srid) # get 6326 (on 1804 I get 4326)

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

}}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32368#comment:2>

Django

unread,
Jan 19, 2021, 2:00:46 PM1/19/21
to django-...@googlegroups.com
#32368: Wrong srid when creating SpatialReference with proj4
---------------------------------+--------------------------------------

Reporter: Eran Keydar | Owner: nobody
Type: Uncategorized | Status: closed
Component: GIS | Version: 3.1
Severity: Normal | Resolution: duplicate

Keywords: GDAL GEO-DJANGO | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => duplicate
* component: Uncategorized => GIS


Comment:

Duplicate of #31753.

--
Ticket URL: <https://code.djangoproject.com/ticket/32368#comment:3>

Reply all
Reply to author
Forward
0 new messages