|
JTS Topology Suite version 1.12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vividsolutions.jts.operation.overlay.snap.GeometrySnapper
public class GeometrySnapper
Snaps the vertices and segments of a Geometry
to another Geometry's vertices.
A snap distance tolerance is used to control where snapping is performed.
Snapping one geometry to another can improve
robustness for overlay operations by eliminating
nearly-coincident edges
(which cause problems during noding and intersection calculation).
Too much snapping can result in invalid topology
beging created, so the number and location of snapped vertices
is decided using heuristics to determine when it
is safe to snap.
This can result in some potential snaps being omitted, however.
Constructor Summary | |
---|---|
GeometrySnapper(Geometry srcGeom)
Creates a new snapper acting on the given geometry |
Method Summary | |
---|---|
static double |
computeOverlaySnapTolerance(Geometry g)
Estimates the snap tolerance for a Geometry, taking into account its precision model. |
static double |
computeOverlaySnapTolerance(Geometry g0,
Geometry g1)
|
static double |
computeSizeBasedSnapTolerance(Geometry g)
|
Coordinate[] |
extractTargetCoordinates(Geometry g)
|
static Geometry[] |
snap(Geometry g0,
Geometry g1,
double snapTolerance)
Snaps two geometries together with a given tolerance. |
Geometry |
snapTo(Geometry snapGeom,
double snapTolerance)
Snaps the vertices in the component LineString s
of the source geometry
to the vertices of the given snap geometry. |
Geometry |
snapToSelf(double snapTolerance,
boolean cleanResult)
Snaps the vertices in the component LineString s
of the source geometry
to the vertices of the given snap geometry. |
static Geometry |
snapToSelf(Geometry g0,
double snapTolerance,
boolean cleanResult)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GeometrySnapper(Geometry srcGeom)
srcGeom
- the geometry to snapMethod Detail |
---|
public static double computeOverlaySnapTolerance(Geometry g)
g
- a Geometry
public static double computeSizeBasedSnapTolerance(Geometry g)
public static double computeOverlaySnapTolerance(Geometry g0, Geometry g1)
public static Geometry[] snap(Geometry g0, Geometry g1, double snapTolerance)
g0
- a geometry to snapg1
- a geometry to snapsnapTolerance
- the tolerance to use
public static Geometry snapToSelf(Geometry g0, double snapTolerance, boolean cleanResult)
public Geometry snapTo(Geometry snapGeom, double snapTolerance)
LineString
s
of the source geometry
to the vertices of the given snap geometry.
snapGeom
- a geometry to snap the source to
public Geometry snapToSelf(double snapTolerance, boolean cleanResult)
LineString
s
of the source geometry
to the vertices of the given snap geometry.
snapGeom
- a geometry to snap the source to
public Coordinate[] extractTargetCoordinates(Geometry g)
|
JTS Topology Suite version 1.12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |