com.esri.arcgis.geometry
Class GeometryServerImpl

java.lang.Object
  extended by com.esri.arcgis.geometry.GeometryServerImpl
All Implemented Interfaces:
IGeometryServer, com.esri.arcgis.interop.RemoteObjRef, ILogSupport, IObjectActivate, IObjectConstruct, IRequestHandler, IRequestHandler2, ISupportErrorInfo, Serializable

public class GeometryServerImpl
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IObjectConstruct, IRequestHandler, IRequestHandler2, IObjectActivate, ILogSupport, ISupportErrorInfo, IGeometryServer

Provides access to standard operations on geometric 'value' objects. The input geometries are never modified by these operations. Designed for use in building web services and web applications.

Remarks

DCOM and ArcEngine clients of the GeometryServer should not cocreate an instance of GeometryServerImpl. Clients should cocreate the GeometryServer object defined in the geodatabase object library (esriGeodatabase).

Product Availability

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

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.arcgis.system.IObjectActivate
IID, IIDe3b78022_143e_4e61_9099_ed319ec061e7, xxDummy
 
Constructor Summary
GeometryServerImpl()
          Constructs a GeometryServerImpl using ArcGIS Engine.
GeometryServerImpl(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
GeometryServerImpl theGeometryServerImpl = (GeometryServerImpl) obj;
 
Method Summary
 void activate()
          Activates the object.
 IGeometryArray buffer(ISpatialReference pInSR, ISpatialReference pBufferSR, ISpatialReference pOutSR, IDoubleArray pDistances, IUnit pUnit, boolean bUnion, IGeometryArray pInGeometries)
          Buffers an array of geometries by each distance specified in an array of distances.
 void construct(IPropertySet props)
          Two phase object construction.
 void deactivate()
          Deactivates the object.
 IGeometryArray densify(ISpatialReference pSR, IGeometryArray pInGeometries, double maxSegmentLength, boolean useDeviationDensification, double densificationParameter)
          Applies the ArcObjects 'Densify' operation to each element of the geometry array.
 boolean equals(Object o)
          Compare this object with another
 ISpatialReference findSRByWKID(String authority, int wKID, int wKID_Z, boolean bDefaultXYResolution, boolean bDefaultXYTolerance)
          Defines a spatial reference object based upon its well known identifier (WKID) and optionally a WKID for a vertical datum.
 ISpatialReference findSRByWKT(String wKT, String wKT_Z, boolean bDefaultXYResolution, boolean bDefaultXYTolerance)
          Defines a spatial reference object based upon its well known text string (WKT) and optionally a WKT for a vertical datum.
 IUnit findUnitsByWKID(String authority, int wKID)
          Defines a unit object based upon its well known identified (WKID).
 IUnit findUnitsByWKT(String wKT)
          Defines a unit object based upon its well known text string.
 void getAreasAndLengths(ISpatialReference pSR, IPolygonArray pInPolygons, IDoubleArray[] ppAreas, IDoubleArray[] ppLengths)
          Calculates areas and perimeter lengths for each polygon in the specified array.
static String getClsid()
          getClsid.
 IPointArray getLabelPoints(ISpatialReference pSR, IPolygonArray pInPolygons)
          Calculates an interior point for each polygon.
 IDoubleArray getLengths(ISpatialReference pSR, IPolylineArray pInPolylines)
          Calculates the length of eacch polyline in the specified array.
 byte[] handleBinaryRequest(byte[] request)
          Handles a binary request.
 byte[] handleBinaryRequest2(String capabilities, byte[] request)
          Handles a binary request with explicit capabilities.
 String handleStringRequest(String capabilities, String request)
          Handles a SOAP string request.
 int hashCode()
          the hashcode for this object
 void initLogging(ILog log)
          Initializes an object with a log.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 IGeometryArray project(ISpatialReference pInSR, ISpatialReference pOutSR, int xFormDir, ITransformation pXForm, IEnvelope pExtent, IGeometryArray pInGeometries)
          Projects an array of geometries from their current spatial reference (pInSR) to a destination spatial reference (pOutSR).
 IRelationResultArray relation(ISpatialReference pSR, IGeometryArray pInGA1, IGeometryArray pInGA2, int r, String param)
          Determines the pairs of geometries from the input geometry arrays that participate in the specified spatial relation.
 IGeometryArray simplify(ISpatialReference pSR, IGeometryArray pInGeometries)
          Applies the ArcObjects 'Simplify' operation to each element of the geometry array.
 
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

GeometryServerImpl

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

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

GeometryServerImpl

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

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

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

construct

public void construct(IPropertySet props)
               throws IOException,
                      AutomationException
Two phase object construction.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

handleBinaryRequest

public byte[] handleBinaryRequest(byte[] request)
                           throws IOException,
                                  AutomationException
Handles a binary request.

Specified by:
handleBinaryRequest in interface IRequestHandler
Parameters:
request - An unsigned byte (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

handleStringRequest

public String handleStringRequest(String capabilities,
                                  String request)
                           throws IOException,
                                  AutomationException
Handles a SOAP string request.

Specified by:
handleStringRequest in interface IRequestHandler
Parameters:
capabilities - The capabilities (in)
request - The request (in)
Returns:
The response
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

handleBinaryRequest2

public byte[] handleBinaryRequest2(String capabilities,
                                   byte[] request)
                            throws IOException,
                                   AutomationException
Handles a binary request with explicit capabilities.

Product Availability

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

Specified by:
handleBinaryRequest2 in interface IRequestHandler2
Parameters:
capabilities - The capabilities (in)
request - An unsigned byte (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

activate

public void activate()
              throws IOException,
                     AutomationException
Activates the object.

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

deactivate

public void deactivate()
                throws IOException,
                       AutomationException
Deactivates the object.

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

initLogging

public void initLogging(ILog log)
                 throws IOException,
                        AutomationException
Initializes an object with a log.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
initLogging in interface ILogSupport
Parameters:
log - A reference to a com.esri.arcgis.system.ILog (in)
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.

project

public IGeometryArray project(ISpatialReference pInSR,
                              ISpatialReference pOutSR,
                              int xFormDir,
                              ITransformation pXForm,
                              IEnvelope pExtent,
                              IGeometryArray pInGeometries)
                       throws IOException,
                              AutomationException
Projects an array of geometries from their current spatial reference (pInSR) to a destination spatial reference (pOutSR). The projection process can optionally include a datum transformation if the source and destination SRs have different GCSs.

Remarks

The Project method applies the projection pOutSR to a copy of each element of pInGeometries and places the results in ppProjectedGeometries. All input geometries are assumed to be in the spatial reference pInSR, which cannot be nil. The input geometries are not modified. The array can contain mixed top-level geometry types (specifically points, multipoints, polylines and polygons). The array can also contain envelopes. pXForm and pExtent are optional. If pXForm is specified, then it is an instance of a GeoTransformation subclass (see EDN for details on datum transformations), and xFormDir must also be specified (esriTransformForward, esriTransformReverse ). If pExtent is specified, then all input geometries are then assumed to be contained in it, and an attempt will be made to optimize the projection operation by checking if that extent is completely contained in the projection's horizon.

If pXForm is not specified and the datums of the specified spatial references are not the same, then a search is made through a set of default datum transformations (a.k.a geographic transformations) . Currently, the following transformations, identified by name and WKID, are in that set:
esriSRGeoTransformation_NAD_1927_TO_NAD_1983_NADCON, forward and reverse, WKID = 1241
esriSRGeoTransformation_NAD1983_To_WGS1984_1, forward and reverse, WKID = 1170
esriSRGeoTransformation_NAD1927_To_WGS1984_4, forward and reverse, WKID = 1173

Refer to FindSRByWKID for a discussion on how to create the different kinds of spatial reference systems that can be used with this method. In addition, Well Known Identifiers (WKIDs) for available geotransformations are listed in the following enumerations:

esriSRGeoTransformation2Type
esriSRGeoTransformation3Type
esriSRGeoTransformationType

Refer to GeometryServer for additional details on how the input spatial reference is interpreted.

Product Availability

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

Specified by:
project in interface IGeometryServer
Parameters:
pInSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
pOutSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
xFormDir - A com.esri.arcgis.geometry.esriTransformDirection constant (in)
pXForm - A reference to a com.esri.arcgis.geometry.ITransformation (in)
pExtent - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
pInGeometries - A reference to a com.esri.arcgis.geometry.IGeometryArray (in)
Returns:
A reference to a com.esri.arcgis.geometry.IGeometryArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

buffer

public IGeometryArray buffer(ISpatialReference pInSR,
                             ISpatialReference pBufferSR,
                             ISpatialReference pOutSR,
                             IDoubleArray pDistances,
                             IUnit pUnit,
                             boolean bUnion,
                             IGeometryArray pInGeometries)
                      throws IOException,
                             AutomationException
Buffers an array of geometries by each distance specified in an array of distances. The distance units can optionally be specified. Geometries buffered at a given distance can optionally be unioned together.

Remarks

Applies the geometric buffer operation to each geometry in pInGeometries, using each distance in the array pDistances. All geometries are assumed to be in the coordinate system pInSR, which cannot be nil. pBufferSR is the spatial reference in which the geometries are buffered. pOutSR is the spatial reference in which the buffer polygons are returned. pInSR must be specified. Either or both of the other SRs can be nil. If one is not nil, it is used for both buffering and output. The distances can be specified in a separate unit of measure. For example, the buffer distances could be specified in feet and the coordinates of the geometries could be specified in meters. If bUnion is false, each buffered polygon will be added to ppOutBuffers separately. If bUnion is true, then all geometries buffered at a given distance will be unioned into a single (possibly multipart) polygon and that unioned geometry will be placed in the output array.

Refer to IGeometryServer for additional details on how the input spatial reference is interpreted.

When buffering points or multipoints and the input spatial reference is a geographic coordinate system (WGS1984, for example), you have the option of generating true geodesic buffers. To obtain such buffers, specify a linear unit of distance for the pUnit parameter.

Here is an example showing how to create a buffer using the Geometry Server.

Product Availability

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

Specified by:
buffer in interface IGeometryServer
Parameters:
pInSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
pBufferSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
pOutSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
pDistances - A reference to a com.esri.arcgis.system.IDoubleArray (in)
pUnit - A reference to a com.esri.arcgis.geometry.IUnit (in)
bUnion - The bUnion (in)
pInGeometries - A reference to a com.esri.arcgis.geometry.IGeometryArray (in)
Returns:
A reference to a com.esri.arcgis.geometry.IGeometryArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

relation

public IRelationResultArray relation(ISpatialReference pSR,
                                     IGeometryArray pInGA1,
                                     IGeometryArray pInGA2,
                                     int r,
                                     String param)
                              throws IOException,
                                     AutomationException
Determines the pairs of geometries from the input geometry arrays that participate in the specified spatial relation.

Remarks

Computes the set of pairs of geometries from pInGA1 and pInGA2 that belong to the specified relation. Both arrays are assumed to be in the coordinate system pSR, which cannot be nil. The relations are evaluated in 2D. Z coordinates are not used. Geometry types cannot be mixed within an array. Further restrictions on the types of geometries in an array are listed in the following table. r is a member of esriSpatialRelationEnum and can be one of the following:

Name Description
esriSpatialRelationDisjoint Same as IRelationalOperator::Disjoint. The zero-based index of a geometry from pInGA1 and the zero-based index of a geometry from pInGA2 define an element of the output array of relation results if the geometries share no points in common. See IRelationalOperator_Disjoint for some examples of the disjoint relation. There are no additional restrictions on the types of geometries in the input arrays.
esriSpatialRelationIntersection The opposite of esriSpatialRelationDisjoint. An element of the output array will specify the indexes of geometries from the input arrays if they share at least one point in the xy plane. There are no additional restrictions on the types of geometries in the input arrays.
esriSpatialRelationInteriorIntersection Same as esriSpatialRelationIntersection, but excludes intersections that occur only at boundaries (two touching polygons for example). The interior of a point is considered to be the point itself and the interior of a polyline excludes the endpoints of all its parts. There are no additional restrictions on the types of geometries in the input arrays.
esriSpatialRelationIn, esriSpatialRelationWithin These relations are similar. esriSpatialRelationIn is the same as IRelationalOperator::Within. esriSpatialRelationWithin is the same but also allows polylines that are strictly on the boundaries of polygons to be considered “in” the polygon. This case is disallowed by the former relation (and disallowed by IRelationalOperator::Within). The dimension of all geometries in pInGA1 must be >= the dimension of geometries in pInGA2.

esriSpatialRelationPointTouch, esriSpatialRelationLineTouch, esriSpatialRelationTouch

esriSpatialRelationPointTouch and esriSpatialRelationLineTouch are boundary intersections classified by dimension of intersection. esriSpatialRelationTouch is the union of those two and is equivalent to the ArcObjects IRelationalOperator Touch method.

These relations are defined for polylines and polygons.

esriSpatialRelationLineCoincidence The boundaries of the shapes must share a 1D intersection, but the relationship between the interiors of the shapes is not considered (they could overlap, one could be contained in the other, or their interiors could be disjoint). This relation applies to polylines and polygons.
esriSpatialRelationCross Same as the ArcObjects IRelationalOperator::Cross method. Lines can cross other lines at a point and lines can cross polygons. See IRelationalOperator_Crosses for examples.
esriSpatialRelationRelation 'param' defines the 'Shape Comparison Language' string to be evaluated. Strings such as "RELATE(G1, G2, ""FFFTTT***"")" are accepted, in addition to other kinds of strings. See the following EDN topic for more details on the Shape Comparison Language. http://edndoc.esri.com/arcobjects/9.2/NET/40de6491-9b2d-440d-848b-2609efcd46b1.htm

The output array contains elements of type

struct esriRelationPair

{

 // The index of the left element in the relation.

 long m_leftIndex;



 //The index of the right element in the relation.

 long m_rightIndex;



} esriRelationPair;

m_leftIndex is a zero-based index into pInGA1 and m_rightIndex is an index into pInGA2.

esriGeometryRelationEnum is a synonym for esriSpatialRelationEnum. The former is the type name exposed through the web service. The latter is exposed through the COM api.

Refer to IGeometryServer for additional details on how the input spatial reference is interpreted.

Product Availability

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

Specified by:
relation in interface IGeometryServer
Parameters:
pSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
pInGA1 - A reference to a com.esri.arcgis.geometry.IGeometryArray (in)
pInGA2 - A reference to a com.esri.arcgis.geometry.IGeometryArray (in)
r - A com.esri.arcgis.geometry.esriSpatialRelationEnum constant (in)
param - The param (in)
Returns:
A reference to a com.esri.arcgis.geometry.IRelationResultArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

simplify

public IGeometryArray simplify(ISpatialReference pSR,
                               IGeometryArray pInGeometries)
                        throws IOException,
                               AutomationException
Applies the ArcObjects 'Simplify' operation to each element of the geometry array.

Remarks

Applies the ArcObjects geometric simplification operation to a copy of each geometry in the input array, placing the result in ppSimplifiedGeometries. The input geometries are assumed to be specified in the input spatial reference pSR, which cannot be nil. The elements can be a mixture of points, multipoints, polylines or polygons. Elements that can’t be simplifed are replaced with empty geometries of the same type at the corresponding index entry in the output array. Polylines are simplified using the SimplifyNetwork method.

Refer to IGeometryServer for additional details on how the input spatial reference is interpreted.

Product Availability

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

Specified by:
simplify in interface IGeometryServer
Parameters:
pSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
pInGeometries - A reference to a com.esri.arcgis.geometry.IGeometryArray (in)
Returns:
A reference to a com.esri.arcgis.geometry.IGeometryArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

densify

public IGeometryArray densify(ISpatialReference pSR,
                              IGeometryArray pInGeometries,
                              double maxSegmentLength,
                              boolean useDeviationDensification,
                              double densificationParameter)
                       throws IOException,
                              AutomationException
Applies the ArcObjects 'Densify' operation to each element of the geometry array.

Remarks

Replaces each curve segment, and optionally each line segment, in a polyline or polygon with line segments. Other types of input geometries will be ignored. All geometries are assumed to be in the spatial reference pSR, which cannot be nil.

When maxSegmentLength is greater than zero, lines and curves greater than that length will be replaced with lines at most maxSegmentLength long, and curves shorter than that will be replaced with lines connecting their endpoints. If maxSegmentLength is 0, then only curve segments will be densified, as explained below.

In general, this method provides three ways to densify curves:

  1. based on length
  2. based on central angle
  3. based on maximum distance of replacement line from input curve (deviation)

The following table explains how the input parameters work together.

When MaxSegmentLength is and angleOrDeviation is then
> 0 0 All segments longer than maxSegmentLength are replaced with sequences of lines no longer than maxSegmentLength. Curves shorter than maxSegmentLength are replaced with lines connecting the curve endpoints. This is method 1, above, for densifying curves.
0 > 0 Input lines are copied to the output geometries. Input curves are densified using either method 2 or method 3, based on the value of the useDeviationDensification parameter.
> 0 > 0 Lines longer than maxSegmentLength units are replaced with sequences of lines no longer than maxSegmentLength; curves are replaced with sequences of lines using either method 2 or method 3, based on the value of the useDeviationDensification parameter.

Refer to IGeometryServer for additional details on how the input spatial reference is interpreted.

If the geometries are in a geographic coordinate system, then “linear” densification distances are in units of degrees (or some other gcs angular unit). This isn’t meaningful if you expect output segments to have a constant ground length, but it still accomplishes the purpose of densifying the geometries, which is useful if you subsequently want to project them more accurately.

Product Availability

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

Specified by:
densify in interface IGeometryServer
Parameters:
pSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
pInGeometries - A reference to a com.esri.arcgis.geometry.IGeometryArray (in)
maxSegmentLength - The maxSegmentLength (in)
useDeviationDensification - The useDeviationDensification (in)
densificationParameter - The densificationParameter (in)
Returns:
A reference to a com.esri.arcgis.geometry.IGeometryArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findSRByWKID

public ISpatialReference findSRByWKID(String authority,
                                      int wKID,
                                      int wKID_Z,
                                      boolean bDefaultXYResolution,
                                      boolean bDefaultXYTolerance)
                               throws IOException,
                                      AutomationException
Defines a spatial reference object based upon its well known identifier (WKID) and optionally a WKID for a vertical datum. The resolution and xy tolerances are either computed from the sr horizon or set to defaults. 'authority' is typically either 'EPSG' or 'E?¸?

Remarks

Returns a predefined, high precision spatial reference based on its OGP/EPSG Well Known Identifier (WKID, aka “factory code”). Valid WKIDs are listed below. If WKID_Z > -1, then a vertical coordinate system will be created and associated with the horizontal coordinate system.


AuthorityName is usually "EPSG" or "ESRI", but can also be an arbitrary string. It can also be the empty string if you want the default authority name associated with the new spatial reference. Clients can associate their own authority names with factory codes that are currently associated with the EPSG or ESRI authority names, because only the WKID is used to create the spatial reference. Here are the current rules for mapping WKID ranges to default authority names:

• A WKID in the EPSG code range (1000 – 32768) will result in an AUTHORITY name of “EPSG”, and the version will be the current EPSG version used (currently “6.12”).
• A WKID in the ESRI code range (33000 – 199999) will result in an AUTHORITY name of “ESRI”, and the version will be the current PE library version (currently “9.3”).
• A WKID in the user (objedit) range (200000 – 209199) will result in an AUTHORITY name of “CUSTOM”, with no version associated with it. This name is specified by the OGC.

For web service clients of the geometry server, the returned WKT (well known text) element of the spatial reference will have an “AUTHORITY’ tag in it, containing the default or the client-specified authority name and the specified WKID.

If bDefaultXYResolution is true, then the xy coordinate grid resolution will be set to its default value (see SetDefaultXYResolution for details). If it is false, the finest possible resolution that covers the horizon of the spatial reference will be used (see ConstructFromHorizon for details).


If bDefaultXYTolerance is true, then the default xy tolerance of 1mm will be used (see SetDefaultXYTolerance for details). If it is false, then the minimum xy tolerance will be used (2.0 * xy coordinate grid resolution).


Lists of the valid WKIDs for predefined Projected Coordinate Systems can be found here:
esriSRProjCS2Type, esriSRProjCS3Type, esriSRProjCS4Type, esriSRProjCSType


Lists of the valid WKIDs for predefined Geographic Coordinate Systems can be found here:

esriSRGeoCS2Type, esriSRGeoCS3Type, esriSRGeoCSType

Product Availability

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

Specified by:
findSRByWKID in interface IGeometryServer
Parameters:
authority - The authority (in)
wKID - The wKID (in)
wKID_Z - The wKID_Z (in)
bDefaultXYResolution - The bDefaultXYResolution (in)
bDefaultXYTolerance - The bDefaultXYTolerance (in)
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.

findSRByWKT

public ISpatialReference findSRByWKT(String wKT,
                                     String wKT_Z,
                                     boolean bDefaultXYResolution,
                                     boolean bDefaultXYTolerance)
                              throws IOException,
                                     AutomationException
Defines a spatial reference object based upon its well known text string (WKT) and optionally a WKT for a vertical datum. The resolution and xy tolerances are either computed from the sr horizon or set to defaults. The output sr is always high precision.

Remarks

Finds a predefined spatial reference based on its well known text string (WKT). If WKT_Z is specified and not empty, then a vertical coordinate system will be created and associated with the horizontal coordinate system. The definition string can be generated from ArcObjects using the ExportToESRISpatialReference method on a PCS or GCS. The boolean parameters are as described for FindSRByWKID.

Product Availability

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

Specified by:
findSRByWKT in interface IGeometryServer
Parameters:
wKT - The wKT (in)
wKT_Z - The wKT_Z (in)
bDefaultXYResolution - The bDefaultXYResolution (in)
bDefaultXYTolerance - The bDefaultXYTolerance (in)
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.

findUnitsByWKID

public IUnit findUnitsByWKID(String authority,
                             int wKID)
                      throws IOException,
                             AutomationException
Defines a unit object based upon its well known identified (WKID). 'authority' is typically either 'EPSG' or 'ESRI'.

Remarks

Finds a predefined linear or angular unit of measure based on its OGP/EPSG well known identifier (WKID, also referred to as “factory code”). AuthorityName is optional. If specified, it is usually either "EPSG" or "ESRI", but can also be an arbitrary string. As with spatial references, only the WKID value is used to locate the predefined unit. The WKIDs for predefined linear and angular units are listed here: esriSRUnit2Type, esriSRUnitType.

Product Availability

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

Specified by:
findUnitsByWKID in interface IGeometryServer
Parameters:
authority - The authority (in)
wKID - The wKID (in)
Returns:
A reference to a com.esri.arcgis.geometry.IUnit
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findUnitsByWKT

public IUnit findUnitsByWKT(String wKT)
                     throws IOException,
                            AutomationException
Defines a unit object based upon its well known text string.

Remarks

Finds a predefined linear or angular unit of measure based on its well known text string (WKT). Here are some examples of WKT strings for linear and angular units.

U.S. Survey Foot:

UNIT["Foot_US",0.3048006096012192,AUTHORITY["EPSG",9003]]

Arc-minute:

UNIT["Minute",0.0002908882086657216,AUTHORITY["EPSG",9103]]

Creating custom units

You can create a custom unit in ArcObjects by using the ImportFromESRISpatialReference method on an existing linear or angular unit object. Web service clients can do this by creating a LinearUnit or AngularUnit value first and then assigning the WKT string to the WKT property of the value. The example script in this topic illustrates the former approach and the example provided in the IGeometryServer topic illustrates the latter.

Product Availability

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

Specified by:
findUnitsByWKT in interface IGeometryServer
Parameters:
wKT - The wKT (in)
Returns:
A reference to a com.esri.arcgis.geometry.IUnit
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAreasAndLengths

public void getAreasAndLengths(ISpatialReference pSR,
                               IPolygonArray pInPolygons,
                               IDoubleArray[] ppAreas,
                               IDoubleArray[] ppLengths)
                        throws IOException,
                               AutomationException
Calculates areas and perimeter lengths for each polygon in the specified array.

Remarks

All geometries are assumed to be defined in the spatial reference pSR, which cannot be nil. The area and length values are computed in that spatial reference. It is not recommended that this method be used on geometries associated with a geographic coordinate system, since the length would then be calculated in units of "degrees" and the area would be calculated in units of "square degrees".

Refer to IGeometryServer for additional details on how the input spatial reference is interpreted.

Product Availability

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

Specified by:
getAreasAndLengths in interface IGeometryServer
Parameters:
pSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
pInPolygons - A reference to a com.esri.arcgis.geometry.IPolygonArray (in)
ppAreas - A reference to a com.esri.arcgis.system.IDoubleArray (out: use single element array)
ppLengths - A reference to a com.esri.arcgis.system.IDoubleArray (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLengths

public IDoubleArray getLengths(ISpatialReference pSR,
                               IPolylineArray pInPolylines)
                        throws IOException,
                               AutomationException
Calculates the length of eacch polyline in the specified array.

Remarks

All geometries are assumed to be defined in the spatial reference pSR, which cannot be nil. The length values are computed in that spatial reference. It is not recommended that this method be used on geometries associated with a geographic coordinate system, since the length would then be calculated in units of "degrees".

Refer to IGeometryServer for additional details on how the input spatial reference is interpreted.

Product Availability

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

Specified by:
getLengths in interface IGeometryServer
Parameters:
pSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
pInPolylines - A reference to a com.esri.arcgis.geometry.IPolylineArray (in)
Returns:
A reference to a com.esri.arcgis.system.IDoubleArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLabelPoints

public IPointArray getLabelPoints(ISpatialReference pSR,
                                  IPolygonArray pInPolygons)
                           throws IOException,
                                  AutomationException
Calculates an interior point for each polygon.

Remarks

Generates one point geometry per input polygon. Each point is guaranteed to be inside its corresponding polygon. The ArcObjects IArea::LabelPoint property is used to generate the output points. All input geometries are assumed to be defined in the input spatial reference pSR. pSR cannot be nil.

Product Availability

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

Specified by:
getLabelPoints in interface IGeometryServer
Parameters:
pSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
pInPolygons - A reference to a com.esri.arcgis.geometry.IPolygonArray (in)
Returns:
A reference to a com.esri.arcgis.geometry.IPointArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.