Class SimpleLocation.Projected
java.lang.Object
org.apache.sis.referencing.gazetteer.AbstractLocation
org.apache.sis.referencing.gazetteer.SimpleLocation
org.apache.sis.referencing.gazetteer.SimpleLocation.Projected
- All Implemented Interfaces:
org.opengis.geometry.coordinate.Position
,org.opengis.geometry.DirectPosition
,org.opengis.geometry.Envelope
,org.opengis.metadata.extent.GeographicBoundingBox
,org.opengis.metadata.extent.GeographicExtent
- Direct Known Subclasses:
MilitaryGridReferenceSystem.Decoder
- Enclosing class:
- SimpleLocation
abstract static class SimpleLocation.Projected
extends SimpleLocation
implements org.opengis.metadata.extent.GeographicBoundingBox
A
SimpleLocation
for non-geographic CRS.
Subclasses should invoke computeGeographicBoundingBox(MathTransform)
after the
SimpleLocation.minX
, SimpleLocation.minY
, SimpleLocation.maxX
and SimpleLocation.maxY
fields have been set.- Since:
- 0.8
- Version:
- 0.8
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.gazetteer.SimpleLocation
SimpleLocation.Projected
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
The eastern-most coordinate of the limit of the dataset extent.protected double
The northern-most, coordinate of the limit of the dataset extent.protected double
The southern-most coordinate of the limit of the dataset extent.protected double
The western-most coordinate of the limit of the dataset extent.Fields inherited from class org.apache.sis.referencing.gazetteer.SimpleLocation
maxX, maxY, minX, minY
-
Constructor Summary
ConstructorsConstructorDescriptionProjected
(AbstractLocationType type, CharSequence identifier) Creates a new location for the given geographic identifier. -
Method Summary
Modifier and TypeMethodDescription(package private) final boolean
clipGeographicBoundingBox
(double λmin, double φmin, double λmax, double φmax) Clips the geographic bounding box to the given area.(package private) final void
clipProjectedEnvelope
(org.opengis.referencing.operation.MathTransform forward, double tx, double ty) Projects the geographic bounding box and clips the current envelope to the result of that projection.(package private) final void
computeGeographicBoundingBox
(org.opengis.referencing.operation.MathTransform inverse) Computes the geographic bounding box from the current values ofSimpleLocation.minX
,SimpleLocation.minY
,SimpleLocation.maxX
andSimpleLocation.maxY
fields.final double
Returns the eastern-most coordinate of the limit of the dataset extent.final double
Returns the northern-most, coordinate of the limit of the dataset extent.final double
Returns the southern-most coordinate of the limit of the dataset extent.final double
Returns the western-most coordinate of the limit of the dataset extent.Methods inherited from class org.apache.sis.referencing.gazetteer.SimpleLocation
convert, getCoordinate, getCoordinateReferenceSystem, getDimension, getDirectPosition, getEnvelope, getGeographicExtent, getInclusion, getLowerCorner, getMaximum, getMedian, getMinimum, getOrdinate, getPosition, getSpan, getUpperCorner, setOrdinate
Methods inherited from class org.apache.sis.referencing.gazetteer.AbstractLocation
getAdministrator, getAlternativeGeographicIdentifiers, getChildren, getGeographicIdentifier, getLocationType, getParents, getTemporalExtent, setTypeToChild, toString, type
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.geometry.DirectPosition
equals, hashCode
Methods inherited from interface org.opengis.metadata.extent.GeographicExtent
getInclusion
-
Field Details
-
westBoundLongitude
protected double westBoundLongitudeThe western-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east). -
eastBoundLongitude
protected double eastBoundLongitudeThe eastern-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east). -
southBoundLatitude
protected double southBoundLatitudeThe southern-most coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north). -
northBoundLatitude
protected double northBoundLatitudeThe northern-most, coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north).
-
-
Constructor Details
-
Projected
Projected(AbstractLocationType type, CharSequence identifier) Creates a new location for the given geographic identifier. This constructor acceptsnull
arguments, but this is not recommended.- Parameters:
type
- the description of the nature of this geographic identifier.identifier
- the geographic identifier to be returned byAbstractLocation.getGeographicIdentifier()
.
-
-
Method Details
-
getWestBoundLongitude
public final double getWestBoundLongitude()Returns the western-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east).- Specified by:
getWestBoundLongitude
in interfaceorg.opengis.metadata.extent.GeographicBoundingBox
- Overrides:
getWestBoundLongitude
in classSimpleLocation
-
getEastBoundLongitude
public final double getEastBoundLongitude()Returns the eastern-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east).- Specified by:
getEastBoundLongitude
in interfaceorg.opengis.metadata.extent.GeographicBoundingBox
- Overrides:
getEastBoundLongitude
in classSimpleLocation
-
getSouthBoundLatitude
public final double getSouthBoundLatitude()Returns the southern-most coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north).- Specified by:
getSouthBoundLatitude
in interfaceorg.opengis.metadata.extent.GeographicBoundingBox
- Overrides:
getSouthBoundLatitude
in classSimpleLocation
-
getNorthBoundLatitude
public final double getNorthBoundLatitude()Returns the northern-most, coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north).- Specified by:
getNorthBoundLatitude
in interfaceorg.opengis.metadata.extent.GeographicBoundingBox
- Overrides:
getNorthBoundLatitude
in classSimpleLocation
-
computeGeographicBoundingBox
final void computeGeographicBoundingBox(org.opengis.referencing.operation.MathTransform inverse) throws org.opengis.referencing.operation.TransformException Computes the geographic bounding box from the current values ofSimpleLocation.minX
,SimpleLocation.minY
,SimpleLocation.maxX
andSimpleLocation.maxY
fields. This method performs a work similar to theEnvelopes.transform(…)
methods but using a much simpler (and faster) algorithm: this method projects only the 4 corners, without any check for the number of dimensions, projection of median coordinates, use of projection derivatives for locating the envelope extremum or special checks for polar cases. This method is okay only when the current envelope is the envelope of a cell of a grid that divide the projection area in a very regular way (for example with the guarantee that the projection central meridian will never be in the middle of grid cell, etc).If a geographic bounding box was already defined before invoking this method, then it will be expanded (if needed) for encompassing the bounding box computed by this method.
- Parameters:
inverse
- the transform from projected coordinates to geographic coordinates.- Throws:
org.opengis.referencing.operation.TransformException
- if a coordinate operation failed.- See Also:
-
clipGeographicBoundingBox
final boolean clipGeographicBoundingBox(double λmin, double φmin, double λmax, double φmax) Clips the geographic bounding box to the given area. If the bounding box changed as a result of this method call, then caller should consider invokingclipProjectedEnvelope(MathTransform, double, double)
.- Returns:
- whether the geographic bounding box changed as a result of this method call.
-
clipProjectedEnvelope
final void clipProjectedEnvelope(org.opengis.referencing.operation.MathTransform forward, double tx, double ty) throws org.opengis.referencing.operation.TransformException Projects the geographic bounding box and clips the current envelope to the result of that projection. This method should be invoked whenclipGeographicBoundingBox(double, double, double, double)
returnedtrue
.- Parameters:
forward
- the transform from geographic coordinates to projected coordinates.tx
- tolerance threshold in easting values for changingSimpleLocation.minX
orSimpleLocation.maxX
.ty
- tolerance threshold in northing values for changingSimpleLocation.minY
orSimpleLocation.maxY
.- Throws:
org.opengis.referencing.operation.TransformException
- if a coordinate operation failed.
-