com.esri.arcgis.geometry
Class IGeometryProxy

java.lang.Object
  extended bycom.esri.arcgis.interop.Dispatch
      extended bycom.esri.arcgis.geometry.IGeometryProxy
All Implemented Interfaces:
java.io.Externalizable, IGeometry, java.io.Serializable
Direct Known Subclasses:
ICurveProxy, IEnvelopeProxy, IGeometry2Proxy, IGeometryBagProxy, IMultiPatchProxy, IMultipointProxy, IPointProxy, IRayProxy, ISphereProxy, ITriangleFanProxy, ITrianglesProxy, ITriangleStripProxy

public class IGeometryProxy
extends Dispatch
implements IGeometry, java.io.Serializable

Provides access to members that describe properties and behavior of all geometric objects.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
Serialized Form

Field Summary
static java.lang.Class targetClass
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF
 
Constructor Summary
  IGeometryProxy()
          For internal use only
  IGeometryProxy(java.lang.Object obj)
           
protected IGeometryProxy(java.lang.Object obj, java.lang.String iid)
           
  IGeometryProxy(java.lang.String CLSID, java.lang.String host, AuthInfo authInfo)
           
protected IGeometryProxy(java.lang.String CLSID, java.lang.String iid, java.lang.String host, AuthInfo authInfo)
           
 
Method Summary
 void addListener(java.lang.String iidStr, java.lang.Object theListener, java.lang.Object theSource)
          Adds a Java object to be a listener for a specific kind of event generated by the COM object.
 void geoNormalize()
          Shifts longitudes, if need be, into a continuous range of 360 degrees.
 void geoNormalizeFromLongitude(double longitude)
          Normalizes longitudes into a continuous range containing the longitude.
 int getDimension()
          The topological dimension of this geometry.
 IEnvelope getEnvelope()
          Creates a copy of this geometry's envelope and returns it.
 int getGeometryType()
          The type of this geometry.
 ISpatialReference getSpatialReference()
          The spatial reference associated with this geometry.
 boolean isEmpty()
          Indicates whether this geometry contains any points.
 void project(ISpatialReference newReferenceSystem)
          Projects this geometry into a new spatial reference.
 void queryEnvelope(IEnvelope outEnvelope)
          Copies this geometry's envelope properties into the specified envelope.
 void removeListener(java.lang.String iidStr, java.lang.Object theListener)
          Removes a Java object as a listener to events generated by a COM object.
 void setEmpty()
          Removes all points from this geometry.
 void setSpatialReferenceByRef(ISpatialReference spatialRef)
          The spatial reference associated with this geometry.
 void snapToSpatialReference()
          Moves points of this geometry so that they can be represented in the precision of the geometry's associated spatial reference system.
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, hashCode, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, queryInterface, readExternal, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

targetClass

public static final java.lang.Class targetClass
Constructor Detail

IGeometryProxy

public IGeometryProxy(java.lang.String CLSID,
                      java.lang.String host,
                      AuthInfo authInfo)
               throws java.net.UnknownHostException,
                      java.io.IOException

IGeometryProxy

public IGeometryProxy()
For internal use only


IGeometryProxy

public IGeometryProxy(java.lang.Object obj)
               throws java.io.IOException

IGeometryProxy

protected IGeometryProxy(java.lang.Object obj,
                         java.lang.String iid)
                  throws java.io.IOException

IGeometryProxy

protected IGeometryProxy(java.lang.String CLSID,
                         java.lang.String iid,
                         java.lang.String host,
                         AuthInfo authInfo)
                  throws java.io.IOException
Method Detail

addListener

public void addListener(java.lang.String iidStr,
                        java.lang.Object theListener,
                        java.lang.Object theSource)
                 throws java.io.IOException
Description copied from class: Dispatch
Adds a Java object to be a listener for a specific kind of event generated by the COM object. when you wish to invoke method on the COM object using IDispatch (not using custom marshalling).

