geometry service distance calculation between two geometries

302
2
Jump to solution
09-13-2021 08:54 AM
ChitraKrishnan
New Contributor III

Hi,

I am getting below error while running the geometry service to calculate distance btw two geometries.

Unable to complete operation.
The operation was attempted on an empty geometry.

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer/distanc...
?sr=4326
&geometry1=-106.61%2C+35.1107
&geometry2=-108.61%2C+35.1107
&geodesic=true
&distanceUnit=MILE
&f=html

Any help would be greatly appreciated.

Thanks

Chitra

 

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor II

Here is the documentation for the distance operation.

https://developers.arcgis.com/rest/services-reference/enterprise/distance.htm

You need to pass the geometries as shown.

{
  "geometryType" : "esriGeometryPoint",
  "geometry" : 
  {
    "x" : -95.23, "y" : 31.71;
  }
}

There's an example URL at the bottom of the page for reference.

View solution in original post

0 Kudos
2 Replies
ReneRubalcava
Frequent Contributor II

Here is the documentation for the distance operation.

https://developers.arcgis.com/rest/services-reference/enterprise/distance.htm

You need to pass the geometries as shown.

{
  "geometryType" : "esriGeometryPoint",
  "geometry" : 
  {
    "x" : -95.23, "y" : 31.71;
  }
}

There's an example URL at the bottom of the page for reference.

0 Kudos
ChitraKrishnan
New Contributor III

that works. Thank you very much for the link to the documentation.

-Chitra

0 Kudos