java.lang.Object
org.apache.jena.geosparql.spatial.index.v2.GeometryGenerator

public class GeometryGenerator extends Object
Class to generate various geometry types for testing. The generated coordinate sequences are based on circles. This class is also used in jena-benchmarks.
  • 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

      public static Map<GeometryGenerator.GeometryType,Number> createConfig(long amount)
      Create a map that maps each geometry type to the specified amount. For use with generateGraph(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.