Package com.luciad.reference
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
public class TLcdGridReference
extends ALcdGeoReference
implements ILcdGridReference, ILcdXYWorldReference, ILcdXYZWorldReference
A
TLcdGridReference
is an implementation of an
ILcdGridReference
.- See Also:
-
Field Summary
Fields inherited from interface com.luciad.reference.ILcdGeoReference
CARTESIAN, GEODETIC
-
Constructor Summary
ConstructorDescriptionDefault constructor.TLcdGridReference
(ILcdGeodeticDatum aGeodeticDatum, ILcdProjection aProjection) Constructor taking geodetic datum and projection as arguments.TLcdGridReference
(ILcdGeodeticDatum aGeodeticDatum, ILcdProjection aProjection, double aFalseEasting, double aFalseNorthing, double aScale, double aUnitOfMeasure, double aRotation) Constructor with all possible properties as arguments.TLcdGridReference
(ILcdGridReference aGridReference) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Makes a deep clone of this grid reference.boolean
Checks on all parameters, except for the name.This method returns the bounds of the grid system.int
Returns the type of coordinates used with thisILcdGeoReference
:CARTESIAN
orGEODETIC
.double
Returns the cosine of the rotation of thisILcdGridReference
.double
Returns the false easting of thisILcdGridReference
.double
Returns the false northing of thisILcdGridReference
.Returns theILcdProjection
of thisILcdGridReference
.double
Returns the rotation of thisILcdGridReference
in radians, clockwise.double
getScale()
Returns the scale of thisILcdGridReference
.double
Returns the sine of the rotation of thisILcdGridReference
.double
Returns the unitOfMeasure of thisILcdGridReference
w.r.t. to meters.int
hashCode()
boolean
Returns if thisILcdXYWorldReference
has bounds available.void
loadProperties
(String aPrefix, Properties aProperties) This method will, givenaPrefix
, analyze theProperties
objectaProperties
to set the properties of thisTLcdGridReference
.Creates a model point that is compatible with this model reference.void
setFalseEasting
(double aFalseEasting) Sets thefalseEasting
of theTLcdGridReference
toaFalseEasting
.void
setFalseNorthing
(double aFalseNorthing) Sets thefalseNorthing
of theTLcdGridReference
toaFalseNorthing
.void
setProjection
(ILcdProjection aProjection) Sets theILcdProjection
of theTLcdGridReference
toaProjection
.void
setRotation
(double aRotation) Sets the rotation of thisILcdGridReference
in radians, clockwise.void
setScale
(double aScale) Sets thescale
of theTLcdGridReference
toaScale
.void
setUnitOfMeasure
(double aUnitOfMeasure) Sets the UnitOfMeasure of theTLcdGridReference
toaUnitOfMeasure
.toString()
Returns the name of this grid reference if it is defined, calls super.toString otherwise.void
writePropertiesSFCT
(String aPrefix, Properties aPropertiesSFCT) Stores the properties that define this model reference into the specifiedProperties
object as a side effect.Methods inherited from class com.luciad.reference.ALcdGeoReference
getGeodeticDatum, getModelReferenceMetadata, getName, setGeodeticDatum, setModelReferenceMetadata, setName
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.luciad.reference.ILcdGeoReference
getGeodeticDatum
-
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
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
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 thisILcdGeoReference
:CARTESIAN
orGEODETIC
.- Specified by:
getCoordinateType
in interfaceILcdGeoReference
- Returns:
- the type of coordinates used with this
ILcdGeoReference
:CARTESIAN
orGEODETIC
.
-
getProjection
Description copied from interface:ILcdGridReference
Returns theILcdProjection
of thisILcdGridReference
.- Specified by:
getProjection
in interfaceILcdGridReference
- Returns:
- the
ILcdProjection
of thisILcdGridReference
. - See Also:
-
setProjection
Sets theILcdProjection
of theTLcdGridReference
toaProjection
.- 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 thisILcdGridReference
. It is defined in the unit of the grid system.- Specified by:
getFalseEasting
in interfaceILcdGridReference
- 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 thefalseEasting
of theTLcdGridReference
toaFalseEasting
.- 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 thisILcdGridReference
. It is defined in the unit of the grid system.- Specified by:
getFalseNorthing
in interfaceILcdGridReference
- 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 thefalseNorthing
of theTLcdGridReference
toaFalseNorthing
.- 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 thisILcdGridReference
.- Specified by:
getScale
in interfaceILcdGridReference
- Returns:
- the scale of this
ILcdGridReference
. - See Also:
-
setScale
public void setScale(double aScale) Sets thescale
of theTLcdGridReference
toaScale
.- Parameters:
aScale
- the new scale value for this reference.- See Also:
-
getRotation
public double getRotation()Returns the rotation of thisILcdGridReference
in radians, clockwise. The center of the rotation is the origin of the map projection.- Specified by:
getRotation
in interfaceILcdGridReference
- Returns:
- the rotation of this
ILcdGridReference
in radians.
-
setRotation
public void setRotation(double aRotation) Sets the rotation of thisILcdGridReference
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 thisILcdGridReference
.- Specified by:
getCosRotation
in interfaceILcdGridReference
- 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 thisILcdGridReference
.- Specified by:
getSinRotation
in interfaceILcdGridReference
- Returns:
- the sine of the rotation of this
ILcdGridReference
. - See Also:
-
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 interfaceILcdModelReference
- Returns:
- a point that is compatible with this model reference.
-
loadProperties
This method will, givenaPrefix
, analyze theProperties
objectaProperties
to set the properties of thisTLcdGridReference
. The values of following keys are retrieved:- <aPrefix>.TLcdGridReference.scale
- <aPrefix>.TLcdGridReference.falseNorthing
- <aPrefix>.TLcdGridReference.falseEasting
- <aPrefix>.TLcdGridReference.unitOfMeasure
- <aPrefix>.TLcdGridReference.rotation
aProperties
should contain entries which will be analyzed by theTLcdProjectionFactory
. 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 theTLcdModelReferenceMetadata.loadProperties(java.lang.String, java.util.Properties)
with the prefix"<aPrefix>.TLcdGridReference."
- Specified by:
loadProperties
in interfaceILcdModelReference
- 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 specifiedProperties
object as a side effect. Each particular implementation of this interface can define which properties it stores.- Specified by:
writePropertiesSFCT
in interfaceILcdModelReference
- 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 thisILcdGridReference
w.r.t. to meters. So, if the unit of the grid reference would be millimeters, this becomes 0.001.- Specified by:
getUnitOfMeasure
in interfaceILcdGridReference
- 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 theTLcdGridReference
toaUnitOfMeasure
.- Parameters:
aUnitOfMeasure
- the new unitOfMeasure of thisILcdGridReference
w.r.t. meters.- See Also:
-
isBoundsAvailable
public boolean isBoundsAvailable()Description copied from interface:ILcdXYWorldReference
Returns if thisILcdXYWorldReference
has bounds available.- Specified by:
isBoundsAvailable
in interfaceILcdXYWorldReference
- Returns:
true
if a 2DEditable bounds is available, false otherwise.- See Also:
-
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 interfaceILcdXYWorldReference
- Returns:
- if
isBoundsAvailable()
, aILcd2DEditableBounds
that contains all the 2D shapes of all the objects in world coordinates using the givenILcdXYWorldReference
. Returns only a valid value ifisBoundsAvailable()
istrue
;.
-
equals
Checks on all parameters, except for the name.- Overrides:
equals
in classALcdGeoReference
- 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 classALcdGeoReference
-
clone
Makes a deep clone of this grid reference.- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classALcdGeoReference
- See Also:
-
toString
Returns the name of this grid reference if it is defined, calls super.toString otherwise.
-