com.esri.sde.sdk.client
Class SeCoordinateReference

java.lang.Object
  extended by com.esri.sde.sdk.client.SeCoordinateReference
All Implemented Interfaces:
java.lang.Cloneable

public class SeCoordinateReference
extends java.lang.Object
implements java.lang.Cloneable

Represents the Coordinate Reference of a Geometry.

A coordinate system is either geographic (longitude,latitude) or projected (x,y) and locates spatial data on a 3-D spherical or 2-D planar surface. A coordinate reference includes the coordinate system and a set of offset (false origin) and scale values that convert floating point real-world values into integers for internal storage in the SDE layer.

This information is stored in a coordinate reference object. Each spatial column (layer) has a coordinate reference associated with it. Shapes inherit a coordinate reference from their spatial column. Shapes created by an application must have a coordinate reference object associated with them when they are created. The coordinate reference is maintained through client processes.


Constructor Summary
SeCoordinateReference()
          Creates a default coordinate reference object with all offsets set to zero and an xy scale factor of one.
 
Method Summary
 java.lang.Object clone()
          Clones the coordinate reference object.
 PeCoordinateSystem getCoordSys()
          Returns the coordinate system of this coordinate reference object.
 java.lang.String getCoordSysDescription()
          Returns the description of the coordinate system of a Coordinate Reference.
 double getFalseM()
          Returns the measure offset.
 double getFalseX()
          Returns the false origin's x offset value.
 double getFalseY()
          Returns the false origin's y offset value.
 double getFalseZ()
          Returns the false origin's z offset value.
 double getMaxMValue()
          Returns the maximum measure value.
 double getMaxZValue()
          Returns the maximum z-value.
 double getMinMValue()
          Returns the minimum measure value.
 double getMinZValue()
          Returns the minimum z-value.
 double getMUnits()
          Returns the m-offset's scale factor.
 int getPrecision()
          Returns the precision of this coordinate reference object.
 java.lang.String getProjectionDescription()
          Deprecated. at ArcSDE version 9.1
 SeObjectId getSrid()
          Returns the Spatial Reference Id of this Coordinate Reference.
 PeVertCS getVertCS()
          Returns the vertical coordinate system associated with the coordinate reference system.
 int getVertCSId()
          Returns the vertical coordinate system ID for the supplied coordinate reference object.
 SeExtent getXYEnvelope()
          Returns the the range of X/Y values for the coordinate reference object based upon the false origin/units values.
 double getXYUnits()
          Returns the xy scale factor
 double getZUnits()
          Returns the z-offset's scale factor.
 boolean isEqual(SeCoordinateReference cRefB)
          Compares two coordinate reference objects.
 void setCoordSysByDescription(java.lang.String desc)
          Sets the coordinate system for the coordinate reference object by a character string description.
 void setCoordSysByID(SeObjectId coordSysID)
          Sets the coordinate system for this coordinate reference object.
 void setM(double falseM, double mUnits)
          Sets the measures false origin and scale factor.
 void setMByRange(double minMVal, double maxMVal)
          Sets the minimum and maximum measure values.
 void setPrecision(int precision)
          Sets the precision of this coordinate reference.
 void setVertCS(PeVertCS vcs)
          Sets the vertical coordinate system of the given coordinate reference object.
 void setVertCSById(int vertCSId)
          Sets the vertical coordinate system for the supplied coordinate reference object.
 void setXY(double falseX, double falseY, double xyUnits)
          Sets the x,y false origin and scale factor.
 void setXYByEnvelope(SeExtent extent)
          Calculates and sets the x,y false origin and scale factor from the supplied envelope.
 void setZ(double falseZ, double zUnits)
          Sets the z false origin and scale factor.
 void setZByRange(double minZVal, double maxZVal)
          Sets the z false origin and scale factor from the given range.
 java.lang.String toString()
          Returns a string description of this coordinate reference object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SeCoordinateReference

public SeCoordinateReference()
Creates a default coordinate reference object with all offsets set to zero and an xy scale factor of one.

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the coordinate reference object.

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getCoordSys

public PeCoordinateSystem getCoordSys()
Returns the coordinate system of this coordinate reference object. The coordinate system is managed by the Projection Engine.


getVertCS

public PeVertCS getVertCS()
                   throws SeException
Returns the vertical coordinate system associated with the coordinate reference system. The vertical coordinate system is managed by the Projection Engine. If the given coordinate reference object does not have an active vertical coordinate system object associated with it, a null vertical coordinate system object will be returned.

Throws:
SeException

getProjectionDescription

public java.lang.String getProjectionDescription()
Deprecated. at ArcSDE version 9.1

Returns the String description of the coordinate reference.


getFalseM

public double getFalseM()
Returns the measure offset.


getMUnits

public double getMUnits()
Returns the m-offset's scale factor.


getMinMValue

public double getMinMValue()
Returns the minimum measure value.


getMaxMValue

public double getMaxMValue()
Returns the maximum measure value.


getSrid

public SeObjectId getSrid()
Returns the Spatial Reference Id of this Coordinate Reference.


getFalseX

public double getFalseX()
Returns the false origin's x offset value.


getFalseY

public double getFalseY()
Returns the false origin's y offset value.


getXYUnits

public double getXYUnits()
Returns the xy scale factor


