Package net.sf.eBusx.geo
Class GeoObject
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject
-
- net.sf.eBus.messages.EField
-
- net.sf.eBusx.geo.GeoObject
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
GeoCircle,GeoCollection,GeoEllipse,GeoLineString,GeoMultiLineString,GeoMultiPoint,GeoMultiPolygon,GeoPoint,GeoPolygon
public abstract class GeoObject extends EField
Base class for all GeoJSON elements. Contains GeoJSON element type (required) and bounding box (optional).- Author:
- Charles W. Rapp
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGeoObject.GeoBuilder<F extends GeoObject,B extends GeoObject.GeoBuilder<F,?>>Base class for all GeoJSON object builders.static classGeoObject.GeoTypeEnumerates GeoJSON geo-spatial data types.-
Nested classes/interfaces inherited from class net.sf.eBus.messages.EField
EField.Builder<M extends EField>
-
-
Field Summary
Fields Modifier and Type Field Description BoundingBoxboundingBoxOptional bounding box associated with this GeoJSON type.static java.math.BigDecimalMAX_LATITUDEMaximum allowed latitude is +90.static java.math.BigDecimalMAX_LONGITUDEMaximum allowed longitude is +180.static java.math.BigDecimalMIN_LATITUDEMinimum allowed latitude is -90.static java.math.BigDecimalMIN_LONGITUDEMinimum allowed longitude is -180.GeoObject.GeoTypetypeData represents this geometry type.
-
Constructor Summary
Constructors Modifier Constructor Description protectedGeoObject(GeoObject.GeoBuilder<?,?> builder)Creates a new OpenStreatMap element based on the given builder settings.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringtoString()Returns text specifying GeoJSON type and attributesstatic java.math.BigDecimalvalidateLatitude(java.math.BigDecimal latitude)static java.math.BigDecimalvalidateLongitude(java.math.BigDecimal longitude)
-
-
-
Field Detail
-
MIN_LATITUDE
public static final java.math.BigDecimal MIN_LATITUDE
Minimum allowed latitude is -90.
-
MAX_LATITUDE
public static final java.math.BigDecimal MAX_LATITUDE
Maximum allowed latitude is +90.
-
MIN_LONGITUDE
public static final java.math.BigDecimal MIN_LONGITUDE
Minimum allowed longitude is -180.
-
MAX_LONGITUDE
public static final java.math.BigDecimal MAX_LONGITUDE
Maximum allowed longitude is +180.
-
type
public final GeoObject.GeoType type
Data represents this geometry type.
-
boundingBox
@Nullable public final BoundingBox boundingBox
Optional bounding box associated with this GeoJSON type.
-
-
Constructor Detail
-
GeoObject
protected GeoObject(GeoObject.GeoBuilder<?,?> builder)
Creates a new OpenStreatMap element based on the given builder settings.- Parameters:
builder- contains common element settings.
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns text specifying GeoJSON type and attributes- Overrides:
toStringin classjava.lang.Object- Returns:
- human-readable text containing GeoJSON type name and attributes.
-
validateLatitude
public static java.math.BigDecimal validateLatitude(java.math.BigDecimal latitude)
Certifies thatlatitudeis notnulland is ≥MIN_LATITUDEand ≤MAX_LATITUDE. Throws the appropriate exception if not the case. Otherwise returns the validated latitude.- Parameters:
latitude- validate this latitude.- Returns:
- validated
latitude. - Throws:
java.lang.NullPointerException- iflatitudeisnull.java.lang.IllegalArgumentException- iflatitude<MIN_LATITUDEor >MAX_LATITUDE.
-
validateLongitude
public static java.math.BigDecimal validateLongitude(java.math.BigDecimal longitude)
Certifies thatlongitudeis notnulland is ≥MIN_LONGITUDEand ≤MAX_LONGITUDE. Throws the appropriate exception if not the case. Otherwise returns the validated longitude.- Parameters:
longitude- validate this longitude.- Returns:
- validated
longitude. - Throws:
java.lang.NullPointerException- iflongitudeisnull.java.lang.IllegalArgumentException- iflongitude<MIN_LONGITUDEor >MAX_LONGITUDE.
-
-