Class Geometry
java.lang.Object
com.surrealdb.Native
com.surrealdb.Geometry
A SurrealDB geometry value. Supports all GeoJSON-style types:
Point,
LineString, Polygon, MultiPoint,
MultiLineString, MultiPolygon, and
GeometryCollection.
Coordinates use Point2D.Double where x is the
longitude and y is the latitude (GeoJSON ordering). Multi-coordinate
types are exposed as nested Lists of points.
Instances can be read from query results (via Value.getGeometry())
and constructed with the static factory methods to be sent back to the
database.
-
Method Summary
Modifier and TypeMethodDescriptionstatic GeometrygeometryCollection(List<Geometry> geometries) getPoint()Returns the polygon's rings.getType()Returns the geometry type: one of"Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon", or"GeometryCollection".booleanbooleanbooleanbooleanbooleanbooleanisPoint()booleanstatic GeometrylineString(List<Point2D.Double> points) static GeometrymultiLineString(List<List<Point2D.Double>> lines) static GeometrymultiPoint(List<Point2D.Double> points) static GeometrymultiPolygon(List<List<List<Point2D.Double>>> polygons) static Geometrypoint(double x, double y) static Geometrypoint(Point2D.Double point) static Geometrypolygon(List<List<Point2D.Double>> rings) Builds a polygon.
-
Method Details
-
getType
Returns the geometry type: one of"Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon", or"GeometryCollection". -
isPoint
public boolean isPoint() -
isLineString
public boolean isLineString() -
isPolygon
public boolean isPolygon() -
isMultiPoint
public boolean isMultiPoint() -
isMultiLineString
public boolean isMultiLineString() -
isMultiPolygon
public boolean isMultiPolygon() -
isGeometryCollection
public boolean isGeometryCollection() -
getPoint
-
getLineString
-
getMultiPoint
-
getPolygon
Returns the polygon's rings. The first ring is the exterior boundary; any subsequent rings are interior holes. -
getMultiLineString
-
getMultiPolygon
-
getGeometryCollection
-
point
-
point
-
lineString
-
multiPoint
-
polygon
Builds a polygon. The first ring is the exterior boundary; any subsequent rings are interior holes. -
multiLineString
-
multiPolygon
-
geometryCollection
-