Packagecom.esri.ags.tasks
Classpublic class GeometryService
InheritanceGeometryService Inheritance BaseTask Inheritance flash.events.EventDispatcher

Represents a geometry task resource exposed by the ArcGIS Server REST API (available in ArcGIS Server 9.3 and above). This resource provides the service description associated with a geometry service and is primarily a processing and algorithmic resource that supports operations related to geometries.

Set the url to the ArcGIS Server REST resource that represents a GeometryService, e.g. http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer. For more information on constructing a URL, see Using the ArcGIS Services Directory.

See also

com.esri.ags.events.GeometryServiceEvent
Live Sample - using a listener for GeometryServiceEvent.BUFFER_COMPLETE.
Live Sample - using a listener for GeometryServiceEvent.BUFFER_COMPLETE.
Live Sample - using arealengthsComplete and simplifyComplete with a GeometryService.
Live Sample - using labelPointsComplete and simplifyComplete with a GeometryService.
Live Sample - using lengthsComplete and projectComplete with a GeometryService.
Live Sample - using projectComplete with a GeometryService.
Live Sample - using relationComplete with a GeometryService.
Live Sample - using simplifyComplete with a GeometryService.


Public Properties
 PropertyDefined by
  areasAndLengthsLastResult : Object
The last result of the areasAndlengths function execution.
GeometryService
  bufferLastResult : Array
The last result of the buffer function execution.
GeometryService
 Inheritedconcurrency : String = "multiple"
Value that indicates how to handle multiple calls to the same task.
BaseTask
 InheriteddisableClientCaching : Boolean
If true, adds a timestamp parameter ("_ts") to the REST request to prevent the request from being loaded from the browser's cache.
BaseTask
  labelPointsLastResult : Array
The last result of the labelPoints function execution.
GeometryService
  lengthsLastResult : Array
The last result of the lengths function execution.
GeometryService
  projectLastResult : Array
The last result of the project function execution.
GeometryService
 InheritedproxyURL : String
The URL to proxy the request through.
BaseTask
  relationLastResult : Array
The last result of the relation function execution.
GeometryService
 InheritedrequestTimeout : Number = -1
The request timeout in seconds.
BaseTask
 InheritedshowBusyCursor : Boolean = false
If true, a busy cursor is displayed while a service is executing.
BaseTask
  simplifyLastResult : Array
The last result of the simplify function execution.
GeometryService
 Inheritedtoken : String
Token for accessing a secure task.
BaseTask
 Inheritedurl : String
URL of the task.
BaseTask
Public Methods
 MethodDefined by
  
GeometryService(url:String = null)
Creates a new GeometryService object.
GeometryService
  
areasAndLengths(graphics:Array, responder:IResponder = null):AsyncToken
The areasAndLengths operation is performed on a geometry service resource.
GeometryService
  
buffer(bufferParameters:BufferParameters, responder:IResponder = null):AsyncToken
The buffer operation is performed on a geometry service resource.
GeometryService
  
labelPoints(graphics:Array, responder:IResponder = null):AsyncToken
The labelPoints operation is performed on a geometry service resource (only available with ArcGIS Server 9.3 Service Pack 1 or above).
GeometryService
  
lengths(graphics:Array, responder:IResponder = null):AsyncToken
The lengths operation is performed on a geometry service resource.
GeometryService
  
project(graphics:Array, outSpatialReference:SpatialReference, responder:IResponder = null):AsyncToken
Projects a set of graphics into a new spatial reference.
GeometryService
  
relation(graphics1:Array, graphics2:Array, spatialRelationship:String, comparisonString:String = null, responder:IResponder = null):AsyncToken
The relation operation is performed on a geometry service resource.
GeometryService
  
simplify(graphics:Array, responder:IResponder = null):AsyncToken
Alters the given geometries to make their definitions topologically legal with respect to their geometry type.
GeometryService
Events
 EventSummaryDefined by
   Dispatched when an areasAndLengths task successfully completes.GeometryService
   Dispatched when a buffer task successfully completes.GeometryService
   Dispatched when a GeometryService request fails.GeometryService
   Dispatched when a labelPoints task successfully completes.GeometryService
   Dispatched when a lengths task successfully completes.GeometryService
   Dispatched when a projection task successfully completes.GeometryService
   Dispatched when a relation task successfully completes.GeometryService
   Dispatched when a simplify task successfully completes.GeometryService