getFalseZ

public double getFalseZ()
Returns the false origin's z offset value.


getZUnits

public double getZUnits()
Returns the z-offset's scale factor.


getMinZValue

public double getMinZValue()
Returns the minimum z-value.


getMaxZValue

public double getMaxZValue()
Returns the maximum z-value.


isEqual

public boolean isEqual(SeCoordinateReference cRefB)
                throws SeException
Compares two coordinate reference objects. The coordinate references are equal if they have the same Spatial Reference Id.

Parameters:
cRefB - the coordinate reference to compare with.
Returns:
true if the coordinate references are equal.
Throws:
SeException

setVertCS

public void setVertCS(PeVertCS vcs)
               throws SeException
Sets the vertical coordinate system of the given coordinate reference object. The vertical coordinate system is managed by the Projection Engine and created with the Projection Engine functions. If the given projection coordinate system object is inactive (NULL), then the vertical coordinate system object for the coordinate reference object will be destroyed and set to NULL.

Throws:
SeException
See Also:
PeFactory.vertcs(int), PeVertCS

setVertCSById

public void setVertCSById(int vertCSId)
                   throws SeException
Sets the vertical coordinate system for the supplied coordinate reference object. The vertical coordinate system is identified by the predefined Projection Engine object ID. There are around 100 predefined vertical coordinate systems.

If the vertcs_id is set to zero, the function fails with the error SeError.SE_INVALID_COORDSYS_ID. This occurs when it receives a NULL pointer to a vertical coordinate system structure from PeFactory.factory(int code).

The correct way to set the horizontal and vertical coordinate systems to values that are not known or pre-defined, is to call setCoordSysByDescription(java.lang.String).

Throws:
SeException

setCoordSysByDescription

public void setCoordSysByDescription(java.lang.String desc)
                              throws SeException
Sets the coordinate system for the coordinate reference object by a character string description.

Parameters:
desc - A character string representation of the coordinate system.
Throws:
SeException

getCoordSysDescription

public java.lang.String getCoordSysDescription()
Returns the description of the coordinate system of a Coordinate Reference.


setCoordSysByID

public void setCoordSysByID(SeObjectId coordSysID)
                     throws SeException
Sets the coordinate system for this coordinate reference object. The coordinate system is identified by the predefined Projection Engine object ID. Setting the coordsys_id to 0 will define a coordinate system of type 'unknown'.

Parameters:
coordSysID - The predefined Projection Engine ID.
Throws:
SeException

setM

public void setM(double falseM,
                 double mUnits)
Sets the measures false origin and scale factor.

Parameters:
falseM - the false measure origin value
mUnits - the number of system units per measure unit

setMByRange

public void setMByRange(double minMVal,
                        double maxMVal)
Sets the minimum and maximum measure values.

Parameters:
minMVal - The minimum measure value
maxMVal - The maximum measure value

setPrecision

public void setPrecision(int precision)
                  throws SeException
Sets the precision of this coordinate reference. The allowed precision values are:
SeLayer.SE_LAYER_PRECISION_DEFAULT
SeLayer.SE_LAYER_PRECISION_BASIC
SeLayer.SE_LAYER_PRECISION_HIGH

Parameters:
precision - The precision value
Throws:
SeException
Since:
ArcSDE 9.0

getVertCSId

public int getVertCSId()
                throws SeException
Returns the vertical coordinate system ID for the supplied coordinate reference object. The vertical coordinate system is identified by the predefined Projection Engine object ID. There are about 100 predefined vertical coordinate systems. If the vertical coordinate system is of type 'unknown', the returned id value is zero. If the vertical coordinate system is user-defined, the id value returned is -1.

Throws:
SeException

getPrecision

public int getPrecision()
                 throws SeException
Returns the precision of this coordinate reference object. The precision is one of the following values:
SeLayer.SE_LAYER_PRECISION_32_BIT
SeLayer.SE_LAYER_PRECISION_64_BIT
SeLayer.SE_LAYER_PRECISION_DEFAULT

Returns:
int This coordinate reference object's precision.
Throws:
SeException

setXY

public void setXY(double falseX,
                  double falseY,
                  double xyUnits)
Sets the x,y false origin and scale factor.

Parameters:
falseX - the false origin x-value
falseY - the false origin y-value
xyUnits - the number of system units per x,y unit

getXYEnvelope

public SeExtent getXYEnvelope()
                       throws SeException
Returns the the range of X/Y values for the coordinate reference object based upon the false origin/units values.

Returns:
SeExtent
Throws:
SeException

setXYByEnvelope

public void setXYByEnvelope(SeExtent extent)
                     throws SeException
Calculates and sets the x,y false origin and scale factor from the supplied envelope.

Parameters:
extent - an SeExtent object.
Throws:
SeException

setZ

public void setZ(double falseZ,
                 double zUnits)
Sets the z false origin and scale factor.

Parameters:
falseZ - The false origin z-value
zUnits - The number of system units per z-unit

setZByRange

public void setZByRange(double minZVal,
                        double maxZVal)
Sets the z false origin and scale factor from the given range.

Parameters:
minZVal - The minimum z value
maxZVal - The maximum z value

toString

public java.lang.String toString()
Returns a string description of this coordinate reference object.

Overrides:
toString in class java.lang.Object