Package repast.simphony.space.gis
Class DefaultGeography<T>
java.lang.Object
repast.simphony.space.projection.DefaultProjection<T>
repast.simphony.space.gis.DefaultGeography<T>
- All Implemented Interfaces:
- Geography<T>,- Projection<T>
- Direct Known Subclasses:
- ContextGeography
Default implementation of Geography, a geographic GIS type space.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionFields inherited from class repast.simphony.space.projection.DefaultProjectionlisteners, name
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultGeography(String name) Creates a DefaultGeography with the specified name.DefaultGeography(String name, String crsCode) Creates a DefaultGeography with a specified name and coordindate reference system.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidAdds an object to this projection without giving it a location.voidaddCoverage(String name, org.geotools.coverage.grid.GridCoverage2D coverage) Adds the named GridCoverage2Dbooleanevaluate(ProjectionPredicate predicate) Evaluate this Projection against the specified Predicate.booleanevaluateWithin(Within within) Evaluates the Geography against this predicate comparing whether two objects are within a specified distance of each other.getAdder()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.GridCoverage2DgetCoverage(String name) Gets the named coverage layerorg.opengis.referencing.crs.CoordinateReferenceSystemgetCRS()Gets the current coordinate reference system for this geometry.org.locationtech.jts.geom.GeometrygetGeometry(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.voidMoves the specified object to the specified location.org.locationtech.jts.geom.GeometrymoveByDisplacement(T object, double lonShift, double latShift) Displaces the specified object by the specified lon and lat amount.org.locationtech.jts.geom.GeometrymoveByVector(T object, double distance, double angleInRadians) Moves the specified object the specified distance along the specified angle.org.locationtech.jts.geom.GeometrymoveByVector(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.protected voidvoidremoveCoverage(String name) voidSets the current GISAdder that determines how objects are added to the geometry when added to the containing context.voidSets the coordinate reference system for this Geometry.voidsetCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs) Sets the coordinate reference system for this Geometry.intsize()Gets the number of objects in the geography.Methods inherited from class repast.simphony.space.projection.DefaultProjectionaddProjectionListener, fireProjectionEvent, getName, getProjectionListeners, removeProjectionListenerMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface repast.simphony.space.projection.ProjectionaddProjectionListener, getName, getProjectionListeners, removeProjectionListener
- 
Field Details- 
coverageMap
- 
adder
 
- 
- 
Constructor Details- 
DefaultGeographyCreates a DefaultGeography with the specified name. The coordinate reference system defaults to WGS84. That CRS uses (longitude, latitude) coordinates with longitude values increasing East and latitude values increasing North. Angular units are degrees and prime meridian is Greenwich..- Parameters:
- name- the name of the geography
 
- 
DefaultGeographyCreates a DefaultGeography with a specified name and coordindate reference system.- Parameters:
- name- the name of the geography
- crsCode- the coordinate reference system code (e.g. "EPSG:4326")
 
 
- 
- 
Method Details- 
getLayerNamesGets the names of the layers in this geography. There will be one layer for each type (by Java class) in a geography.- Specified by:
- getLayerNamesin interface- Geography<T>
- Returns:
- the names of the layers in this geography.
 
- 
addAdds an object to this projection without giving it a location.- Parameters:
- object- the object to add
 
- 
moveMoves 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.
- 
getLayerGets the layer for the specified type.
- 
getLayerGets the named layer.
- 
getGeometryGets the geometric location of the specified object.- Specified by:
- getGeometryin interface- Geography<T>
- Parameters:
- object- the object
- Returns:
- the geometric location of the specified object.
 
- 
getObjectsWithinGets an iterable over all the objects within the specified envelope.- Specified by:
- getObjectsWithinin interface- Geography<T>
- Parameters:
- envelope- the bounding envelope
- Returns:
- an iterable over all the objects within the specified location.
 
- 
queryInexactQueries 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.- Specified by:
- queryInexactin interface- Geography<T>
- Parameters:
- envelope- the envelope to query for
- Returns:
- an iterable over items whose extents MAY intersect the given search envelope.
 
- 
getObjectsWithinGets an iterable over all the objects within the specified envelope that are of the specified type and only the specified type. Subclasses are excluded.- Specified by:
- getObjectsWithinin interface- Geography<T>
- Parameters:
- envelope- the bounding envelope
- type- the type of objects to return
- Returns:
- an iterable over all the objects within the specified location.
 
- 
queryInexactQueries 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.- Specified by:
- queryInexactin interface- Geography<T>
- Parameters:
- envelope- the envelope to query for
- type- the type of objects to return
- Returns:
- an iterable over items whose extents MAY intersect the given search envelope.
 
- 
getAllObjectsGets all the objects that are in this geography.- Specified by:
- getAllObjectsin interface- Geography<T>
- Returns:
- an iterable over all the objects in this geography.
 
- 
sizepublic int size()Gets the number of objects in the geography.
- 
setCRSSets the coordinate reference system for this Geometry. For example, "EPSG:4326". All the locations of the objects in this Geometry will be appropriately transformed.
- 
setCRSpublic 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.
- 
moveByVectorpublic org.locationtech.jts.geom.Geometry moveByVector(T object, double distance, double angleInRadians) Moves the specified object the specified distance along the specified angle.- Specified by:
- moveByVectorin interface- Geography<T>
- Parameters:
- object- the object to move
- distance- the distance to move in meters
- angleInRadians- the angle along which to move. This USES standard mathematical axes where 90 degrees points "north".
- Returns:
- the geometric location the object was moved to
 
- 
moveByVectorpublic 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.- Specified by:
- moveByVectorin interface- Geography<T>
- Parameters:
- object- the object to move
- distance- the distance to move
- unit- the distance units. This must be convertable to meters
- angleInRadians- the angle along which to move
- Returns:
- the geometric location the object was moved to
 
- 
moveByDisplacementpublic org.locationtech.jts.geom.Geometry moveByDisplacement(T object, double lonShift, double latShift) Displaces the specified object by the specified lon and lat amount.- Specified by:
- moveByDisplacementin interface- Geography<T>
- Parameters:
- object- the object to move
- lonShift- the amount to move longitudinaly
- latShift- the amount to move latitudinaly
- Returns:
- the new geometry of the object
 
- 
getCRSpublic org.opengis.referencing.crs.CoordinateReferenceSystem getCRS()Gets the current coordinate reference system for this geometry.
- 
remove
- 
getAdderGets the current GISAdder that determines how objects are added to the geometry when added to the containing context.
- 
setAdderSets the current GISAdder that determines how objects are added to the geometry when added to the containing context.
- 
getUnitspublic javax.measure.Unit<?> getUnits(int axis) Gets the coordinate reference system's axis units.
- 
evaluateEvaluate this Projection against the specified Predicate. DefaultGeography provides doesn't call predicate.evaluate() but rather checks the predicate type and evaluates appropriately here. This is because the Geography interface is not available to repast.simphony.space.projection.ProjectionPredicate.- Specified by:
- evaluatein interface- Projection<T>
- Overrides:
- evaluatein class- DefaultProjection<T>
- Parameters:
- predicate-
- Returns:
- true if the predicate evaluates to true, otherwise false. False can also mean that the predicate is not applicable to this Projection. For example, a linked type predicate evaluated against a grid projection.
 
- 
evaluateWithinEvaluates the Geography against this predicate comparing whether two objects are within a specified distance of each other. The distance is orthodromic and in meters. Note that for Polygons the distance is measured from the center and not from the nearest point.- Parameters:
- geography- the geography to evaluate against.
- Returns:
- true if this predicate is true for the specified projection otherwise false.
 
- 
getCoverageDescription copied from interface:GeographyGets the named coverage layer- Specified by:
- getCoveragein interface- Geography<T>
- Parameters:
- name- the layer name
- Returns:
- the named coverage
 
- 
addCoverageDescription copied from interface:GeographyAdds the named GridCoverage2D- Specified by:
- addCoveragein interface- Geography<T>
 
- 
removeCoverage- Specified by:
- removeCoveragein interface- Geography<T>
 
- 
getCoverageNames- Specified by:
- getCoverageNamesin interface- Geography<T>
 
 
-