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
Space that locates objects in a geographic gis-type space.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCoverage
(String name, org.geotools.coverage.grid.GridCoverage2D coverage) Adds the named GridCoverage2DgetAdder()
Gets the current GISAdder that determines how objects are added to the geometry when added to the containing context.Gets all the objects that are in this geography.org.geotools.coverage.grid.GridCoverage2D
getCoverage
(String name) Gets the named coverage layerorg.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.Gets the layer for the specified type.Gets the named layer.Gets the names of the layers in this geography.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
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.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
Sets the current GISAdder that determines how objects are added to the geometry when added to the containing context.void
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 Details
-
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
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
Gets the layer for the specified type.- Parameters:
clazz
- the type associated with the desired layer- Returns:
- the layer for the specified type.
-
getLayer
Gets the named layer.- Parameters:
name
- the layer name- Returns:
- the named Layer.
-
getCoverage
Gets the named coverage layer- Parameters:
name
- the layer name- Returns:
- the named coverage
-
removeCoverage
-
getCoverageNames
Collection<String> getCoverageNames() -
addCoverage
Adds the named GridCoverage2D- Parameters:
name
-coverage
-
-
getGeometry
Gets the geometric location of the specified object.- Parameters:
object
- the object- Returns:
- the geometric location of the specified object.
-
getObjectsWithin
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
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
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
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
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
Gets the current GISAdder that determines how objects are added to the geometry when added to the containing context.- Returns:
- the current GISAdder
-
setAdder
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
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
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
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
-