public class Geoshape extends Object
getType() to determine the type of shape of a particular Geoshape object.
Use the static constructor methods to create the desired geoshape.
Note, polygons are not yet supported.| Modifier and Type | Class and Description |
|---|---|
static class |
Geoshape.GeoshapeGsonSerializer |
static class |
Geoshape.GeoshapeSerializer |
static class |
Geoshape.Point
A single point representation.
|
static class |
Geoshape.Type
The Type of a shape: a point, box, circle, or polygon
|
| Modifier and Type | Method and Description |
|---|---|
static Geoshape |
box(double southWestLatitude,
double southWestLongitude,
double northEastLatitude,
double northEastLongitude)
Constructs a new box shape which is identified by its south-west and north-east corner points
|
static Geoshape |
box(float southWestLatitude,
float southWestLongitude,
float northEastLatitude,
float northEastLongitude)
Constructs a new box shape which is identified by its south-west and north-east corner points
|
static Geoshape |
circle(double latitude,
double longitude,
double radiusInKM)
Constructs a circle from a given center point and a radius in kilometer
|
static Geoshape |
circle(float latitude,
float longitude,
float radiusInKM)
Constructs a circle from a given center point and a radius in kilometer
|
com.spatial4j.core.shape.Shape |
convert2Spatial4j()
Converts this shape into its equivalent Spatial4j
Shape. |
boolean |
disjoint(Geoshape other) |
boolean |
equals(Object other) |
Geoshape.Point |
getPoint()
Returns the singleton point of this shape.
|
Geoshape.Point |
getPoint(int position)
Returns the point at the given position.
|
float |
getRadius()
Returns the radius in kilometers of this circle.
|
Geoshape.Type |
getType()
Returns the
Geoshape.Type of this geoshape. |
int |
hashCode() |
boolean |
intersect(Geoshape other) |
static boolean |
isValidCoordinate(float latitude,
float longitude)
Whether the given coordinates mark a point on earth.
|
static Geoshape |
point(double latitude,
double longitude)
Constructs a point from its latitude and longitude information
|
static Geoshape |
point(float latitude,
float longitude)
Constructs a point from its latitude and longitude information
|
int |
size()
Returns the number of points comprising this geoshape.
|
String |
toString() |
boolean |
within(Geoshape outer) |
public Geoshape.Type getType()
Geoshape.Type of this geoshape.public int size()
public Geoshape.Point getPoint(int position)
size().position - public Geoshape.Point getPoint()
public float getRadius()
public boolean intersect(Geoshape other)
public boolean within(Geoshape outer)
public boolean disjoint(Geoshape other)
public com.spatial4j.core.shape.Shape convert2Spatial4j()
Shape.public static final Geoshape point(float latitude, float longitude)
latitude - longitude - public static final Geoshape point(double latitude, double longitude)
latitude - longitude - public static final Geoshape circle(float latitude, float longitude, float radiusInKM)
latitude - longitude - radiusInKM - public static final Geoshape circle(double latitude, double longitude, double radiusInKM)
latitude - longitude - radiusInKM - public static final Geoshape box(float southWestLatitude, float southWestLongitude, float northEastLatitude, float northEastLongitude)
southWestLatitude - southWestLongitude - northEastLatitude - northEastLongitude - public static final Geoshape box(double southWestLatitude, double southWestLongitude, double northEastLatitude, double northEastLongitude)
southWestLatitude - southWestLongitude - northEastLatitude - northEastLongitude - public static final boolean isValidCoordinate(float latitude,
float longitude)
latitude - longitude - Copyright © 2012–2015. All rights reserved.