Have you looked at: DistanceOp.nearestPoints ?

http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/operation/distance/DistanceOp.html#nearestPoints(com.vividsolutions.jts.geom.Geometry,
com.vividsolutions.jts.geom.Geometry)

Or if you are working only with lines, look at LengthIndexedLine project()
and extractPoint()

http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/linearref/LengthIndexedLine.html#project(com.vividsolutions.jts.geom.Coordinate)
http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/linearref/LengthIndexedLine.html#extractPoint(double)

On Tue, Feb 24, 2015 at 1:25 PM, Jan Tosovsky <[email protected]> wrote:

> Dear All,
>
> I am processing line fragments with reduced precission of coords taken from
> a specific application. While some fragments should touch another
> geometries, they are not considered as intersecting thanks to rounding (and
> hence the gaps).
>
> http://drifted.in/other/jts/snapping.png (exaggerated)
>
> Can I somehow snap line fragment endpoints (blue) to the specific path
> (red)
> if the distance is in a specified tolerance?
>
> I can imagine to compute distance of point to the geometry and if it is in
> the range, change the endpoint to the projected one on the geometry
> (perpendicularly).
>
> So far I've found:
> DistanceToPoint.computeDistance(Geometry geom, Coordinate pt,
> PointPairDistance ptDist)
>
> But I cannot locate method for retrieving the projected point even though
> it
> is most likely determined when computing that distance.
>
> Is there something like this in JTS?
>
> Thanks, Jan
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Jts-topo-suite-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user

Reply via email to