Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16864 closed Bug (fixed)

django.contrib.gis.geos.GEOSGeometry doesn't accept -1 as SRID value (or any negative number) in WKT format

Reported by: marcel.dancak@… Owned by: nobody
Component: GIS Version: dev
Severity: Normal Keywords:
Cc: ivan.mincik@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It's not possible to create geometry object from WKT string with negative SRID, for example GEOSGeometry("SRID=-1;POINT(2639.2 -1076.5)"), because django.contrib.gis.geometry.regex.wkt_regex accepts only positive numbers. On the other side, creating point directly as django.contrib.gis.geos.Point(2639.2, -1076.5, srid=-1) is valid, and it's not so unusual to use -1.

If you consider this as a bug, solution is very trivial, but I have included patch as well. Tkanks.

Attachments (1)

patch (704 bytes ) - added by marcel.dancak@… 13 years ago.
patch

Download all attachments as: .zip

Change History (2)

by marcel.dancak@…, 13 years ago

Attachment: patch added

patch

comment:1 by jbronn, 13 years ago

Resolution: fixed
Status: newclosed

In [16843]:

Fixed #16864 -- WKT regex now allows negative SRIDs. Thanks, Marcel Dancak for bug report and initial patch.

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