Overrides:
addListener in class Dispatch
Parameters:
iidStr - the ID of the outgoing interface, implemented by the listener
theListener - the object to be informed of the events
theSource - the proxy class that represents the COM class that is the source of the events
Throws:
java.io.IOException

removeListener

public void removeListener(java.lang.String iidStr,
                           java.lang.Object theListener)
                    throws java.io.IOException
Description copied from class: Dispatch
Removes a Java object as a listener to events generated by a COM object. when you wish to invoke method on the COM object using IDispatch (not using custom marshalling).

Overrides:
removeListener in class Dispatch
Parameters:
iidStr - the ID of the outgoing interface, implemented by the listener
theListener - the object that no longer wishes to be informed of the events
Throws:
java.io.IOException

getGeometryType

public int getGeometryType()
                    throws java.io.IOException,
                           AutomationException
Description copied from interface: IGeometry
The type of this geometry.

Supported Platforms

Windows, Solaris, Linux

Remarks

esriGeometryNull          = 0
esriGeometryPoint = 1
esriGeometryMultipoint = 2
esriGeometryPolyline = 3
esriGeometryPolygon = 4
esriGeometryEnvelope = 5
esriGeometryPath = 6
esriGeometryAny = 7
esriGeometryMultiPatch = 9
esriGeometryRing = 11
esriGeometryLine = 13
esriGeometryCircularArc = 14
esriGeometryBezier3Curve = 15
esriGeometryEllipticArc = 16
esriGeometryBag = 17
esriGeometryTriangleStrip = 18
esriGeometryTriangleFan = 19
esriGeometryRay = 20
esriGeometrySphere = 21
Geometry Type Example

Specified by:
getGeometryType in interface IGeometry
Returns:
A com.esri.arcgis.geometry.esriGeometryType constant
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDimension

public int getDimension()
                 throws java.io.IOException,
                        AutomationException
Description copied from interface: IGeometry
The topological dimension of this geometry.

Supported Platforms

Windows, Solaris, Linux

Description

Returns the dimension of the geometry object based on the geometry's type.

Remarks


Note: At 9.0, Multipatches are now considered as two dimensional geometry. esriGeometry3Dimension will be used for an upcoming new geometry type.
Supported esriGeometryDimensions:

-1    esriGeometryNoDimension
1    esriGeometry0Dimension
2    esriGeometry1Dimension
4    esriGeometry2Dimension
5    esriGeometry25Dimension
6    esriGeometry3Dimension

Dimension Example

Specified by:
getDimension in interface IGeometry
Returns:
A com.esri.arcgis.geometry.esriGeometryDimension constant
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getSpatialReference

public ISpatialReference getSpatialReference()
                                      throws java.io.IOException,
                                             AutomationException
Description copied from interface: IGeometry
The spatial reference associated with this geometry.

Supported Platforms

Windows, Solaris, Linux

Description

Returns and sets the Spatial Reference in which the geometry exists. If the spatial reference has not been set the property will return an empty ISpatialReference instance.

Specified by:
getSpatialReference in interface IGeometry
Returns:
A reference to a com.esri.arcgis.geometry.ISpatialReference
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

setSpatialReferenceByRef

public void setSpatialReferenceByRef(ISpatialReference spatialRef)
                              throws java.io.IOException,
                                     AutomationException
Description copied from interface: IGeometry
The spatial reference associated with this geometry.

Specified by:
setSpatialReferenceByRef in interface IGeometry
Parameters:
spatialRef - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

isEmpty

public boolean isEmpty()
                throws java.io.IOException,
                       AutomationException
Description copied from interface: IGeometry
Indicates whether this geometry contains any points.

Specified by:
isEmpty in interface IGeometry
Returns:
The isEmpty
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setEmpty

public void setEmpty()
              throws java.io.IOException,
                     AutomationException
Description copied from interface: IGeometry
Removes all points from this geometry.

Specified by:
setEmpty in interface IGeometry
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryEnvelope

