Package repast.simphony.space.gis
Interface Geography<T>
-
- Type Parameters:
T
- Object type contained by the geography.
- All Superinterfaces:
Projection<T>
- All Known Implementing Classes:
ContextGeography
,DefaultGeography
public interface Geography<T> extends Projection<T>
Space that locates objects in a geographic gis-type space.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addCoverage(String name, org.geotools.coverage.grid.GridCoverage2D coverage)
Adds the named GridCoverage2DGISAdder<T>
getAdder()
Gets the current GISAdder that determines how objects are added to the geometry when added to the containing context.Iterable<T>
getAllObjects()
Gets all the objects that are in this geography.org.geotools.coverage.grid.GridCoverage2D
getCoverage(String name)
Gets the named coverage layerCollection<String>
getCoverageNames()
org.opengis.referencing.crs.CoordinateReferenceSystem
getCRS()
Gets the current coordinate reference system for this geometry.org.locationtech.jts.geom.Geometry
getGeometry(Object object)
Gets the geometric location of the specified object.Layer
getLayer(Class clazz)
Gets the layer for the specified type.Layer
getLayer(String name)
Gets the named layer.Collection<String>
getLayerNames()
Gets the names of the layers in this geography.Iterable<T>
getObjectsWithin(org.locationtech.jts.geom.Envelope envelope)
Gets an iterable over all the objects within the specified envelope.<X> Iterable<X>
getObjectsWithin(org.locationtech.jts.geom.Envelope envelope, Class<X> type)
Gets an iterable over all the objects within the specified envelope that are of the specified type and only the specified type.javax.measure.Unit<?>
getUnits(int axis)
Gets the coordinate reference system's axis units.void
move(T object, org.locationtech.jts.geom.Geometry geom)
Moves the specified object to the specified location.org.locationtech.jts.geom.Geometry
moveByDisplacement(T object, double lonShift, double latShift)
Displaces the specified object by the specified lon and lat amount.org.locationtech.jts.geom.Geometry
moveByVector(T object, double distance, double angleInRadians)
Moves the specified object the specified distance along the specified angle.org.locationtech.jts.geom.Geometry
moveByVector(T object, double distance, javax.measure.Unit<javax.measure.quantity.Length> unit, double angleInRadians)
Moves the specified object the specified distance along the specified angle.Iterable<T>
queryInexact(org.locationtech.jts.geom.Envelope envelope)
Queries this geography for objects that MAY intersect the the specified envelope.<X> Iterable<X>
queryInexact(org.locationtech.jts.geom.Envelope envelope, Class<X> type)
Queries this geography for objects that MAY intersect the the specified envelope and are of the specified type and only the specified type.void
removeCoverage(String name)
void
setAdder(GISAdder<T> adder)
Sets the current GISAdder that determines how objects are added to the geometry when added to the containing context.void
setCRS(String crsCode)
Sets the coordinate reference system for this Geometry.void
setCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Sets the coordinate reference system for this Geometry.int
size()
Gets the number of objects in the geography.-
Methods inherited from interface repast.simphony.space.projection.Projection
addProjectionListener, evaluate, getName, getProjectionListeners, removeProjectionListener
-
-
-
-
Method Detail
-
getLayerNames
Collection<String> getLayerNames()
Gets the names of the layers in this geography. There will be one layer for each type (by Java class) in a geography.- Returns:
- the names of the layers in this geography.
-
move
void move(T object, org.locationtech.jts.geom.Geometry geom)
Moves the specified object to the specified location. If the location is null then the object remains "in" this projection but without a location. The type of geometry must match the type currently associated with the layer. For example, an object cannot be located at a Point if the layer geometery type is a Polygon. A layer gets its geometry type from the first object that is moved in it.- Parameters:
object
- the object to movegeom
- the location to move the object to
-
getLayer
Layer getLayer(Class clazz)
Gets the layer for the specified type.- Parameters:
clazz
- the type associated with the desired layer- Returns:
- the layer for the specified type.
-
getLayer
Layer getLayer(String name)
Gets the named layer.- Parameters:
name
- the layer name- Returns:
- the named Layer.
-
getCoverage
org.geotools.coverage.grid.GridCoverage2D getCoverage(String name)
Gets the named coverage layer- Parameters:
name
- the layer name- Returns:
- the named coverage
-
removeCoverage
void removeCoverage(String name)
-
getCoverageNames
Collection<String> getCoverageNames()
-
addCoverage
void addCoverage(String name, org.geotools.coverage.grid.GridCoverage2D coverage)
Adds the named GridCoverage2D- Parameters:
name
-coverage
-
-
getGeometry
org.locationtech.jts.geom.Geometry getGeometry(Object object)
Gets the geometric location of the specified object.- Parameters:
object
- the object- Returns:
- the geometric location of the specified object.
-
getObjectsWithin
Iterable<T> getObjectsWithin(org.locationtech.jts.geom.Envelope envelope)
Gets an iterable over all the objects within the specified envelope.- Parameters:
envelope
- the bounding envelope- Returns:
- an iterable over all the objects within the specified location.
-
queryInexact
Iterable<T> queryInexact(org.locationtech.jts.geom.Envelope envelope)
Queries this geography for objects that MAY intersect the the specified envelope. This provides a first level filter for range rectangle queries. A second level filter SHOULD be applied to test for exact intersection.- Parameters:
envelope
- the envelope to query for- Returns:
- an iterable over items whose extents MAY intersect the given search envelope.
-
setCRS
void setCRS(String crsCode)
Sets the coordinate reference system for this Geometry. For example, "EPSG:4326". All the locations of the objects in this Geometry will be appropriately transformed.- Parameters:
crsCode
- the coordinate reference system code
-
setCRS
void setCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Sets the coordinate reference system for this Geometry. All the locations of the objects in this Geometry will be appropriately transformed.- Parameters:
crs
- the coordinate reference system
-
moveByVector
org.locationtech.jts.geom.Geometry moveByVector(T object, double distance, double angleInRadians)
Moves the specified object the specified distance along the specified angle.- Parameters:
object
- the object to movedistance
- the distance to move in metersangleInRadians
- the angle along which to move- Returns:
- the geometric location the object was moved to
-
moveByVector
org.locationtech.jts.geom.Geometry moveByVector(T object, double distance, javax.measure.Unit<javax.measure.quantity.Length> unit, double angleInRadians)
Moves the specified object the specified distance along the specified angle.- Parameters:
object
- the object to movedistance
- the distance to moveunit
- the distance units. This must be convertable to metersangleInRadians
- the angle along which to move- Returns:
- the geometric location the object was moved to
-
moveByDisplacement
org.locationtech.jts.geom.Geometry moveByDisplacement(T object, double lonShift, double latShift)
Displaces the specified object by the specified lon and lat amount.- Parameters:
object
- the object to movelonShift
- the amount to move longitudinalylatShift
- the amount to move latitudinaly- Returns:
- the new geometry of the object
-
getCRS
org.opengis.referencing.crs.CoordinateReferenceSystem getCRS()
Gets the current coordinate reference system for this geometry.- Returns:
- the current coordinate reference system for this geometry.
-
getAdder
GISAdder<T> getAdder()
Gets the current GISAdder that determines how objects are added to the geometry when added to the containing context.- Returns:
- the current GISAdder
-
setAdder
void setAdder(GISAdder<T> adder)
Sets the current GISAdder that determines how objects are added to the geometry when added to the containing context.- Parameters:
adder
- the new GISAdder
-
getUnits
javax.measure.Unit<?> getUnits(int axis)
Gets the coordinate reference system's axis units.- Parameters:
axis
- the axis index.- Returns:
- the coordinate reference system's axis units.
-
getObjectsWithin
<X> Iterable<X> getObjectsWithin(org.locationtech.jts.geom.Envelope envelope, Class<X> type)
Gets an iterable over all the objects within the specified envelope that are of the specified type and only the specified type. Subclasses are excluded.- Parameters:
envelope
- the bounding envelopetype
- the type of objects to return- Returns:
- an iterable over all the objects within the specified location.
-
queryInexact
<X> Iterable<X> queryInexact(org.locationtech.jts.geom.Envelope envelope, Class<X> type)
Queries this geography for objects that MAY intersect the the specified envelope and are of the specified type and only the specified type. Subclasses are excluded.This provides a first level filter for range rectangle queries. A second level filter SHOULD be applied to test for exact intersection.- Parameters:
envelope
- the envelope to query fortype
- the type of objects to return- Returns:
- an iterable over items whose extents MAY intersect the given search envelope.
-
getAllObjects
Iterable<T> getAllObjects()
Gets all the objects that are in this geography.- Returns:
- an iterable over all the objects in this geography.
-
size
int size()
Gets the number of objects in the geography.- Returns:
- the number of objects in the geography
-
-