Public Constants
 ConstantDefined by
  SPATIAL_REL_COINCIDENCE : String = "esriGeometryRelationLineCoincidence"
[static] The boundaries of the geometries must share an 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).
GeometryService
  SPATIAL_REL_CROSS : String = "esriGeometryRelationCross"
[static] Two polylines cross if they share only points in common, at least one of which is not an endpoint.
GeometryService
  SPATIAL_REL_DISJOINT : String = "esriGeometryRelationDisjoint"
[static] Two geometries are disjoint if their intersection is empty.
GeometryService
  SPATIAL_REL_IN : String = "esriGeometryRelationIn"
[static] The base geometry is within the comparison geometry if the base geometry is the intersection of the geometries and the intersection of their interiors is not empty.
GeometryService
  SPATIAL_REL_INTERIORINTERSECTION : String = "esriGeometryRelationInteriorIntersection"
[static] Geometries intersect excluding boundary touch.
GeometryService
  SPATIAL_REL_INTERSECTION : String = "esriGeometryRelationIntersection"
[static] Geometry interiors intersect or boundaries touch, same as 'not disjoint'.
GeometryService
  SPATIAL_REL_LINETOUCH : String = "esriGeometryRelationLineTouch"
[static] Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty.
GeometryService
  SPATIAL_REL_OVERLAP : String = "esriGeometryRelationOverlap"
[static] Two polylines share a common sub-line, or two polygons share a common sub-area.
GeometryService
  SPATIAL_REL_POINTTOUCH : String = "esriGeometryRelationPointTouch"
[static] Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty.
GeometryService
  SPATIAL_REL_RELATION : String = "esriGeometryRelationRelation"
[static] Allows specification of any relationship defined using the Shape Comparison Language.
GeometryService
  SPATIAL_REL_TOUCH : String = "esriGeometryRelationTouch"
[static] The union of esriGeometryRelationPointTouch and esriGeometryRelationLineTouch.
GeometryService
  SPATIAL_REL_WITHIN : String = "esriGeometryRelationWithin"
[static] Same as esriGeometryRelationIn but also allows polylines that are strictly on the boundaries of polygons to be considered 'in' the polygon.
GeometryService
Property detail
areasAndLengthsLastResultproperty
public var areasAndLengthsLastResult:Object

The last result of the areasAndlengths function execution.

This property can be used as the source for data binding.

bufferLastResultproperty 
public var bufferLastResult:Array

The last result of the buffer function execution.

This property can be used as the source for data binding.

labelPointsLastResultproperty 
public var labelPointsLastResult:Array

The last result of the labelPoints function execution.

This property can be used as the source for data binding.

lengthsLastResultproperty 
public var lengthsLastResult:Array

The last result of the lengths function execution.

This property can be used as the source for data binding.

projectLastResultproperty 
public var projectLastResult:Array

The last result of the project function execution.

This property can be used as the source for data binding.

relationLastResultproperty 
public var relationLastResult:Array

The last result of the relation function execution.

This property can be used as the source for data binding.

simplifyLastResultproperty 
public var simplifyLastResult:Array

The last result of the simplify function execution.

This property can be used as the source for data binding.

Constructor detail
GeometryService()constructor
public function GeometryService(url:String = null)

Creates a new GeometryService object.

Parameters
url:String (default = null) — [optional] URL to the ArcGIS Server REST resource that represents a geometry service.
Method detail
areasAndLengths()method
public function areasAndLengths(graphics:Array, responder:IResponder = null):AsyncToken

The areasAndLengths operation is performed on a geometry service resource. This operation calculates areas and perimeter lengths for each polygon specified in the input array.

Parameters
graphics:Array — Array of graphics.
 
responder:IResponder (default = null) — The responder to call on result or fault.

Returns
AsyncToken

See also

buffer()method 
public function buffer(bufferParameters:BufferParameters, responder:IResponder = null):AsyncToken

The buffer operation is performed on a geometry service resource. The result of this operation is buffer polygons at the specified distances for the input geometry array. An option is available to union buffers at each distance.

Parameters
bufferParameters:BufferParameters — Set the features, distances, units, and other parameters for the buffer operation.
 
responder:IResponder (default = null) — The responder to call on result or fault.

Returns
AsyncToken

See also

