Select to view content in your preferred language

Error using GeometryService's Relation: specified geometry is  in the correct format.

993
3
Jump to solution
10-25-2012 08:18 AM
xiannianchen
Deactivated User
Hi,

I am trying to use the build-in geometry service to do a spatial relation with two graphics.The situation is like this:

I have temporary point graphics on a graphics layer. I want to draw another polygon to select some of those point graphics. Because the point graphics and the polygon I drew are on a graphics layer and not a layer from a map service, I decided to (or have to) use the GeometryService's Relation method do accomplish this task.

The three key parameters for RELATION method: geometries1 is set to the geometry array of the point graphics, geometries2 is set to the geometry of the polygon, and the spatialRelationship has no any trick.

But, I always got the error msg stating that: Unable to complete Relation operation.

The fault detail is: The specified geometry is not in the correct format.

I am basically following the ESRI sample: Determine Spatial Relationships.
I have found one thing different between my case and the sample: in the sample, the geometry of parameter of geometries2 has extent. But in my case, for the same parameter, for the polygon I drew, the geometry has no extent (or extent is valued as NULL).

Any help will be appreciated.

Mike
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Mike,

   I am not seeing where you need to (or can at all) use a geometry service for this. When you get your polygon geometry then you just use polygon.contains (see documentation here):

http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/geometry/Polygon.html

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Mike,

   I am not seeing where you need to (or can at all) use a geometry service for this. When you get your polygon geometry then you just use polygon.contains (see documentation here):

http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/geometry/Polygon.html
0 Kudos
xiannianchen
Deactivated User
Robert,

Thanks for the response and the other way to work around.

I will try on it, and will let you know whether it works or not.

Mike


Mike,

   I am not seeing where you need to (or can at all) use a geometry service for this. When you get your polygon geometry then you just use polygon.contains (see documentation here):

http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/geometry/Polygon.html
0 Kudos
xiannianchen
Deactivated User
Robert,

Thanks for the clue. It works. Good job.

Mike
0 Kudos