Module org.apache.jena.geosparql
Class GeometryGenerator
java.lang.Object
org.apache.jena.geosparql.spatial.index.v2.GeometryGenerator
Class to generate various geometry types for testing. The generated coordinate sequences are based on circles.
This class is also used in jena-benchmarks.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.locationtech.jts.geom.Coordinate[]createCircle(org.locationtech.jts.geom.GeometryFactory geometryFactory, org.locationtech.jts.geom.Coordinate center, double radius, int numPoints, boolean closed) static Map<GeometryGenerator.GeometryType, Number> createConfig(long amount) Create a map that maps each geometry type to the specified amount.static org.locationtech.jts.geom.GeometrycreateGeom(GeometryGenerator.GeometryType type, org.locationtech.jts.geom.GeometryFactory f, org.locationtech.jts.geom.Coordinate center, double radius, int numPoints) static longgenerateGraph(org.apache.jena.graph.Graph graph, org.locationtech.jts.geom.Envelope envelope, Map<GeometryGenerator.GeometryType, Number> config) Generate GeoSPARQL data with various geometry types in the given graph.
-
Constructor Details
-
GeometryGenerator
public GeometryGenerator()
-
-
Method Details
-
createCircle
public static org.locationtech.jts.geom.Coordinate[] createCircle(org.locationtech.jts.geom.GeometryFactory geometryFactory, org.locationtech.jts.geom.Coordinate center, double radius, int numPoints, boolean closed) -
createGeom
public static org.locationtech.jts.geom.Geometry createGeom(GeometryGenerator.GeometryType type, org.locationtech.jts.geom.GeometryFactory f, org.locationtech.jts.geom.Coordinate center, double radius, int numPoints) -
createConfig
Create a map that maps each geometry type to the specified amount. For use withgenerateGraph(Graph, Envelope, Map). -
generateGraph
public static long generateGraph(org.apache.jena.graph.Graph graph, org.locationtech.jts.geom.Envelope envelope, Map<GeometryGenerator.GeometryType, Number> config) Generate GeoSPARQL data with various geometry types in the given graph.- Parameters:
graph- The target graph.envelope- The allowed area for the positions of generated geometries (the shape may overlap).config- Map of geometry type to the number of geometries to generate.- Returns:
- The number of generated geometries added to the graph.
-