Opened 9 years ago
Closed 9 years ago
#27972 closed Cleanup/optimization (fixed)
BaseSpatialField.geodetic should return SpatialReference.geographic
| Reported by: | Sergey Fedoseev | Owned by: | Sergey Fedoseev |
|---|---|---|---|
| Component: | GIS | Version: | 1.10 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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
Change History (4)
comment:1 by , 9 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 9 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 9 years ago
| Has patch: | set |
|---|
Note:
See TracTickets
for help on using tickets.
PR