com.esri.arcgis.geometry
Class Sphere

java.lang.Object
  extended by com.esri.arcgis.geometry.Sphere
All Implemented Interfaces:
IGeometry, ISphere, com.esri.arcgis.interop.RemoteObjRef, IClone, ISupportErrorInfo, Serializable

public class Sphere
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ISphere, IGeometry, IClone, ISupportErrorInfo

A complete sphere.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
Sphere()
          Constructs a Sphere using ArcGIS Engine.
Sphere(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
Sphere theSphere = (Sphere) obj;
 
Method Summary
 void assign(IClone src)
          Assigns the properties of src to the receiver.
 boolean equals(Object o)
          Compare this object with another
 IClone esri_clone()
          Clones the receiver and assigns the result to *clone.
 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.
 IPoint getCenter()
          The center of the sphere.
static String getClsid()
          getClsid.
 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.
 double getRadius()
          The radius of the sphere.
 ISpatialReference getSpatialReference()
          The spatial reference associated with this geometry.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 boolean isEmpty()
          Indicates whether this geometry contains any points.
 boolean isEqual(IClone other)
          Indicates if the receiver and other have the same properties.
 boolean isIdentical(IClone other)
          Indicates if the receiver and other are the same object.
 void project(ISpatialReference newReferenceSystem)
          Projects this geometry into a new spatial reference.
 void queryCenter(IPoint centerPoint)
          Sets an existing point equal to the center of the sphere.
 void queryEnvelope(IEnvelope outEnvelope)
          Copies this geometry's envelope properties into the specified envelope.
 void setCenter(IPoint centerPoint)
          The center of the sphere.
 void setEmpty()
          Removes all points from this geometry.
 void setRadius(double radiusLength)
          The radius of the sphere.
 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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

Sphere

public Sphere()
       throws IOException,
              UnknownHostException
Constructs a Sphere using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

Sphere

public Sphere(Object obj)
       throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
Sphere theSphere = (Sphere) obj;

Construct a Sphere using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to Sphere.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

queryCenter

public void queryCenter(IPoint centerPoint)
                 throws IOException,
                        AutomationException
Sets an existing point equal to the center of the sphere.

Description

Returns the Point corresponding to the Center of the Sphere.

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.

Sphere QueryCenter Example

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
queryCenter in interface ISphere
Parameters:
centerPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCenter

public IPoint getCenter()
                 throws IOException,
                        AutomationException
The center of the sphere.

Description

Returns or sets the Center Point of the Sphere. This Point MUST have X, Y, and Z values defined to be a valid Center.

Remarks

Sphere Center Example

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getCenter in interface ISphere
Returns:
A reference to a com.esri.arcgis.geometry.IPoint
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCenter

public void setCenter(IPoint centerPoint)
               throws IOException,
                      AutomationException
The center of the sphere.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
setCenter in interface ISphere
Parameters:
centerPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getRadius

public double getRadius()
                 throws IOException,
                        AutomationException
The radius of the sphere.

Description

Returns or sets the Radius of the Sphere. The radius is the distance from the Center of the Sphere to all points on the surface of the Sphere.

Remarks

Sphere Radius Example

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getRadius in interface ISphere
Returns:
The radiusLength
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setRadius

public void setRadius(double radiusLength)
               throws IOException,
                      AutomationException
The radius of the sphere.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
setRadius in interface ISphere
Parameters:
radiusLength - The radiusLength (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGeometryType

public int getGeometryType()
                    throws IOException,
                           AutomationException
The type of this geometry.

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getDimension

public int getDimension()
                 throws IOException,
                        AutomationException
The topological dimension of this geometry.

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getSpatialReference

public ISpatialReference getSpatialReference()
                                      throws IOException,
                                             AutomationException
The spatial reference associated with this geometry.

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setSpatialReferenceByRef

public void setSpatialReferenceByRef(ISpatialReference spatialRef)
                              throws IOException,
                                     AutomationException
The spatial reference associated with this geometry.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

isEmpty

public boolean isEmpty()
                throws IOException,
                       AutomationException
Indicates whether this geometry contains any points.

Description

IsEmpty returns TRUE when the Geometry object does not contain geometric information beyond its original initialization state. An object may be returned to its original initialization (IsEmpty = TRUE) state using SetEmpty.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setEmpty

public void setEmpty()
              throws IOException,
                     AutomationException
Removes all points from this geometry.

Description

SetEmpty returns the Geometry to its original initialization state by releasing all data referenced by the Geometry.

Remarks


Use the SetEmpty method to clear geometries and release memory. For example, a polygon with 100 rings will have an internal array of 100 pointers to ring objects. That array will go away and Release will be called on each ring. If that polygon had the only reference on those rings, then they'll go away, which releases all their segments, which may also then go away.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

queryEnvelope

public void queryEnvelope(IEnvelope outEnvelope)
                   throws IOException,
                          AutomationException
Copies this geometry's envelope properties into the specified envelope.

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getEnvelope

public IEnvelope getEnvelope()
                      throws IOException,
                             AutomationException
Creates a copy of this geometry's envelope and returns it.

Description

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

Remarks

Envelope Example

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

project

public void project(ISpatialReference newReferenceSystem)
             throws IOException,
                    AutomationException
Projects this geometry into a new spatial reference.

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.

The Project method must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometry types.

If a geometry is projected to a projected coordinate system that can't represent the geographic area where the geometry is located (or if trying to move an xy coordinate from outside the projected coordinate system back into geographic), the geometry will be set to empty.

Remarks

Note: This method can only be called upon the top level geometries (Points, Multipoints, Polylines and Polygons). 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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

snapToSpatialReference

public void snapToSpatialReference()
                            throws IOException,
                                   AutomationException
Moves points of this geometry so that they can be represented in the precision of the geometry's associated spatial reference system.

Remarks

SnapToSpatialReference rounds all coordinates to the resolution defined by the geometry's spatial reference system. This has a similar effect on the geometry as storing the geometry in a Geodatabase.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

geoNormalize

public void geoNormalize()
                  throws IOException,
                         AutomationException
Shifts longitudes, if need be, into a continuous range of 360 degrees.

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

geoNormalizeFromLongitude

public void geoNormalizeFromLongitude(double longitude)
                               throws IOException,
                                      AutomationException
Normalizes longitudes into a continuous range containing the longitude. This method is obsolete.

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).

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

esri_clone

public IClone esri_clone()
                  throws IOException,
                         AutomationException
Clones the receiver and assigns the result to *clone.

Product Availability

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

Specified by:
esri_clone in interface IClone
Returns:
A reference to a com.esri.arcgis.system.IClone
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

assign

public void assign(IClone src)
            throws IOException,
                   AutomationException
Assigns the properties of src to the receiver.

Description

Use Assign method to assign the properties of source object to receiver object. Both objects need to have the same CLSIDs. Both source and receiver objects need to be instantiated.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
assign in interface IClone
Parameters:
src - A reference to a com.esri.arcgis.system.IClone (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isEqual

public boolean isEqual(IClone other)
                throws IOException,
                       AutomationException
Indicates if the receiver and other have the same properties.

Description

IsEqual returns True if the receiver and the source have the same properties. Note, this does not imply that the receiver and the source reference the same object.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
isEqual in interface IClone
Parameters:
other - A reference to a com.esri.arcgis.system.IClone (in)
Returns:
The equal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isIdentical

public boolean isIdentical(IClone other)
                    throws IOException,
                           AutomationException
Indicates if the receiver and other are the same object.

Description

IsIdentical returns true if the receiver and the source reference the same object.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
isIdentical in interface IClone
Parameters:
other - A reference to a com.esri.arcgis.system.IClone (in)
Returns:
The identical
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.