[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] How to get an interpolated point on a linestring and make sure ST_Intersects ret
From:       Sandro Santilli <strk () keybit ! net>
Date:       2015-10-07 8:20:46
Message-ID: 20151007082046.GE5554 () localhost
[Download RAW message or body]

On Wed, Oct 07, 2015 at 09:18:21AM +0200, Alessandro Pasotti wrote:

> I'm trying to get a point on a linestring such as ST_Intersects with
> the original linestring will return True but it is failing in some
> real life situations (postgres 9.3, postgis version: 2.1 USE_GEOS=1
> USE_PROJ=1 USE_STATS=1)
> 
> Is this due to rounding errors?

It's due to the constrained nature of floating point numbers.
There's an infinite set of points laying in a line, but just a finite
set of them are representable.

The only way to be guaranteed a point is on a line is to pick a vertex
of that line. Snapping the input line to the closest point is what PostGIS
topology does, for example.

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic