Package org.locationtech.jts.noding
Class ScaledNoder
java.lang.Object
org.locationtech.jts.noding.ScaledNoder
- All Implemented Interfaces:
Noder
Wraps a
Noder
and transforms its input
into the integer domain.
This is intended for use with Snap-Rounding noders,
which typically are only intended to work in the integer domain.
Offsets can be provided to increase the number of digits of available precision.
Clients should be aware that rescaling can involve loss of precision, which can cause zero-length line segments to be created. These in turn can cause problems when used to build a planar graph. This situation should be checked for and collapsed segments removed if necessary.
- Version:
- 1.7
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScaledNoder
(Noder noder, double scaleFactor) ScaledNoder
(Noder noder, double scaleFactor, double offsetX, double offsetY) -
Method Summary
Modifier and TypeMethodDescriptionvoid
computeNodes
(Collection inputSegStrings) Computes the noding for a collection ofSegmentString
s.Returns aCollection
of fully nodedSegmentString
s.boolean
private void
rescale
(Collection segStrings) private void
rescale
(Coordinate[] pts) private Collection
scale
(Collection segStrings) private Coordinate[]
scale
(Coordinate[] pts)
-
Field Details
-
noder
-
scaleFactor
private double scaleFactor -
offsetX
private double offsetX -
offsetY
private double offsetY -
isScaled
private boolean isScaled
-
-
Constructor Details
-
ScaledNoder
-
ScaledNoder
-
-
Method Details
-
isIntegerPrecision
public boolean isIntegerPrecision() -
getNodedSubstrings
Description copied from interface:Noder
Returns aCollection
of fully nodedSegmentString
s. The SegmentStrings have the same context as their parent.- Specified by:
getNodedSubstrings
in interfaceNoder
- Returns:
- a Collection of SegmentStrings
-
computeNodes
Description copied from interface:Noder
Computes the noding for a collection ofSegmentString
s. Some Noders may add all these nodes to the input SegmentStrings; others may only add some or none at all.- Specified by:
computeNodes
in interfaceNoder
- Parameters:
inputSegStrings
- a collection ofSegmentString
s to node
-
scale
-
scale
-
rescale
-
rescale
-