@Immutable public abstract class GeoArea extends GeoObject
GeoArea := Primitive | Inverse | Union | Difference Primitive := GeoRectangle | GeoCircle Inverse := invert(GeoArea) Union := add(GeoArea, GeoArea) Difference := subtract(GeoArea, GeoArea) Intersection := intersect(GeoArea, GeoArea)Primitives are specified using GeoPoint objects, which can contain latitude/longitude values. As latitudes/longitudes do not project easily to a Carthesian coordinates, the operations for union, intersect, contains, etc. are subject to the following known restrictions: They are only accurate for relatively small areas, such as 200x200km. They are may do NOT work properly around the 180th degree longitude (http://en.wikipedia.org/wiki/180th_meridian). Definitions of operators: Union({1, 2, 3}, {3, 4, 5}) == {1, 2, 3, 4, 5} Difference({ 1, 2, 3}, {3, 4, 5}) == {1, 2} Intersection({ 1, 2, 3}, {3, 4, 5}) == {3}
Constructor and Description |
---|
GeoArea() |
Modifier and Type | Method and Description |
---|---|
GeoArea |
add(GeoArea op)
Binary operator: add(this, other).
|
abstract GeoRectangle |
boundingBox()
Return a rectangle bounding box for the entire expression.
|
abstract boolean |
contains(GeoArea area)
Returns whether another geo area is fully contained within 'this' geo area.
|
abstract boolean |
contains(GeoPoint point)
See
contains(GeoArea) . |
static GeoArea |
fromAreas(Collection<? extends GeoArea> areas)
Convenience function to create a GeoArea from a list of areas.
|
GeoPoint |
getCenter()
Center point of the geo object.
|
GeoPoint |
getOrigin()
Reference point of the geo object.
|
abstract boolean |
isCompound()
Return whether this area is singular of compound.
|
abstract GeoArea |
moveTo(GeoPoint origin)
Move a geo object to specific origin.
|
protected GeoArea |
optimize()
Return an optimized version of 'this' geo area.
|
abstract boolean |
overlaps(GeoArea area)
Returns whether 'this' geo area overlaps with another geo area.
|
abstract Collection<GeoRectangle> |
pixelate()
Return a flat list of GeoRectangles that approximate the shape of the GeoArea, much like pixelation of a shape.
|
abstract GeoArea |
translate(GeoVector vector)
Translate a geo object with an Easting and Northing value.
|
@Nonnull public GeoPoint getOrigin()
GeoObject
GeoObject.translate(GeoVector)
and GeoObject.moveTo(GeoPoint)
. The origin is always one of the used GeoPoints in the object.@Nonnull public GeoPoint getCenter()
GeoObject
@Nonnull public static GeoArea fromAreas(@Nonnull Collection<? extends GeoArea> areas)
areas
- Collection of areas to union. The list must contain at least 1 area.@Nonnull public final GeoArea add(@Nonnull GeoArea op)
op
- Area to add to 'this'.public abstract boolean overlaps(@Nonnull GeoArea area)
area
- Area to check if overlaps.public abstract boolean contains(@Nonnull GeoArea area)
area
- Area to check if it is contained.public abstract boolean contains(@Nonnull GeoPoint point)
contains(GeoArea)
.point
- Point.@Nonnull public abstract GeoRectangle boundingBox()
@Nonnull public abstract Collection<GeoRectangle> pixelate()
@Nonnull public abstract GeoArea translate(@Nonnull GeoVector vector)
GeoObject
@Nonnull public abstract GeoArea moveTo(GeoPoint origin)
public abstract boolean isCompound()
@Nonnull protected GeoArea optimize()
Copyright © 2018 TomTom International BV. All rights reserved.