@Immutable public class Distance extends DefaultGeometry
Geo.distance
.
This is a circle in a two-dimensional XY plane represented by its center point and radius. It is used as a search criteria to determine whether or not another geospatial object lies within a circular area.
Note that this shape has no equivalent in the OGC and GeoJSON standards: as a consequence,
asWellKnownText()
returns a custom format, and getOgcGeometry()
, asWellKnownBinary()
, and asGeoJson()
throw UnsupportedOperationException
.
Unlike other geo types, this class is never exposed directly to driver clients: it is used internally by geo predicates, but cannot be a column type, nor appear in CQL or graph results. Therefore it doesn't have a public-facing interface, nor a built-in codec.
SPATIAL_REFERENCE_4326
Constructor and Description |
---|
Distance(Point center,
double radius)
Creates a new distance with the given center and radius.
|
Modifier and Type | Method and Description |
---|---|
String |
asGeoJson()
The distance type has no equivalent in the GeoJSON standard: this method throws an
UnsupportedOperationException . |
ByteBuffer |
asWellKnownBinary()
The distance type has no equivalent in the OGC standard: this method throws an
UnsupportedOperationException . |
String |
asWellKnownText()
Returns a Well-known Text (WKT)
representation of this geospatial type.
|
boolean |
contains(Geometry geometry)
Tests whether this geospatial type instance contains another instance.
|
boolean |
equals(Object other) |
static Distance |
fromWellKnownText(String source)
Creates a distance from its Well-known
Text (WKT) representation.
|
Point |
getCenter() |
com.esri.core.geometry.ogc.OGCGeometry |
getOgcGeometry()
The distance type has no equivalent in the OGC standard: this method throws an
UnsupportedOperationException . |
double |
getRadius() |
int |
hashCode() |
fromOgcGeoJson, fromOgcWellKnownBinary, fromOgcWellKnownText, getEsriGeometry, getPoints, toEsri, toString
public Distance(@NonNull Point center, double radius)
center
- The center point.radius
- The radius of the circle representing distance.@NonNull public static Distance fromWellKnownText(@NonNull String source)
source
- the Well-known Text representation to parse.IllegalArgumentException
- if the string does not contain a valid Well-known Text
representation.asWellKnownText()
@NonNull public Point getCenter()
public double getRadius()
@NonNull public String asWellKnownText()
Since there is no Well-known Text specification for Distance, this returns a custom format
of: DISTANCE((center.x center.y) radius)
asWellKnownText
in interface Geometry
asWellKnownText
in class DefaultGeometry
@NonNull public com.esri.core.geometry.ogc.OGCGeometry getOgcGeometry()
UnsupportedOperationException
.getOgcGeometry
in class DefaultGeometry
@NonNull public ByteBuffer asWellKnownBinary()
UnsupportedOperationException
.asWellKnownBinary
in interface Geometry
asWellKnownBinary
in class DefaultGeometry
@NonNull public String asGeoJson()
UnsupportedOperationException
.asGeoJson
in interface Geometry
asGeoJson
in class DefaultGeometry
public boolean equals(Object other)
equals
in class DefaultGeometry
public int hashCode()
hashCode
in class DefaultGeometry
public boolean contains(@NonNull Geometry geometry)
Geometry
contains
in interface Geometry
contains
in class DefaultGeometry
geometry
- the other instance.this
contains other
.Copyright © 2017–2019. All rights reserved.