Class TLcdGridReference

java.lang.Object
com.luciad.reference.ALcdGeoReference
com.luciad.reference.TLcdGridReference
All Implemented Interfaces:
ILcdExtendedModelReference, ILcdModelReference, ILcdGeoReference, ILcdGridReference, ILcdCloneable, ILcdXYWorldReference, ILcdXYZWorldReference, Serializable, Cloneable
Direct Known Subclasses:
TLcdDHDNGermanGridReference, TLcdLambert1972BelgiumGridReference, TLcdLambertFrenchGridReference, TLcdRD1918DutchGridReference, TLcdSwissGridReference, TLcdUPSGrid, TLcdUTMGrid, TLcyGridReference

public class TLcdGridReference extends ALcdGeoReference implements ILcdGridReference, ILcdXYWorldReference, ILcdXYZWorldReference
A TLcdGridReference is an implementation of an ILcdGridReference.
See Also:
  • Constructor Details

    • TLcdGridReference

      public TLcdGridReference()
      Default constructor. The parameters specific for the grid reference are set to the values described for the constructor with a geodetic datum and a projection.
      At least the geodetic datum and the projection have to set before using this grid reference.
    • TLcdGridReference

      public TLcdGridReference(ILcdGeodeticDatum aGeodeticDatum, ILcdProjection aProjection)
      Constructor taking geodetic datum and projection as arguments. It constructs a grid reference that is equal to our projection reference. The false easting and northing parameters are set to 0.0. The scale and the unit of measure parameters are set to 1.0. The rotation is set to 0.0.
      Parameters:
      aGeodeticDatum - the geodetic datum for this reference.
      aProjection - the projection for this reference.
    • TLcdGridReference

      public TLcdGridReference(ILcdGeodeticDatum aGeodeticDatum, ILcdProjection aProjection, double aFalseEasting, double aFalseNorthing, double aScale, double aUnitOfMeasure, double aRotation)
      Constructor with all possible properties as arguments.
      Parameters:
      aGeodeticDatum - the geodetic datum for this reference.
      aProjection - the projection for this reference.
      aFalseEasting - the false easting (defined in the unitOfMeasure).
      aFalseNorthing - the false northing (defined in the unitOfMeasure).
      aScale - a scale factor applied after the projection.
      aUnitOfMeasure - the unit of measure of this grid reference.
      aRotation - the rotation value for this reference (RADIANs!).
    • TLcdGridReference

      public TLcdGridReference(ILcdGridReference aGridReference)
      Copy constructor. Makes a shallow clone.
      Parameters:
      aGridReference - the grid reference to be cloned.
  • Method Details

    • getCoordinateType

      public int getCoordinateType()
      Description copied from interface: ILcdGeoReference
      Returns the type of coordinates used with this ILcdGeoReference: CARTESIAN or GEODETIC.
      Specified by:
      getCoordinateType in interface ILcdGeoReference
      Returns:
      the type of coordinates used with this ILcdGeoReference: CARTESIAN or GEODETIC.
    • getProjection

      public ILcdProjection getProjection()
      Description copied from interface: ILcdGridReference
      Returns the ILcdProjection of this ILcdGridReference.
      Specified by:
      getProjection in interface ILcdGridReference
      Returns:
      the ILcdProjection of this ILcdGridReference.
      See Also:
    • setProjection

      public void setProjection(ILcdProjection aProjection)
      Sets the ILcdProjection of the TLcdGridReference to aProjection.
      Parameters:
      aProjection - the new projection value for this reference.
      See Also:
    • getFalseEasting

      public double getFalseEasting()
      Description copied from interface: ILcdGridReference
      Returns the false easting of this ILcdGridReference. It is defined in the unit of the grid system.
      Specified by:
      getFalseEasting in interface ILcdGridReference
      Returns:
      the false easting of this ILcdGridReference. It is defined in the unit of the grid system.
      See Also:
    • setFalseEasting

      public void setFalseEasting(double aFalseEasting)
      Sets the falseEasting of the TLcdGridReference to aFalseEasting.
      Parameters:
      aFalseEasting - the new false easting value for this reference (defined in the unit of measure of this reference).
      See Also:
    • getFalseNorthing

      public double getFalseNorthing()
      Description copied from interface: ILcdGridReference
      Returns the false northing of this ILcdGridReference. It is defined in the unit of the grid system.
      Specified by:
      getFalseNorthing in interface ILcdGridReference
      Returns:
      the false northing of this ILcdGridReference. It is defined in the unit of the grid system.
      See Also:
    • setFalseNorthing

      public void setFalseNorthing(double aFalseNorthing)
      Sets the falseNorthing of the TLcdGridReference to aFalseNorthing.
      Parameters:
      aFalseNorthing - the new false northing value for this reference (defined in the unit of measure of this reference).
      See Also:
    • getScale

      public double getScale()
      Description copied from interface: ILcdGridReference
      Returns the scale of this ILcdGridReference.
      Specified by:
      getScale in interface ILcdGridReference
      Returns:
      the scale of this ILcdGridReference.
      See Also:
    • setScale

      public void setScale(double aScale)
      Sets the scale of the TLcdGridReference to aScale.
      Parameters:
      aScale - the new scale value for this reference.
      See Also:
    • getRotation

      public double getRotation()
      Returns the rotation of this ILcdGridReference in radians, clockwise. The center of the rotation is the origin of the map projection.
      Specified by:
      getRotation in interface ILcdGridReference
      Returns:
      the rotation of this ILcdGridReference in radians.
    • setRotation

      public void setRotation(double aRotation)
      Sets the rotation of this ILcdGridReference in radians, clockwise. The center of the rotation is the origin of the map projection.
      Parameters:
      aRotation - the new rotation value for this reference.
      See Also:
    • getCosRotation

      public double getCosRotation()
      Description copied from interface: ILcdGridReference
      Returns the cosine of the rotation of this ILcdGridReference.
      Specified by:
      getCosRotation in interface ILcdGridReference
      Returns:
      the cosine of the rotation of this ILcdGridReference.
      See Also:
    • getSinRotation

      public double getSinRotation()
      Description copied from interface: ILcdGridReference
      Returns the sine of the rotation of this ILcdGridReference.
      Specified by:
      getSinRotation in interface ILcdGridReference
      Returns:
      the sine of the rotation of this ILcdGridReference.
      See Also:
    • makeModelPoint

      public ILcdPoint makeModelPoint()
      Description copied from interface: ILcdModelReference
      Creates a model point that is compatible with this model reference. It is unspecified how (which coordinates) the point is initialized. Users should initialize the point correctly before inserting it into a model.
      Specified by:
      makeModelPoint in interface ILcdModelReference
      Returns:
      a point that is compatible with this model reference.
    • loadProperties

      public void loadProperties(String aPrefix, Properties aProperties) throws IllegalArgumentException
      This method will, given aPrefix, analyze the Properties object aProperties to set the properties of this TLcdGridReference. The values of following keys are retrieved:
      • <aPrefix>.TLcdGridReference.scale
      • <aPrefix>.TLcdGridReference.falseNorthing
      • <aPrefix>.TLcdGridReference.falseEasting
      • <aPrefix>.TLcdGridReference.unitOfMeasure
      • <aPrefix>.TLcdGridReference.rotation
      To be able to set the property projection aProperties should contain entries which will be analyzed by the TLcdProjectionFactory. The keys of those entries should begin with '<aPrefix>TLcdGridReference.projection.'.

      To be able to set the property geodeticDatum the aProperties should contain entries which will be analyzed by the TLcdGeodeticDatumFactory. The keys of those entries should begin with '<aPrefix>.TLcdGridReference.geodeticDatum.'. The properties object is also passed to the TLcdModelReferenceMetadata.loadProperties(java.lang.String, java.util.Properties) with the prefix "<aPrefix>.TLcdGridReference."

      Specified by:
      loadProperties in interface ILcdModelReference
      Parameters:
      aPrefix - a common prefix for all property names that are read.
      aProperties - the properties to be parsed.
      Throws:
      IllegalArgumentException - if the model reference cannot be constructed from the properties.
      See Also:
    • writePropertiesSFCT

      public void writePropertiesSFCT(String aPrefix, Properties aPropertiesSFCT) throws IllegalArgumentException
      Description copied from interface: ILcdModelReference
      Stores the properties that define this model reference into the specified Properties object as a side effect. Each particular implementation of this interface can define which properties it stores.
      Specified by:
      writePropertiesSFCT in interface ILcdModelReference
      Parameters:
      aPrefix - a common prefix for all property names written.
      aPropertiesSFCT - the properties that will contain the serialized properties for this model reference, as a side effect.
      Throws:
      IllegalArgumentException - if the model reference cannot be serialized into properties.
      See Also:
    • getUnitOfMeasure

      public double getUnitOfMeasure()
      Description copied from interface: ILcdGridReference
      Returns the unitOfMeasure of this ILcdGridReference w.r.t. to meters. So, if the unit of the grid reference would be millimeters, this becomes 0.001.
      Specified by:
      getUnitOfMeasure in interface ILcdGridReference
      Returns:
      the unitOfMeasure of this ILcdGridReference w.r.t. meters. So, if the unit of the grid reference would be millimeters, this becomes 0.001.
    • setUnitOfMeasure

      public void setUnitOfMeasure(double aUnitOfMeasure)
      Sets the UnitOfMeasure of the TLcdGridReference to aUnitOfMeasure.
      Parameters:
      aUnitOfMeasure - the new unitOfMeasure of this ILcdGridReference w.r.t. meters.
      See Also:
    • isBoundsAvailable

      public boolean isBoundsAvailable()
      Description copied from interface: ILcdXYWorldReference
      Returns if this ILcdXYWorldReference has bounds available.
      Specified by:
      isBoundsAvailable in interface ILcdXYWorldReference
      Returns:
      true if a 2DEditable bounds is available, false otherwise.
      See Also:
    • get2DEditableBounds

      public ILcd2DEditableBounds get2DEditableBounds()
      This method returns the bounds of the grid system. They are in principle the bounds of the projection on which the grid system is based but after applying the scaling, false origin, and rotation parameters.
      Specified by:
      get2DEditableBounds in interface ILcdXYWorldReference
      Returns:
      if isBoundsAvailable(), a ILcd2DEditableBounds that contains all the 2D shapes of all the objects in world coordinates using the given ILcdXYWorldReference. Returns only a valid value if isBoundsAvailable() is true;.
    • equals

      public boolean equals(Object aObject)
      Checks on all parameters, except for the name.
      Overrides:
      equals in class ALcdGeoReference
      Parameters:
      aObject - the object to check for equality.
      Returns:
      true if all parameters except the name of the grid reference are equal, false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ALcdGeoReference
    • clone

      public Object clone()
      Makes a deep clone of this grid reference.
      Specified by:
      clone in interface ILcdCloneable
      Overrides:
      clone in class ALcdGeoReference
      See Also:
    • toString

      public String toString()
      Returns the name of this grid reference if it is defined, calls super.toString otherwise.
      Overrides:
      toString in class Object
      Returns:
      the name of this grid reference if it is defined.