#26509 closed Cleanup/optimization (fixed)
Deprecate the precision_wkt() contrib.gis function
Reported by: | Tim Graham | Owned by: | nobody |
---|---|---|---|
Component: | GIS | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The precision_wkt()
function in django/contrib/gis/utils/wkt.py
is untested, unused, undocumented and came in with the original GIS branch in 2008 and has been untouched since. Claude says it's worth testing and documenting.
Change History (8)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Oh yes, we added trim
and precision
capabilities to WKTWriter in [c984e2bc15aa41de]. This mostly obsoletes the precision_wkt
utility. I don't think that the precision string capability is so much useful. I'd vote now to drop precision_wkt
.
While re-reading the code, I think it would be nice to allow dimension, trimming and precision parameters to be provided to the WKTWriter constructor: #26510.
comment:3 by , 9 years ago
@claudep, Great. Thanks for confirming. Shall I create another ticket to mark precision_wkt
for deprecation or will this ticket suffice to take the discussion forward?
comment:4 by , 9 years ago
Summary: | Test and document the precision_wkt() contrib.gis function → Deprecate the precision_wkt() contrib.gis function |
---|
comment:6 by , 9 years ago
Has patch: | set |
---|
I see that there is a
WKTWriter
indjango.contrib.gis.geos
which has pretty much the same functionality as that ofprecision_wkt()
(strings are not accepted for precision in WKTWriter). I noticed this after I wrote some tests and I started looking for an appropriate page to include documentation. If this is indeed needed, I will go ahead and send a pull request with documentation shortly. Also, we can consider enhancing theWKTWriter
to accept string precision.