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,TLcyGridReference
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
ConstructorsConstructorDescriptionDefault 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.booleanChecks on all parameters, except for the name.This method returns the bounds of the grid system.intReturns the type of coordinates used with thisILcdGeoReference:CARTESIANorGEODETIC.doubleReturns the cosine of the rotation of thisILcdGridReference.doubleReturns the false easting of thisILcdGridReference.doubleReturns the false northing of thisILcdGridReference.Returns theILcdProjectionof thisILcdGridReference.doubleReturns the rotation of thisILcdGridReferencein radians, clockwise.doublegetScale()Returns the scale of thisILcdGridReference.doubleReturns the sine of the rotation of thisILcdGridReference.doubleReturns the unitOfMeasure of thisILcdGridReferencew.r.t. to meters.inthashCode()booleanReturns if thisILcdXYWorldReferencehas bounds available.voidloadProperties(String aPrefix, Properties aProperties) This method will, givenaPrefix, analyze thePropertiesobjectaPropertiesto set the properties of thisTLcdGridReference.Creates a model point that is compatible with this model reference.voidsetFalseEasting(double aFalseEasting) Sets thefalseEastingof theTLcdGridReferencetoaFalseEasting.voidsetFalseNorthing(double aFalseNorthing) Sets thefalseNorthingof theTLcdGridReferencetoaFalseNorthing.voidsetProjection(ILcdProjection aProjection) Sets theILcdProjectionof theTLcdGridReferencetoaProjection.voidsetRotation(double aRotation) Sets the rotation of thisILcdGridReferencein radians, clockwise.voidsetScale(double aScale) Sets thescaleof theTLcdGridReferencetoaScale.voidsetUnitOfMeasure(double aUnitOfMeasure) Sets the UnitOfMeasure of theTLcdGridReferencetoaUnitOfMeasure.toString()Returns the name of this grid reference if it is defined, calls super.toString otherwise.voidwritePropertiesSFCT(String aPrefix, Properties aPropertiesSFCT) Stores the properties that define this model reference into the specifiedPropertiesobject as a side effect.Methods inherited from class com.luciad.reference.ALcdGeoReference
getGeodeticDatum, getModelReferenceMetadata, getName, setGeodeticDatum, setModelReferenceMetadata, setNameMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:ILcdGeoReferenceReturns the type of coordinates used with thisILcdGeoReference:CARTESIANorGEODETIC.- Specified by:
getCoordinateTypein interfaceILcdGeoReference- Returns:
- the type of coordinates used with this
ILcdGeoReference:CARTESIANorGEODETIC.
-
getProjection
Description copied from interface:ILcdGridReferenceReturns theILcdProjectionof thisILcdGridReference.- Specified by:
getProjectionin interfaceILcdGridReference- Returns:
- the
ILcdProjectionof thisILcdGridReference. - See Also:
-
setProjection
Sets theILcdProjectionof theTLcdGridReferencetoaProjection.- Parameters:
aProjection- the new projection value for this reference.- See Also:
-
getFalseEasting
public double getFalseEasting()Description copied from interface:ILcdGridReferenceReturns the false easting of thisILcdGridReference. It is defined in the unit of the grid system.- Specified by:
getFalseEastingin 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 thefalseEastingof theTLcdGridReferencetoaFalseEasting.- 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:ILcdGridReferenceReturns the false northing of thisILcdGridReference. It is defined in the unit of the grid system.- Specified by:
getFalseNorthingin 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 thefalseNorthingof theTLcdGridReferencetoaFalseNorthing.- 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:ILcdGridReferenceReturns the scale of thisILcdGridReference.- Specified by:
getScalein interfaceILcdGridReference- Returns:
- the scale of this
ILcdGridReference. - See Also:
-
setScale
public void setScale(double aScale) Sets thescaleof theTLcdGridReferencetoaScale.- Parameters:
aScale- the new scale value for this reference.- See Also:
-
getRotation
public double getRotation()Returns the rotation of thisILcdGridReferencein radians, clockwise. The center of the rotation is the origin of the map projection.- Specified by:
getRotationin interfaceILcdGridReference- Returns:
- the rotation of this
ILcdGridReferencein radians.
-
setRotation
public void setRotation(double aRotation) Sets the rotation of thisILcdGridReferencein 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:ILcdGridReferenceReturns the cosine of the rotation of thisILcdGridReference.- Specified by:
getCosRotationin interfaceILcdGridReference- Returns:
- the cosine of the rotation of this
ILcdGridReference. - See Also:
-
getSinRotation
public double getSinRotation()Description copied from interface:ILcdGridReferenceReturns the sine of the rotation of thisILcdGridReference.- Specified by:
getSinRotationin interfaceILcdGridReference- Returns:
- the sine of the rotation of this
ILcdGridReference. - See Also:
-
makeModelPoint
Description copied from interface:ILcdModelReferenceCreates 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:
makeModelPointin interfaceILcdModelReference- Returns:
- a point that is compatible with this model reference.
-
loadProperties
This method will, givenaPrefix, analyze thePropertiesobjectaPropertiesto 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
aPropertiesshould 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:
loadPropertiesin 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:ILcdModelReferenceStores the properties that define this model reference into the specifiedPropertiesobject as a side effect. Each particular implementation of this interface can define which properties it stores.- Specified by:
writePropertiesSFCTin 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:ILcdGridReferenceReturns the unitOfMeasure of thisILcdGridReferencew.r.t. to meters. So, if the unit of the grid reference would be millimeters, this becomes 0.001.- Specified by:
getUnitOfMeasurein interfaceILcdGridReference- Returns:
- the unitOfMeasure of this
ILcdGridReferencew.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 theTLcdGridReferencetoaUnitOfMeasure.- Parameters:
aUnitOfMeasure- the new unitOfMeasure of thisILcdGridReferencew.r.t. meters.- See Also:
-
isBoundsAvailable
public boolean isBoundsAvailable()Description copied from interface:ILcdXYWorldReferenceReturns if thisILcdXYWorldReferencehas bounds available.- Specified by:
isBoundsAvailablein interfaceILcdXYWorldReference- Returns:
trueif 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:
get2DEditableBoundsin interfaceILcdXYWorldReference- Returns:
- if
isBoundsAvailable(), aILcd2DEditableBoundsthat 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:
equalsin 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:
hashCodein classALcdGeoReference
-
clone
Makes a deep clone of this grid reference.- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classALcdGeoReference- See Also:
-
toString
Returns the name of this grid reference if it is defined, calls super.toString otherwise.
-