public void queryEnvelope(IEnvelope outEnvelope)
                   throws java.io.IOException,
                          AutomationException
Description copied from interface: IGeometry
Copies this geometry's envelope properties into the specified envelope.

Supported Platforms

Windows, Solaris, Linux

Description

Returns the unique Envelope that binds the Geometry object.  This is the smallest Envelope that Contains the object.

Remarks

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

QueryEnvelope Example

Specified by:
queryEnvelope in interface IGeometry
Parameters:
outEnvelope - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getEnvelope

public IEnvelope getEnvelope()
                      throws java.io.IOException,
                             AutomationException
Description copied from interface: IGeometry
Creates a copy of this geometry's envelope and returns it.

Supported Platforms

Windows, Solaris, Linux

Description

Returns the unique Envelope that binds the Geometry object.  This is the smallest Envelope that Contains the object.

Remarks

 

Envelope Example

Specified by:
getEnvelope in interface IGeometry
Returns:
A reference to a com.esri.arcgis.geometry.IEnvelope
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

project

public void project(ISpatialReference newReferenceSystem)
             throws java.io.IOException,
                    AutomationException
Description copied from interface: IGeometry
Projects this geometry into a new spatial reference.

Supported Platforms

Windows, Solaris, Linux

Description

To Project, the geometry needs to have a Spatial Reference set, and not have an UnknownCoordinateSystem. The new spatial reference system passed to the method defines the output coordinate system. If either spatial reference is Unknown, the coordinates are not changed. The Z and measure values are not changed by the Project method.

A geometry is not densified before it is projected. This can lead to the output geometries not reflecting the 'true' shape in the new coordinate system. A straight line in one coordinate system is not necessarily a straight line in a different coordinate system. Use IGeometry2::ProjectEx if you want to densify the geometries while they are projected.

Remarks

Note: If the from/to spatial references have different geographic coordinate systems, the Project method looks for a GeoTransformationsOperationSet. If the set of Geotransformations is present in memory, Project will use it to perform a geographic/datum Transformation. To use a specific geotransformation, use the IGeometry2::ProjectEx method.

Specified by:
project in interface IGeometry
Parameters:
newReferenceSystem - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

snapToSpatialReference

public void snapToSpatialReference()
                            throws java.io.IOException,
                                   AutomationException
Description copied from interface: IGeometry
Moves points of this geometry so that they can be represented in the precision of the geometry's associated spatial reference system.

Supported Platforms

Windows, Solaris, Linux

Remarks

SnapToSpatialReference rounds all coordinates to the resolution defined by the geometry's spatial reference system. This has a smilar effect on the geometry as storing the geometry in a Geodatabase (*.mdb or ArcSDE).

Specified by:
snapToSpatialReference in interface IGeometry
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

geoNormalize

public void geoNormalize()
                  throws java.io.IOException,
                         AutomationException
Description copied from interface: IGeometry
Shifts longitudes, if need be, into a continuous range of 360 degrees.

Supported Platforms

Windows, Solaris, Linux

Remarks

GeoNormalize acts on geometries whose geographic system coordinates are below -180 degrees longitude or over +180 degrees longitude or on geometries that span the +-180 degrees longitude.
 
This method requires the geometry to have a valid spatial reference (geographic or projected coordinate system).
 
This method is used internally as part of the projection process for polygons and polylines.  It is typically not used by itself.
 

Specified by:
geoNormalize in interface IGeometry
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

geoNormalizeFromLongitude

public void geoNormalizeFromLongitude(double longitude)
                               throws java.io.IOException,
                                      AutomationException
Description copied from interface: IGeometry
Normalizes longitudes into a continuous range containing the longitude. This method is obsolete.

Supported Platforms

Windows, Solaris, Linux

Remarks

This method is obsolete.  Use IGeometry::GeoNormalize instead.
 
This method requires the geometry to have a valid spatial reference (geographic or projected coordinate system).

Specified by:
geoNormalizeFromLongitude in interface IGeometry
Parameters:
longitude - The longitude (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.