Package org.openspaces.spatial
Class ShapeFactory
java.lang.Object
org.openspaces.spatial.ShapeFactory
Factory class for creating spatial shapes.
- Since:
- 11.0
- Author:
- Niv Ingberg
-
Method Summary
Modifier and TypeMethodDescriptionstatic CircleCreates a Circle instancestatic LineStringlineString(Collection<Point> points) Creates a LineString instance from the specified pointsstatic LineStringlineString(Point first, Point second, Point... morePoints) Creates a LineString instance from the specified pointsstatic Shapeparse(String s, ShapeFormat shapeFormat) Parses the specified string using the specified shape formatstatic Pointpoint(double x, double y) Creates a Point instance.static Polygonpolygon(Collection<Point> points) Creates a Polygon instance from the specified pointsstatic PolygonCreates a Polygon instance from the specified pointsstatic Rectanglerectangle(double minX, double maxX, double minY, double maxY) Creates a Rectangle instance
-
Method Details
-
point
Creates a Point instance.- Parameters:
x- The X coordinate, or Longitude in geospatial contextsy- The Y coordinate, or Latitude in geospatial contexts- Returns:
- A new Point instance
-
circle
Creates a Circle instance- Parameters:
center- The center of the circleradius- The radius of the circle- Returns:
- A new Circle instance
-
rectangle
Creates a Rectangle instance- Parameters:
minX- The left edge of the X coordinatemaxX- The right edge of the X coordinateminY- The bottom edge of the Y coordinatemaxY- The top edge of the Y coordinate- Returns:
- A new Rectangle instance
-
lineString
Creates a LineString instance from the specified points- Parameters:
first- The first pointsecond- The second pointmorePoints- The rest of the points- Returns:
- A new LineString instance
-
lineString
Creates a LineString instance from the specified points- Parameters:
points- The LineString points- Returns:
- A new LineString instance
-
polygon
Creates a Polygon instance from the specified points- Parameters:
first- The first pointsecond- The second pointthird- The third pointmorePoints- The rest of the points- Returns:
- A new Polygon instance
-
polygon
Creates a Polygon instance from the specified points- Parameters:
points- The polygon points- Returns:
- A new Polygon instance
-
parse
Parses the specified string using the specified shape format- Parameters:
s- String to parseshapeFormat- Shape format to use for parsing- Returns:
- The created shape instance
-