public class GeographicExtent extends Object implements Extent
The main difference between planimetric extent and geographic extent is that geographic extent handles the case where the extent includes the 180 meridian. In that case, a point included in the extent may have a longitude (ex. -179) which is lesser than western meridian (ex. 170) and lesser than eastern meridian ex. -170).
| Modifier and Type | Field and Description |
|---|---|
static GeographicExtent |
WORLD
The World Extent that contains all the planet surface.
|
| Constructor and Description |
|---|
GeographicExtent(String name,
double southernBound,
double northernBound,
double westernBound,
double easternBound)
Creates a new GeographicExtent.
|
GeographicExtent(String name,
double southernBound,
double northernBound,
double westernBound,
double easternBound,
double modulo)
Creates a new GeographicExtent.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getEasternBound()
Return the eastern bound of this geographic area.
|
double |
getModulo()
Return the modulo value (360 for an extent in degree).
|
String |
getName()
Return the name of this geographic area.
|
double |
getNorthernBound()
Return the northern bound of this geographic area.
|
double |
getSouthernBound()
Return the southern bound of this geographic area.
|
double |
getWesternBound()
Return the western bound of this geographic area.
|
boolean |
isInside(double[] coord)
Return whether coord is inside this Extent or not.
|
boolean |
isInside(double lat,
double lon)
Return whether the point formed by input latitude and longitude is inside
this GeographicExtent or not.
|
String |
toString()
Return a String representation of this GeographicExtent.
|
public static final GeographicExtent WORLD
public GeographicExtent(String name, double southernBound, double northernBound, double westernBound, double easternBound)
name - the name of the GeographicExtentsouthernBound - the southern bound of the GeographicExtent, in
decimal degreenorthernBound - the northern bound of the GeographicExtent, in
decimal degreewesternBound - the western bound of the GeographicExtent, in decimal
degreeeasternBound - the eastern bound of the GeographicExtent, in decimal
degreepublic GeographicExtent(String name, double southernBound, double northernBound, double westernBound, double easternBound, double modulo)
name - the name of the GeographicExtentsouthernBound - the southern bound of the GeographicExtent, in
decimal degreenorthernBound - the northern bound of the GeographicExtent, in
decimal degreewesternBound - the western bound of the GeographicExtent, in decimal
degreeeasternBound - the eastern bound of the GeographicExtent, in decimal
degreemodulo - the modulo value for the GeographicExtentpublic String getName()
public double getWesternBound()
public double getEasternBound()
public double getSouthernBound()
public double getNorthernBound()
public double getModulo()
public boolean isInside(double lat,
double lon)
lat - the latitude of the point to test, expressed in decimal degreelon - the longitude of the point to test, expressed in decimal
degreepublic boolean isInside(double[] coord)
GeographicExtent, coord must be a latitude and a longitude
(in this order) and in decimal degrees.Copyright © 2019 CNRS. All rights reserved.