Class JTSGeomUtil
- java.lang.Object
-
- eu.europa.ec.eurostat.jgiscotools.feature.JTSGeomUtil
-
public class JTSGeomUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.logging.log4j.Logger
LOGGER
-
Constructor Summary
Constructors Constructor Description JTSGeomUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends org.locationtech.jts.geom.Geometry>
booleancheckGeometry(Collection<Feature> fs, boolean checkValidity, Class<T> cl)
Check some features have a geometry (non null and non empty).static org.locationtech.jts.geom.Geometry
clean(org.locationtech.jts.geom.Geometry geom)
static boolean
containsSFS(org.locationtech.jts.geom.Envelope env, org.locationtech.jts.geom.Envelope env2)
static org.locationtech.jts.geom.Coordinate[]
createCoordinates(double... cs)
static org.locationtech.jts.geom.LineString
createLineString(double... cs)
static org.locationtech.jts.geom.Polygon
createPolygon(double... cs)
static org.locationtech.jts.geom.GeometryCollection
extract(org.locationtech.jts.geom.Geometry g, int geomBigType)
static org.locationtech.jts.geom.LineString
getBoundary(org.locationtech.jts.geom.Envelope env)
static org.locationtech.jts.geom.LineString
getBoundary(org.locationtech.jts.geom.Envelope env, org.locationtech.jts.geom.GeometryFactory gf)
static org.locationtech.jts.geom.Envelope
getEnvelopeInternal(Collection<org.locationtech.jts.geom.Geometry> gs)
static int
getGeomBigType(org.locationtech.jts.geom.Geometry g)
static <T extends org.locationtech.jts.geom.Geometry>
Collection<org.locationtech.jts.geom.Geometry>getGeometries(Collection<T> geoms)
static Collection<org.locationtech.jts.geom.Geometry>
getGeometries(org.locationtech.jts.geom.Geometry geom)
static <T extends org.locationtech.jts.geom.Geometry>
Collection<org.locationtech.jts.geom.Geometry>getGeometriesCloseTo(org.locationtech.jts.geom.Coordinate c, Collection<T> geoms, double squareDistance)
static org.locationtech.jts.geom.Geometry
getGeometry(org.locationtech.jts.geom.Envelope env)
static org.locationtech.jts.geom.Polygon
getGeometry(org.locationtech.jts.geom.Envelope env, org.locationtech.jts.geom.GeometryFactory gf)
static org.locationtech.jts.geom.MultiLineString
getLinear(org.locationtech.jts.geom.Geometry g)
static <T extends org.locationtech.jts.geom.Geometry>
Collection<org.locationtech.jts.geom.LineString>getLineStrings(Collection<T> gs)
static <T extends org.locationtech.jts.geom.Geometry>
Collection<org.locationtech.jts.geom.LineString>getLineStrings(Collection<T> gs, double lengthDeletionThreshold)
static Collection<org.locationtech.jts.geom.LineString>
getLineStrings(org.locationtech.jts.geom.Geometry g)
static Collection<org.locationtech.jts.geom.LineString>
getLineStrings(org.locationtech.jts.geom.Geometry g, double lengthDeletionThreshold)
static <T extends org.locationtech.jts.geom.Geometry>
Collection<org.locationtech.jts.geom.Point>getPoints(Collection<T> gs)
static Collection<org.locationtech.jts.geom.Point>
getPoints(org.locationtech.jts.geom.Geometry g)
static Collection<org.locationtech.jts.geom.Point>
getPointsFromCoordinates(Collection<org.locationtech.jts.geom.Coordinate> cs)
static org.locationtech.jts.geom.MultiPolygon
getPolygonal(org.locationtech.jts.geom.Geometry g)
static <T extends org.locationtech.jts.geom.Geometry>
Collection<org.locationtech.jts.geom.Polygon>getPolygons(Collection<T> gs, double areaDeletionThreshold)
static Collection<org.locationtech.jts.geom.Polygon>
getPolygons(org.locationtech.jts.geom.Geometry g)
static Collection<org.locationtech.jts.geom.Polygon>
getPolygons(org.locationtech.jts.geom.Geometry g, double areaDeletionThreshold)
static org.locationtech.jts.geom.MultiPoint
getPuntual(org.locationtech.jts.geom.Geometry g)
static Collection<org.locationtech.jts.geom.LineString>
getRings(org.locationtech.jts.geom.Polygon p)
static boolean
intersects(Collection<org.locationtech.jts.geom.Geometry> gs, org.locationtech.jts.geom.Geometry g)
static boolean
intersects(org.locationtech.jts.geom.Geometry geom1, org.locationtech.jts.geom.Geometry geom2)
static boolean
intersects(org.locationtech.jts.index.SpatialIndex gs, org.locationtech.jts.geom.Geometry g)
static org.locationtech.jts.geom.GeometryCollection
toMulti(org.locationtech.jts.geom.Geometry geom)
static org.locationtech.jts.geom.MultiLineString
toMulti(org.locationtech.jts.geom.LineString geom)
static org.locationtech.jts.geom.MultiPoint
toMulti(org.locationtech.jts.geom.Point geom)
static org.locationtech.jts.geom.MultiPolygon
toMulti(org.locationtech.jts.geom.Polygon geom)
static org.locationtech.jts.geom.Geometry
toSimple(org.locationtech.jts.geom.GeometryCollection gc)
static org.locationtech.jts.geom.LineString
toSimple(org.locationtech.jts.geom.MultiLineString mls)
static org.locationtech.jts.geom.Point
toSimple(org.locationtech.jts.geom.MultiPoint mp)
static org.locationtech.jts.geom.Polygon
toSimple(org.locationtech.jts.geom.MultiPolygon mp)
-
-
-
Method Detail
-
createCoordinates
public static org.locationtech.jts.geom.Coordinate[] createCoordinates(double... cs)
-
createLineString
public static org.locationtech.jts.geom.LineString createLineString(double... cs)
-
createPolygon
public static org.locationtech.jts.geom.Polygon createPolygon(double... cs)
-
clean
public static org.locationtech.jts.geom.Geometry clean(org.locationtech.jts.geom.Geometry geom)
-
intersects
public static boolean intersects(org.locationtech.jts.geom.Geometry geom1, org.locationtech.jts.geom.Geometry geom2)
-
getGeometry
public static org.locationtech.jts.geom.Polygon getGeometry(org.locationtech.jts.geom.Envelope env, org.locationtech.jts.geom.GeometryFactory gf)
-
getGeometry
public static org.locationtech.jts.geom.Geometry getGeometry(org.locationtech.jts.geom.Envelope env)
-
getBoundary
public static org.locationtech.jts.geom.LineString getBoundary(org.locationtech.jts.geom.Envelope env, org.locationtech.jts.geom.GeometryFactory gf)
-
getBoundary
public static org.locationtech.jts.geom.LineString getBoundary(org.locationtech.jts.geom.Envelope env)
-
getPointsFromCoordinates
public static Collection<org.locationtech.jts.geom.Point> getPointsFromCoordinates(Collection<org.locationtech.jts.geom.Coordinate> cs)
-
getGeometriesCloseTo
public static <T extends org.locationtech.jts.geom.Geometry> Collection<org.locationtech.jts.geom.Geometry> getGeometriesCloseTo(org.locationtech.jts.geom.Coordinate c, Collection<T> geoms, double squareDistance)
-
getRings
public static Collection<org.locationtech.jts.geom.LineString> getRings(org.locationtech.jts.geom.Polygon p)
-
containsSFS
public static boolean containsSFS(org.locationtech.jts.geom.Envelope env, org.locationtech.jts.geom.Envelope env2)
-
getGeometries
public static Collection<org.locationtech.jts.geom.Geometry> getGeometries(org.locationtech.jts.geom.Geometry geom)
-
getGeometries
public static <T extends org.locationtech.jts.geom.Geometry> Collection<org.locationtech.jts.geom.Geometry> getGeometries(Collection<T> geoms)
-
toSimple
public static org.locationtech.jts.geom.Geometry toSimple(org.locationtech.jts.geom.GeometryCollection gc)
-
toSimple
public static org.locationtech.jts.geom.Point toSimple(org.locationtech.jts.geom.MultiPoint mp)
-
toSimple
public static org.locationtech.jts.geom.LineString toSimple(org.locationtech.jts.geom.MultiLineString mls)
-
toSimple
public static org.locationtech.jts.geom.Polygon toSimple(org.locationtech.jts.geom.MultiPolygon mp)
-
toMulti
public static org.locationtech.jts.geom.MultiPoint toMulti(org.locationtech.jts.geom.Point geom)
-
toMulti
public static org.locationtech.jts.geom.MultiLineString toMulti(org.locationtech.jts.geom.LineString geom)
-
toMulti
public static org.locationtech.jts.geom.MultiPolygon toMulti(org.locationtech.jts.geom.Polygon geom)
-
toMulti
public static org.locationtech.jts.geom.GeometryCollection toMulti(org.locationtech.jts.geom.Geometry geom)
-
getPolygons
public static Collection<org.locationtech.jts.geom.Polygon> getPolygons(org.locationtech.jts.geom.Geometry g)
-
getPolygons
public static Collection<org.locationtech.jts.geom.Polygon> getPolygons(org.locationtech.jts.geom.Geometry g, double areaDeletionThreshold)
-
getPolygons
public static <T extends org.locationtech.jts.geom.Geometry> Collection<org.locationtech.jts.geom.Polygon> getPolygons(Collection<T> gs, double areaDeletionThreshold)
-
getLineStrings
public static Collection<org.locationtech.jts.geom.LineString> getLineStrings(org.locationtech.jts.geom.Geometry g)
-
getLineStrings
public static Collection<org.locationtech.jts.geom.LineString> getLineStrings(org.locationtech.jts.geom.Geometry g, double lengthDeletionThreshold)
-
getLineStrings
public static <T extends org.locationtech.jts.geom.Geometry> Collection<org.locationtech.jts.geom.LineString> getLineStrings(Collection<T> gs)
-
getLineStrings
public static <T extends org.locationtech.jts.geom.Geometry> Collection<org.locationtech.jts.geom.LineString> getLineStrings(Collection<T> gs, double lengthDeletionThreshold)
-
getPoints
public static Collection<org.locationtech.jts.geom.Point> getPoints(org.locationtech.jts.geom.Geometry g)
-
getPoints
public static <T extends org.locationtech.jts.geom.Geometry> Collection<org.locationtech.jts.geom.Point> getPoints(Collection<T> gs)
-
getPuntual
public static org.locationtech.jts.geom.MultiPoint getPuntual(org.locationtech.jts.geom.Geometry g)
-
getLinear
public static org.locationtech.jts.geom.MultiLineString getLinear(org.locationtech.jts.geom.Geometry g)
-
getPolygonal
public static org.locationtech.jts.geom.MultiPolygon getPolygonal(org.locationtech.jts.geom.Geometry g)
-
getGeomBigType
public static int getGeomBigType(org.locationtech.jts.geom.Geometry g)
-
extract
public static org.locationtech.jts.geom.GeometryCollection extract(org.locationtech.jts.geom.Geometry g, int geomBigType)
-
getEnvelopeInternal
public static org.locationtech.jts.geom.Envelope getEnvelopeInternal(Collection<org.locationtech.jts.geom.Geometry> gs)
-
intersects
public static boolean intersects(Collection<org.locationtech.jts.geom.Geometry> gs, org.locationtech.jts.geom.Geometry g)
-
intersects
public static boolean intersects(org.locationtech.jts.index.SpatialIndex gs, org.locationtech.jts.geom.Geometry g)
-
checkGeometry
public static <T extends org.locationtech.jts.geom.Geometry> boolean checkGeometry(Collection<Feature> fs, boolean checkValidity, Class<T> cl)
Check some features have a geometry (non null and non empty). Possibly check the geometry validity and its type.- Parameters:
fs
- The input features- Returns:
- true if OK, false else
-
-