public final class CompactLineString extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected static int[] |
STRAIGHT_LINE
Singleton representation of a straight-line (where nothing has to be stored), to be re-used.
|
protected static byte[] |
STRAIGHT_LINE_PACKED |
Constructor and Description |
---|
CompactLineString() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
compackLineString(double x0,
double y0,
double x1,
double y1,
org.locationtech.jts.geom.LineString lineString,
boolean reverse)
Same as the other version, but in a var-len int packed form (Dlugosz coding).
|
static int[] |
compactLineString(double xa,
double ya,
double xb,
double yb,
org.locationtech.jts.geom.LineString lineString,
boolean reverse)
Public factory to create a compact line string.
|
static org.locationtech.jts.geom.LineString |
uncompackLineString(double x0,
double y0,
double x1,
double y1,
byte[] packedCoords,
boolean reverse)
Same as the other version, but in a var-len int packed form (Dlugosz coding).
|
static org.locationtech.jts.geom.LineString |
uncompactLineString(double xa,
double ya,
double xb,
double yb,
int[] coords,
boolean reverse)
Construct a LineString based on external end-points and compacted int version.
|
protected static final int[] STRAIGHT_LINE
protected static final byte[] STRAIGHT_LINE_PACKED
public static int[] compactLineString(double xa, double ya, double xb, double yb, org.locationtech.jts.geom.LineString lineString, boolean reverse)
xa
- X coordinate of end point Aya
- Y coordinate of end point Axb
- X coordinate of end point Byb
- Y coordinate of end point BlineString
- The geometry to compact. Please be aware that we ignore first and last
coordinate in the line string, they need to be exactly the same as A and B.reverse
- True if A and B are inverted (B is start, A is end).public static byte[] compackLineString(double x0, double y0, double x1, double y1, org.locationtech.jts.geom.LineString lineString, boolean reverse)
x0
- y0
- x1
- y1
- lineString
- public static org.locationtech.jts.geom.LineString uncompactLineString(double xa, double ya, double xb, double yb, int[] coords, boolean reverse)
xa
- ya
- xb
- yb
- coords
- Compact version of coordinatesreverse
- True if A and B and the compacted geometry is reversed.public static org.locationtech.jts.geom.LineString uncompackLineString(double x0, double y0, double x1, double y1, byte[] packedCoords, boolean reverse)
x0
- y0
- x1
- y1
- coords
- Copyright © 2019. All rights reserved.