labelPoints()method 
public function labelPoints(graphics:Array, responder:IResponder = null):AsyncToken

The labelPoints operation is performed on a geometry service resource (only available with ArcGIS Server 9.3 Service Pack 1 or above).

Parameters
graphics:Array — Array of graphics.
 
responder:IResponder (default = null) — The responder to call on result or fault.

Returns
AsyncToken

See also

lengths()method 
public function lengths(graphics:Array, responder:IResponder = null):AsyncToken

The lengths operation is performed on a geometry service resource. This operation calculates the lengths of each polyline specified in the input array.

Parameters
graphics:Array — Array of graphics.
 
responder:IResponder (default = null) — The responder to call on result or fault.

Returns
AsyncToken

See also

project()method 
public function project(graphics:Array, outSpatialReference:SpatialReference, responder:IResponder = null):AsyncToken

Projects a set of graphics into a new spatial reference. On completion, the projectComplete event is fired and the optional callback function is invoked. Both the callback and event handlers receive an array of Graphic that contains the projected geometries.

Parameters
graphics:Array — Array of graphics.
 
outSpatialReference:SpatialReference — The output spatial reference.
 
responder:IResponder (default = null) — The responder to call on result or fault.

Returns
AsyncToken

See also

relation()method 
public function relation(graphics1:Array, graphics2:Array, spatialRelationship:String, comparisonString:String = null, responder:IResponder = null):AsyncToken

The relation operation is performed on a geometry service resource. (only available with ArcGIS Server 9.3 Service Pack 1 or above).

