#27972: BaseSpatialField.geodetic should return SpatialReference.geographic
------------------------------------------------+------------------------
Reporter: Sergey Fedoseev | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: GIS | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
At this moment `BaseSpatialField.geodetic` checks if the unit name
associated with the field is in the list of `geodetic_units = ('decimal
degree', 'degree')`, but it could simply return
SpatialReference.geographic because units are geodetic iif SRS is
geographic.
The current implementation of `BaseSpatialField.geodetic` gives incorrect
result for some SRSes:
{{{
In [1]: from django.db import connection
In [2]: from django.contrib.gis.db.models.fields import BaseSpatialField
In [5]: BaseSpatialField(srid=4901).geodetic(connection)
Out[5]: False
In [10]: from django.contrib.gis.gdal import SpatialReference
In [11]: print(SpatialReference(4901))
GEOGCS["ATF (Paris)",
DATUM["Ancienne_Triangulation_Francaise_Paris",
SPHEROID["Plessis 1817",6376523,308.64,
AUTHORITY["EPSG","7027"]],
AUTHORITY["EPSG","6901"]],
PRIMEM["Paris RGS",2.337208333333333,
AUTHORITY["EPSG","8914"]],
UNIT["grad",0.01570796326794897,
AUTHORITY["EPSG","9105"]],
AUTHORITY["EPSG","4901"]]
In [12]: SpatialReference(4901).geographic
Out[12]: True
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27972>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.ea78448f263cc716e369ec950e1ed22a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.