Ticket #1292 (closed patch: fixed)
ST_SnapToGrid returns a value out of range
| Reported by: | realityexists | Owned by: | pramsey |
|---|---|---|---|
| Priority: | medium | Milestone: | PostGIS 2.1.0 |
| Component: | postgis | Version: | trunk |
| Keywords: | Cc: |
Description
PostGIS 2.0.0 as of 2011-11-08
I've found some odd behaviour in ST_SnapToGrid, which looks like a bug. When I run
SELECT ST_SnapToGrid(ST_Transform(ST_GeomFromText('POINT(180 50)', 4269), 4326), 0.00001)::geography
an error is returned:
ERROR: Coordinate values are out of range [-180 -90, 180 90] for GEOGRAPHY type
Calling ST_AsText() on the same geometry returns "POINT(180 50)", as expected. Interestingly, if I either decrease or even increase the precision the error does not occur. Eg. this works fine:
SELECT ST_SnapToGrid(ST_Transform(ST_GeomFromText('POINT(180 50)', 4269), 4326), 0.000001)::geography
It's only the value 0.0001 that seems to cause a problem.

