Select to view content in your preferred language

arcgis server geometry service distance returning INF

4077
2
03-12-2015 10:12 AM
WalterEralio
Occasional Contributor

this call to distance function in the geometry service is returning INF .. does anyone knows what it is and why??

After that since it's not a double it breaks my json mapping

Distance (GeometryServer)

sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer/distance?sr=43...

0 Kudos
2 Replies
XuehanJing
Occasional Contributor

Hello Walter,

The issue is the conflict of spatial reference and Distance Unit.

In your request, the Spatial reference was 4326 WGS - 84, which is Geographic Coordinate System (GCS), in angular unit. However your Distance Unit was 9002, which is international foot, in linear unit.

Based on documentation, If distanceUnit is not specified, the distance is in the units of the given spatial reference. If distanceUnit is specified, the unit must be compatible with the given spatial reference. That is, if sr is a PCS, then distanceUnit must be linear. If sr is a GCS, then distanceUnit must be angular.

If you remove distance unit from your REST endpoint, you will get the results.

Distance

http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Distance/02r3000000z3000000/

esriUnitType

http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constant...

GCS

http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300...

Hope the information is helpful.

Thanks,

Harvey

0 Kudos
WalterEralio
Occasional Contributor

Not really.. I think the problem is the geometry but I wonder what the INF is..
if you do the exact same query with another geometry it'll return the result (I have been testing this a lot)
Distance (GeometryServer)

0 Kudos