public class JTSUtilities extends Object
Modifier and Type | Method and Description |
---|---|
static Geometry |
convertToCollection(Geometry geom,
ShapeType type) |
static Class |
findBestGeometryClass(ShapeType type) |
static ShapeType |
findBestGeometryType(Geometry geom)
Determine the best ShapeType for a given Geometry.
|
static ShapeType |
getShapeType(Class featureClass)
Determine the default ShapeType for a featureClass.
|
static ShapeType |
getShapeType(GeometryDescriptor gd)
Determine the default ShapeType using the descriptor and eventually the geometry to guess the
coordinate dimensions if not reported in the descriptor hints
|
static ShapeType |
getShapeType(Geometry geom,
int shapeFileDimentions)
Determine the best ShapeType for a geometry with the given dimension.
|
static int |
guessCoorinateDims(Coordinate[] cs)
Returns:
2 for 2d (default) 4 for 3d - one of the oordinates has a non-NaN z value (3 is for x,y,m but thats not supported yet) |
static MultiPolygon |
makeGoodShapeMultiPolygon(MultiPolygon mp)
Like makeGoodShapePolygon, but applied towards a multi polygon.
|
static Polygon |
makeGoodShapePolygon(Polygon p)
Create a nice Polygon from the given Polygon.
|
static LinearRing |
reverseRing(LinearRing lr)
Does what it says, reverses the order of the Coordinates in the ring.
|
static double[] |
zMinMax(Coordinate[] cs)
Deprecated.
use zMinMax(CoordinateSequence)
|
static void |
zMinMax(CoordinateSequence cs,
double[] target)
Determine the min and max "z" values in an array of Coordinates.
|
public static final double[] zMinMax(Coordinate[] cs)
cs
- The array to search.public static final void zMinMax(CoordinateSequence cs, double[] target)
cs
- The array to search.target
- array with at least two elements where to hold the min and max zvalues.
target[0] will be filled with the minimum zvalue, target[1] with the maximum. The array
current values, if not NaN, will be taken into acount in the computation.public static final ShapeType findBestGeometryType(Geometry geom)
geom
- The Geometry to analyze.public static final LinearRing reverseRing(LinearRing lr)
This is different then lr.reverses() in that a copy is produced using a new coordinate sequence.
lr
- The ring to reverse.public static final Polygon makeGoodShapePolygon(Polygon p)
p
- The Polygon to make "nice".public static final MultiPolygon makeGoodShapeMultiPolygon(MultiPolygon mp)
mp
- The MultiPolygon to "niceify".public static final int guessCoorinateDims(Coordinate[] cs)
cs
- The array of Coordinates to search.public static Geometry convertToCollection(Geometry geom, ShapeType type)
public static final ShapeType getShapeType(Geometry geom, int shapeFileDimentions) throws ShapefileException
geom
- The Geometry to examine.shapeFileDimentions
- The dimension 2,3 or 4.ShapefileException
- If theres a problem, like a bogus Geometry.public static final ShapeType getShapeType(Class featureClass) throws ShapefileException
featureClass
- The Geometry to examine.ShapefileException
- If theres a problem, like a bogus feature class.public static final ShapeType getShapeType(GeometryDescriptor gd) throws ShapefileException
gd
- g
- ShapefileException
Copyright © 1996–2019 Geotools. All rights reserved.