Opened 9 years ago

Closed 8 years ago

#25873 closed Bug (fixed)

GEOSGEometry handles srid parameter differently for EWKB and EWKT input

Reported by: Sergey Fedoseev Owned by: Sergey Fedoseev
Component: GIS Version: 1.9
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

In [14]: pnt = Point(1, 1, srid=4326)

In [15]: print GEOSGeometry(pnt.ewkt, srid=1)
SRID=4326;POINT (1.0000000000000000 1.0000000000000000)

In [16]: print GEOSGeometry(pnt.ewkb, srid=1)
SRID=1;POINT (1.0000000000000000 1.0000000000000000)

It's not clear from documentation what is the correct behavior, in my opinion srid parameter should be used as default SRID i.e. only if input geometry input does not include SRID.

Change History (5)

comment:1 by Sergey Fedoseev, 9 years ago

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:2 by Jani Tiainen, 9 years ago

I think it's really ambiguous to let same thing to be defined in two places, specially when explicit SRID is given. If that value would be implicit then using as a default would be fine.

One may think that resulting geometry does have SRID set to srid parameter (and possibly transformation has taken place).

I think raising an error would be the proper action here if SRIDs don't match since programmer must know at this point that geometry is in some specific format. It would give at least surprise to everybody.

Last edited 9 years ago by Tim Graham (previous) (diff)

comment:3 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Sergey Fedoseev, 8 years ago

Has patch: set

comment:5 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 6ecccad:

Fixed #25873 -- Made GEOSGeometry handle the srid parameter more predictably.

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