Class ShapeFactory

java.lang.Object
org.openspaces.spatial.ShapeFactory

public class ShapeFactory extends Object
Factory class for creating spatial shapes.
Since:
11.0
Author:
Niv Ingberg
  • Method Details

    • point

      public static Point point(double x, double y)
      Creates a Point instance.
      Parameters:
      x - The X coordinate, or Longitude in geospatial contexts
      y - The Y coordinate, or Latitude in geospatial contexts
      Returns:
      A new Point instance
    • circle

      public static Circle circle(Point center, double radius)
      Creates a Circle instance
      Parameters:
      center - The center of the circle
      radius - The radius of the circle
      Returns:
      A new Circle instance
    • rectangle

      public static Rectangle rectangle(double minX, double maxX, double minY, double maxY)
      Creates a Rectangle instance
      Parameters:
      minX - The left edge of the X coordinate
      maxX - The right edge of the X coordinate
      minY - The bottom edge of the Y coordinate
      maxY - The top edge of the Y coordinate
      Returns:
      A new Rectangle instance
    • lineString

      public static LineString lineString(Point first, Point second, Point... morePoints)
      Creates a LineString instance from the specified points
      Parameters:
      first - The first point
      second - The second point
      morePoints - The rest of the points
      Returns:
      A new LineString instance
    • lineString

      public static LineString lineString(Collection<Point> points)
      Creates a LineString instance from the specified points
      Parameters:
      points - The LineString points
      Returns:
      A new LineString instance
    • polygon

      public static Polygon polygon(Point first, Point second, Point third, Point... morePoints)
      Creates a Polygon instance from the specified points
      Parameters:
      first - The first point
      second - The second point
      third - The third point
      morePoints - The rest of the points
      Returns:
      A new Polygon instance
    • polygon

      public static Polygon polygon(Collection<Point> points)
      Creates a Polygon instance from the specified points
      Parameters:
      points - The polygon points
      Returns:
      A new Polygon instance
    • parse

      public static Shape parse(String s, ShapeFormat shapeFormat)
      Parses the specified string using the specified shape format
      Parameters:
      s - String to parse
      shapeFormat - Shape format to use for parsing
      Returns:
      The created shape instance