Class 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
  • Field Details

    • westBoundLongitude

      protected double westBoundLongitude
      The western-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east).
    • eastBoundLongitude

      protected double eastBoundLongitude
      The eastern-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east).
    • southBoundLatitude

      protected double southBoundLatitude
      The southern-most coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north).
    • northBoundLatitude

      protected double northBoundLatitude
      The 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 accepts null arguments, but this is not recommended.
      Parameters:
      type - the description of the nature of this geographic identifier.
      identifier - the geographic identifier to be returned by AbstractLocation.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 interface org.opengis.metadata.extent.GeographicBoundingBox
      Overrides:
      getWestBoundLongitude in class SimpleLocation
    • 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 interface org.opengis.metadata.extent.GeographicBoundingBox
      Overrides:
      getEastBoundLongitude in class SimpleLocation
    • 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 interface org.opengis.metadata.extent.GeographicBoundingBox
      Overrides:
      getSouthBoundLatitude in class SimpleLocation
    • 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 interface org.opengis.metadata.extent.GeographicBoundingBox
      Overrides:
      getNorthBoundLatitude in class SimpleLocation
    • 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 of SimpleLocation.minX, SimpleLocation.minY, SimpleLocation.maxX and SimpleLocation.maxY fields. This method performs a work similar to the Envelopes.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 invoking clipProjectedEnvelope(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 when clipGeographicBoundingBox(double, double, double, double) returned true.
      Parameters:
      forward - the transform from geographic coordinates to projected coordinates.
      tx - tolerance threshold in easting values for changing SimpleLocation.minX or SimpleLocation.maxX.
      ty - tolerance threshold in northing values for changing SimpleLocation.minY or SimpleLocation.maxY.
      Throws:
      org.opengis.referencing.operation.TransformException - if a coordinate operation failed.