Opened 10 years ago

Closed 10 years ago

#23579 closed New feature (fixed)

Default Geometry representation from WKT to EWKT

Reported by: Claude Paroz Owned by: nobody
Component: GIS Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Claude Paroz)

Currently, the default __str__ representation of a GEOSGeometry object is its WKT representation (e.g. "POINT (1 2)").
I'd like to suggest moving to the EWKT representation which includes the SRID information (e.g. "SRID=4326;POINT (1 2)").
For me, coordinates without SRID is like an encoded string without knowing its encoding, or a datetime object without the timezone.

The change is trivial. There is a small backwards compatibility issue, essentially for people testing the output of str(geom), and it also means that the SRID will also appear in dumpdata output, which is welcome in my opinion.

Comments welcome.

Change History (4)

comment:2 by Claude Paroz, 10 years ago

Description: modified (diff)

comment:3 by Tim Graham, 10 years ago

Triage Stage: UnreviewedReady for checkin

comment:4 by Claude Paroz <claude@…>, 10 years ago

Resolution: fixed
Status: newclosed

In 2e5b2c612ec3b410d2a35133d073341e6958eeba:

Fixed #23579 -- Changed GEOSGeometry.str to include the SRID

Thanks Tim Graham for the review.

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