[postgis-devel] precision issue with several functions

Sandro Santilli strk at keybit.net
Thu Oct 10 02:21:13 PDT 2013


On Thu, Oct 10, 2013 at 11:11:01AM +0200, RĂ©mi Cura wrote:

> Snapping to grid is not a solution exactly for the same reason than
> snapping a point to a line doesn't work.
> Say the projected point is exactly on the grid, the extremities of the line
> are exactly on the grid, but the line does not go exactly trough this
> point.
> Snapping to grid won't change a anything, and I'll still have the same
> precision issue.

Of course you _also_ need to snap the line to the projected (and then
snapped to grid) point.

> Unfortunately I'm having this precision issue while using ST_Split, the
> exact issue being that splitting line by point doesn't split if point is
> not sufficiently on the line. Here ST_DWithin is of no help, but snapping
> line to point works.

Yep, that's what the topology code does, for example.

> For other intersection test I'll use ST_DWithin, or directly BBox test when
> possible (bbox are already less precise if I remember right)

bbox can be slightly larger so point-point box overlap is sometimes possible.

--strk;



More information about the postgis-devel mailing list