To find out more about using spatialRelationship=SPATIAL_REL_RELATION, read more about the Shape Comparison Language (e.g., RELATE(G1, G2, "FFFTTT)).

Parameters
graphics1:Array — Array of first set of graphics.
 
graphics2:Array — Array of first set of graphics.
 
spatialRelationship:String — The spatial relationship to test for (see 12 constants below).
 
comparisonString:String (default = null) — The Shape Comparison Language string to be evaluated if spatialRelationship is SPATIAL_REL_RELATION ("esriGeometryRelationRelation").
 
responder:IResponder (default = null) — The responder to call on result or fault.

Returns
AsyncToken

See also

simplify()method 
public function simplify(graphics:Array, responder:IResponder = null):AsyncToken

Alters the given geometries to make their definitions topologically legal with respect to their geometry type. On completion, the simplifyComplete event is fired and the optional callback function is invoked. Both the callback and event handlers receive an array of Graphic that contains the simplified geometries.

Note: The XY tolerance property of the geometry's associated spatial reference is used during the simplify operation for polylines and polygons, which might slightly change exact locations.

Parameters
graphics:Array — Array of graphics.
 
responder:IResponder (default = null) — The responder to call on result or fault.

Returns
AsyncToken

See also

Event detail
arealengthsCompleteevent 
Event object type: com.esri.ags.events.GeometryServiceEvent
GeometryServiceEvent.type property = com.esri.ags.events.GeometryServiceEvent.AREA_LENGTHS_COMPLETE

Dispatched when an areasAndLengths task successfully completes.

Defines the value of the type property of an areaLengthsComplete event object.

bufferCompleteevent  
Event object type: com.esri.ags.events.GeometryServiceEvent
GeometryServiceEvent.type property = com.esri.ags.events.GeometryServiceEvent.BUFFER_COMPLETE

Dispatched when a buffer task successfully completes.

Defines the value of the type property of a bufferComplete event object.

faultevent  
Event object type: mx.rpc.events.FaultEvent

Dispatched when a GeometryService request fails. Applies to all methods.

labelPointsCompleteevent  
Event object type: com.esri.ags.events.GeometryServiceEvent
GeometryServiceEvent.type property = com.esri.ags.events.GeometryServiceEvent.LABEL_POINTS_COMPLETE

Dispatched when a labelPoints task successfully completes.

Defines the value of the type property of a labelPointsComplete event object (note: labelPoints() is only available with ArcGIS Server 9.3 Service Pack 1 or above).

lengthsCompleteevent  
Event object type: com.esri.ags.events.GeometryServiceEvent
GeometryServiceEvent.type property = com.esri.ags.events.GeometryServiceEvent.LENGTHS_COMPLETE

Dispatched when a lengths task successfully completes.

Defines the value of the type property of a lengthsComplete event object.

projectCompleteevent  
Event object type: com.esri.ags.events.GeometryServiceEvent
GeometryServiceEvent.type property = com.esri.ags.events.GeometryServiceEvent.PROJECT_COMPLETE

Dispatched when a projection task successfully completes.

Defines the value of the type property of a projectComplete event object.

relationCompleteevent  
Event object type: com.esri.ags.events.GeometryServiceEvent
GeometryServiceEvent.type property = com.esri.ags.events.GeometryServiceEvent.RELATION_COMPLETE

Dispatched when a relation task successfully completes.

Defines the value of the type property of a relationComplete event object (note: relation() is only available with ArcGIS Server 9.3 Service Pack 1 or above).

simplifyCompleteevent  
Event object type: com.esri.ags.events.GeometryServiceEvent
GeometryServiceEvent.type property = com.esri.ags.events.GeometryServiceEvent.SIMPLIFY_COMPLETE

Dispatched when a simplify task successfully completes.

Defines the value of the type property of a simplifyComplete event object.

Constant detail
SPATIAL_REL_COINCIDENCEconstant
public static const SPATIAL_REL_COINCIDENCE:String = "esriGeometryRelationLineCoincidence"

The boundaries of the geometries must share an 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.

SPATIAL_REL_CROSSconstant 
public static const SPATIAL_REL_CROSS:String = "esriGeometryRelationCross"

Two polylines cross if they share only points in common, at least one of which is not an endpoint. A polyline and a polygon cross if they share a polyline in common on the interior of the polygon which is not equivalent to the entire polyline. Cross is a Clementini operator. If either one of the geometries is empty, the geometries do not cross.

SPATIAL_REL_DISJOINTconstant 
public static const SPATIAL_REL_DISJOINT:String = "esriGeometryRelationDisjoint"

Two geometries are disjoint if their intersection is empty. Two geometries intersect if disjoint is "false". Disjoint is a Clementini operator.

SPATIAL_REL_INconstant 
public static const SPATIAL_REL_IN:String = "esriGeometryRelationIn"

The base geometry is within the comparison geometry if the base geometry is the intersection of the geometries and the intersection of their interiors is not empty. Within is a Clementini operator. Within is the opposite operator of contains. An empty geometry is within another geometry, unless the other geometry is empty.

SPATIAL_REL_INTERIORINTERSECTIONconstant 
public static const SPATIAL_REL_INTERIORINTERSECTION:String = "esriGeometryRelationInteriorIntersection"

Geometries intersect excluding boundary touch.

SPATIAL_REL_INTERSECTIONconstant 
public static const SPATIAL_REL_INTERSECTION:String = "esriGeometryRelationIntersection"

Geometry interiors intersect or boundaries touch, same as 'not disjoint'.

SPATIAL_REL_LINETOUCHconstant 
public static const SPATIAL_REL_LINETOUCH:String = "esriGeometryRelationLineTouch"

Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. This evaluates if the touch occurs along a boundary (not a point). Valid for polygons.

SPATIAL_REL_OVERLAPconstant 
public static const SPATIAL_REL_OVERLAP:String = "esriGeometryRelationOverlap"

Two polylines share a common sub-line, or two polygons share a common sub-area. Overlaps is a Clementini operator. Two geometries do not overlap if either one is empty.

SPATIAL_REL_POINTTOUCHconstant 
public static const SPATIAL_REL_POINTTOUCH:String = "esriGeometryRelationPointTouch"

Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. This evaluates if the touch occurs at a point (not a boundary).

SPATIAL_REL_RELATIONconstant 
public static const SPATIAL_REL_RELATION:String = "esriGeometryRelationRelation"

Allows specification of any relationship defined using the Shape Comparison Language.

SPATIAL_REL_TOUCHconstant 
public static const SPATIAL_REL_TOUCH:String = "esriGeometryRelationTouch"

The union of esriGeometryRelationPointTouch and esriGeometryRelationLineTouch. Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. Touches is a Clementini operator. For example, a point touches a polyline only if the point is coincident with one of the polyline end points. If either one of the two geometries is empty, the geometries are not touched.

SPATIAL_REL_WITHINconstant 
public static const SPATIAL_REL_WITHIN:String = "esriGeometryRelationWithin"

Same as esriGeometryRelationIn but also allows polylines that are strictly on the boundaries of polygons to be considered 'in' the polygon.