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 , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Note:
See TracTickets
for help on using tickets.
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 raisin error would be 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.