public class JTSUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Logger |
logger |
Constructor and Description |
---|
JTSUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
calculateQuadrantSegments(int joinStyle) |
static com.vividsolutions.jts.geom.Geometry |
convertTypes(com.vividsolutions.jts.geom.Geometry g,
int sourceType,
int destinationType)
This function is called when the we need force types, that is the
destination
type does not match with the input geometry type
|
static Geometry |
createGeometry(IProjection proj,
com.vividsolutions.jts.geom.Geometry jtsGeom) |
static Geometry |
createGeometry(IProjection proj,
com.vividsolutions.jts.geom.Geometry jtsGeom,
GeometryType typeWhenEmpty) |
static LinearRing |
createJTSLinearRing(IProjection proj,
Coordinate[] coordinates) |
static LinearRing |
createJTSLinearRing(IProjection proj,
CoordinateSequence coordinates) |
static LineString |
createJTSLineString(IProjection proj,
CoordinateSequence coordinates) |
static LineString |
createJTSLineStringFromArcPoints(IProjection proj,
Point centre,
double radius,
double startAngle,
double endAngle) |
static MultiLineString |
createJTSMultiLineString(IProjection proj,
LineString[] lineStrings) |
static MultiPoint |
createJTSMultiPoint(IProjection proj,
CoordinateSequence coordinates) |
static com.vividsolutions.jts.geom.MultiPolygon |
createJTSMultiPolygon(IProjection proj,
com.vividsolutions.jts.geom.Polygon[] polygons) |
static com.vividsolutions.jts.geom.Geometry |
createJTSPoint(IProjection proj,
Coordinate coordinate) |
static com.vividsolutions.jts.geom.Polygon |
createJTSPolygon(IProjection proj,
ArrayListCoordinateSequence coordinates) |
static com.vividsolutions.jts.geom.Polygon |
createJTSPolygon(IProjection proj,
ArrayListCoordinateSequence coordinates,
java.util.List<Ring> interiorRings) |
static com.vividsolutions.jts.geom.Geometry |
createJTSPolygon(IProjection proj,
Coordinate[] coordinates) |
static MCoordinate |
createMCoordinate(double x,
double y,
double m) |
static MCoordinate |
createMCoordinate(double x,
double y,
double z,
double m) |
static Point |
createPoint(GeometryType type,
IProjection proj,
Coordinate coordinate) |
static Point |
extractPointFromLine(GeometryJTS geom,
double len) |
static BufferParameters |
getBufferParameters() |
static BufferParameters |
getBufferParameters(int joinStyle,
int endCapStyle) |
static Coordinate |
getCircumcentre(Point init,
Point middle,
Point end) |
static com.vividsolutions.jts.geom.GeometryFactory |
getFactory(Coordinate coordinate) |
static com.vividsolutions.jts.geom.GeometryFactory |
getFactory(Coordinate[] coordinates) |
static com.vividsolutions.jts.geom.GeometryFactory |
getFactory(CoordinateSequence coordinates) |
static Coordinate |
getMidPoint(Point init,
Point end)
Returns the middle point between two points.
|
static double |
getPathLengthFromLine(GeometryJTS geom,
Point point) |
static Coordinate |
getPointAtYAxisInEllipse(Point init,
Point end,
java.lang.Double ydist)
Returns the intersection point between an ellipse and her minor axis.
|
protected static Geometry |
jtsPolygonToJtsMultiLineString(com.vividsolutions.jts.geom.Geometry geomJTS,
IProjection proj) |
static Geometry |
offsetClosedLine(IProjection proj,
ArrayListCoordinateSequence coordinates,
double distance)
Creates a offset from a closed line at a distance
|
static Geometry |
offsetClosedLine(IProjection proj,
ArrayListCoordinateSequence coordinates,
int joinStyle,
double distance)
Creates a offset from a closed line at a distance
|
static Geometry |
offsetRawOpenLine(IProjection proj,
ArrayListCoordinateSequence coordinates,
double distance)
Creates a raw offset of a open line at a distance.
|
static com.vividsolutions.jts.geom.Geometry |
setSRID(IProjection proj,
com.vividsolutions.jts.geom.Geometry g) |
static double |
straightLineThroughTwoPointsEquation(double x1,
double x2,
double y1,
double y2,
double x) |
public static Point createPoint(GeometryType type, IProjection proj, Coordinate coordinate) throws CreateGeometryException
CreateGeometryException
public static com.vividsolutions.jts.geom.GeometryFactory getFactory(CoordinateSequence coordinates)
public static com.vividsolutions.jts.geom.GeometryFactory getFactory(Coordinate coordinate)
public static com.vividsolutions.jts.geom.GeometryFactory getFactory(Coordinate[] coordinates)
public static LineString createJTSLineString(IProjection proj, CoordinateSequence coordinates)
public static LinearRing createJTSLinearRing(IProjection proj, CoordinateSequence coordinates)
public static LinearRing createJTSLinearRing(IProjection proj, Coordinate[] coordinates)
public static MultiPoint createJTSMultiPoint(IProjection proj, CoordinateSequence coordinates)
public static Geometry createGeometry(IProjection proj, com.vividsolutions.jts.geom.Geometry jtsGeom)
public static Geometry createGeometry(IProjection proj, com.vividsolutions.jts.geom.Geometry jtsGeom, GeometryType typeWhenEmpty)
public static com.vividsolutions.jts.geom.Geometry convertTypes(com.vividsolutions.jts.geom.Geometry g, int sourceType, int destinationType)
g
- sourceType
- destinationType
- public static MCoordinate createMCoordinate(double x, double y, double m)
public static MCoordinate createMCoordinate(double x, double y, double z, double m)
public static Coordinate getCircumcentre(Point init, Point middle, Point end)
init
- middle
- end
- public static LineString createJTSLineStringFromArcPoints(IProjection proj, Point centre, double radius, double startAngle, double endAngle)
public static MultiLineString createJTSMultiLineString(IProjection proj, LineString[] lineStrings)
public static com.vividsolutions.jts.geom.Polygon createJTSPolygon(IProjection proj, ArrayListCoordinateSequence coordinates, java.util.List<Ring> interiorRings)
coordinates
- interiorRings
- public static com.vividsolutions.jts.geom.Polygon createJTSPolygon(IProjection proj, ArrayListCoordinateSequence coordinates)
coordinates
- public static com.vividsolutions.jts.geom.MultiPolygon createJTSMultiPolygon(IProjection proj, com.vividsolutions.jts.geom.Polygon[] polygons)
public static com.vividsolutions.jts.geom.Geometry setSRID(IProjection proj, com.vividsolutions.jts.geom.Geometry g)
public static Coordinate getPointAtYAxisInEllipse(Point init, Point end, java.lang.Double ydist)
init
- end
- ydist
- public static Coordinate getMidPoint(Point init, Point end)
init
- end
- public static com.vividsolutions.jts.geom.Geometry createJTSPoint(IProjection proj, Coordinate coordinate)
coordinate
- public static com.vividsolutions.jts.geom.Geometry createJTSPolygon(IProjection proj, Coordinate[] coordinates)
coordinates
- public static BufferParameters getBufferParameters()
public static BufferParameters getBufferParameters(int joinStyle, int endCapStyle)
public static int calculateQuadrantSegments(int joinStyle) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static Geometry offsetClosedLine(IProjection proj, ArrayListCoordinateSequence coordinates, double distance)
proj
- coordinates
- distance
- public static Geometry offsetClosedLine(IProjection proj, ArrayListCoordinateSequence coordinates, int joinStyle, double distance)
proj
- coordinates
- joinStyle
- distance
- protected static Geometry jtsPolygonToJtsMultiLineString(com.vividsolutions.jts.geom.Geometry geomJTS, IProjection proj)
public static Geometry offsetRawOpenLine(IProjection proj, ArrayListCoordinateSequence coordinates, double distance)
coordinates
- distance
- public static double straightLineThroughTwoPointsEquation(double x1, double x2, double y1, double y2, double x)
public static Point extractPointFromLine(GeometryJTS geom, double len)
public static double getPathLengthFromLine(GeometryJTS geom, Point point)