Re: [Jts-topo-suite-user] Snapping path endpoints to another geometry
Brought to you by:
dr_jts
From: Jan T. <j.t...@em...> - 2015-03-04 22:40:01
|
On 2015-03-04 Martin Davis wrote: > > On 2015-02-24 Jan Tosovsky wrote: > > > > 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'm not really clear on what you're looking for, but it > sounds like you may have to build it yourself out of primitive > operations. > I've tried to avoid reinventing the wheel, but it wasn't as hard to implement it by myself as I expected: http://drifted.in/other/jts/java/ My normalizer takes the reference geometry and tries to snap another geometry to it by its endpoints if they are in the specified tolerance. Affected coords are updated directly in the geometry. The list of of them is provided as a collection. Both geometries are line segments, the reference one is closed. I haven't tested it on larger datasets though. Jan |