Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#14060 closed (fixed)

PostGISAdapter needs to properly cast input for comparisons on geography columns.

Reported by: jbronn Owned by: jbronn
Component: GIS Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When performing exact queries on geography columns, the input is not casted to the geography type, leading to an error:

DatabaseError: operator does not exist: geography ~= geometry
LINE 1: ... FROM "geogapp_city" WHERE "geogapp_city"."point" ~= ST_Geom...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

Attached is an initial patch for a test case demonstrating the problem.

Attachments (2)

geography_exact_fail.diff (573 bytes ) - added by jbronn 14 years ago.
14060.1.diff (3.3 KB ) - added by jbronn 14 years ago.

Download all attachments as: .zip

Change History (8)

by jbronn, 14 years ago

Attachment: geography_exact_fail.diff added

comment:1 by jbronn, 14 years ago

Component: UncategorizedGIS
Owner: changed from nobody to jbronn
Status: newassigned

comment:2 by jbronn, 14 years ago

Summary: `PostGISAdapter` needs to properly cast input for comparisons on geography columns.PostGISAdapter needs to properly cast input for comparisons on geography columns.

by jbronn, 14 years ago

Attachment: 14060.1.diff added

comment:3 by jbronn, 14 years ago

Resolution: fixed
Status: assignedclosed

(In [13757]) Fixed #14060 -- PostGIS never implemented the ~= operator for geography types, so removed support for it.

comment:4 by jbronn, 14 years ago

(In [13758]) [1.2.X] Fixed #14060 -- PostGIS never implemented the ~= operator for geography types, so removed support for it.

Backport of r13757 from trunk.

comment:5 by jbronn, 14 years ago

PostGIS will properly cast internally geography types (hence why && operator works). The root cause of the issue is that despite the documentation, the ~= operator was never implemented for geography types. I had a discussion with Paul Ramsey in #postgis about this issue, and he confirmed it was a "doc mistake" and "only && was implemented for geography."

comment:6 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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