org.cts.cs
Class GeographicExtent

java.lang.Object
  extended by org.cts.cs.GeographicExtent
All Implemented Interfaces:
Extent

public class GeographicExtent
extends Object
implements Extent

A geographic extent is an area of the Earth surface delimited by a southern latitude, a northern latitude, a western longitude and an eastern longitude.

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).

Author:
Michaƫl Michaud

Field Summary
static GeographicExtent WORLD
          The World Extent that contains all the planet surface.
 
Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WORLD

public static final GeographicExtent WORLD
The World Extent that contains all the planet surface.

Constructor Detail

GeographicExtent

public GeographicExtent(String name,
                        double southernBound,
                        double northernBound,
                        double westernBound,
                        double easternBound)
Creates a new GeographicExtent. If easternBound is lower than westernBound, CTS consider that the GeographicExtent crosses the 180 meridian.

Parameters:
name - the name of the GeographicExtent
southernBound - the southern bound of the GeographicExtent, in decimal degree
northernBound - the northern bound of the GeographicExtent, in decimal degree
westernBound - the western bound of the GeographicExtent, in decimal degree
easternBound - the eastern bound of the GeographicExtent, in decimal degree

GeographicExtent

public GeographicExtent(String name,
                        double southernBound,
                        double northernBound,
                        double westernBound,
                        double easternBound,
                        double modulo)
Creates a new GeographicExtent. If easternBound is lower than westernBound, CTS consider that the GeographicExtent crosses the 180 meridian.

Parameters:
name - the name of the GeographicExtent
southernBound - the southern bound of the GeographicExtent, in decimal degree
northernBound - the northern bound of the GeographicExtent, in decimal degree
westernBound - the western bound of the GeographicExtent, in decimal degree
easternBound - the eastern bound of the GeographicExtent, in decimal degree
modulo - the modulo value for the GeographicExtent
Method Detail

getName

public String getName()
Return the name of this geographic area.

Specified by:
getName in interface Extent

getWesternBound

public double getWesternBound()
Return the western bound of this geographic area.


getEasternBound

public double getEasternBound()
Return the eastern bound of this geographic area.


getSouthernBound

public double getSouthernBound()
Return the southern bound of this geographic area.


getNorthernBound

public double getNorthernBound()
Return the northern bound of this geographic area.


getModulo

public double getModulo()
Return the modulo value (360 for an extent in degree).


isInside

public boolean isInside(double lat,
                        double lon)
Return whether the point formed by input latitude and longitude is inside this GeographicExtent or not.

Parameters:
lat - the latitude of the point to test, expressed in decimal degree
lon - the longitude of the point to test, expressed in decimal degree

isInside

public boolean isInside(double[] coord)
Return whether coord is inside this Extent or not. For GeographicExtent, coord must be a latitude and a longitude (in this order) and in decimal degrees.

Specified by:
isInside in interface Extent
Parameters:
coord - the coordinates to test

toString

public String toString()
Return a String representation of this GeographicExtent.

Overrides:
toString in class Object


Copyright © 2014 IRSTV CNRS-FR-2488. All Rights Reserved.