Package repast.simphony.gis.util
Class GeometryUtil
java.lang.Object
repast.simphony.gis.util.GeometryUtil
Utilities methods for geometries
- Author:
- Nick Collier, Eric Tatara
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic GeometryUtil.GeometryTypefindGeometryType(Class geomClass) Finds the geometry type of the specified org.locationtech.jts.geom class.static GeometryUtil.GeometryTypefindGeometryType(org.geotools.styling.Style style) Finds the geometry type associated with a style.static GeometryUtil.GeometryTypefindGeometryType(org.locationtech.jts.geom.Geometry geom) Finds the geometry type of the specified geometry.static GeometryUtil.GeometryTypefindGeometryType(org.opengis.feature.simple.SimpleFeature feature) Finds the geometry type of the specified feature.static org.locationtech.jts.geom.GeometrygenerateBuffer(Geography geography, org.locationtech.jts.geom.Geometry geom, double distance) Generates a Geometry that represents a buffer zone around the Geometry geom argument.static List<org.locationtech.jts.geom.Coordinate>generateRandomPointsInPolygon(org.locationtech.jts.geom.Geometry mask, int numPoints) Generate a collection of random coordinates that fall within the provided mask geometry.static List<org.locationtech.jts.geom.Coordinate>generateRandomPointsInPolygon(org.locationtech.jts.geom.Geometry mask, int numPoints, cern.jet.random.engine.RandomEngine generator) Generate a collection of random coordinates that fall within the provided mask geometry.
- 
Constructor Details- 
GeometryUtilpublic GeometryUtil()
 
- 
- 
Method Details- 
findGeometryTypeFinds the geometry type of the specified org.locationtech.jts.geom class.- Parameters:
- geom- the org.locationtech.jts.geom class whose type we want.
- Returns:
- the geometry type of the specified org.locationtech.jts.geom class.
 
- 
findGeometryTypeFinds the geometry type of the specified geometry.- Parameters:
- geom- the geometry whose type we want.
- Returns:
- the geometry type of the specified geometry.
 
- 
findGeometryTypeFinds the geometry type associated with a style.- Parameters:
- style- the style to check
- Returns:
- the geometry type associated with a style.
 
- 
findGeometryTypepublic static GeometryUtil.GeometryType findGeometryType(org.opengis.feature.simple.SimpleFeature feature) Finds the geometry type of the specified feature.- Parameters:
- feature- the feature whose type we want.
- Returns:
- the geometry type of the specified feature.
 
- 
generateBufferpublic static org.locationtech.jts.geom.Geometry generateBuffer(Geography geography, org.locationtech.jts.geom.Geometry geom, double distance) Generates a Geometry that represents a buffer zone around the Geometry geom argument. An automatic conversion of the geometry CRS is done to UTM if neccessary. The distance argument is in SI meters and represent the distance from the edge of the geometry to the border.- Parameters:
- geography- the geography
- geom- the geometry for which to create a buffer
- distance- the distance in meters between the geometry and the boundary
- Returns:
- the buffer geometry
 
- 
generateRandomPointsInPolygonpublic static List<org.locationtech.jts.geom.Coordinate> generateRandomPointsInPolygon(org.locationtech.jts.geom.Geometry mask, int numPoints) Generate a collection of random coordinates that fall within the provided mask geometry. The default Repast uniform distribution instance is use for random number generation and can be controlled with the model seed.- Parameters:
- mask- the mask Geometry (border) to enclose random points
- numPoints- the number of random points to generate
- Returns:
- a collection of random coordinates
 
- 
generateRandomPointsInPolygonpublic static List<org.locationtech.jts.geom.Coordinate> generateRandomPointsInPolygon(org.locationtech.jts.geom.Geometry mask, int numPoints, cern.jet.random.engine.RandomEngine generator) Generate a collection of random coordinates that fall within the provided mask geometry. The RandomEngine instance is use for random number generation.- Parameters:
- mask- the mask Geometry (border) to enclose random points
- numPoints- the number of random points to generate
- generator- the random generator engine
- Returns:
- a collection of random coordinates
 
 
-