expected linear unit for angular unit or vice versa

3794
2
Jump to solution
12-15-2015 09:07 AM
roberttilson
New Contributor II

Hi,

I'm trying to buffer a simple point, which works fine, but when I set the Unit to UNIT_NAUTICAL_MILE, I get the following error: 'wrong unit type (expected linear unit for angular unit or vice versa)'.

I am calling the buffer feature of the Geometry service in ArcGIS Server.

Thanks

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
roberttilson
New Contributor II

Thanks Jeff,

In the end I realized I needed to specify the bufferSpatialReference if specifying the units, and was able to replicate using the test harness. The UNIT_NAUTICAL_MILE constant resolved to 9030, so don't think it would matter which I used.

It's now working OK, but will look at the Geometry Engine solution as well.

Thanks

View solution in original post

2 Replies
JeffJacobson
Occasional Contributor III

I would recommend using the geometryEngine to do the buffering instead, because it does the work client-side, eliminating the call to the geometry service.

If you need to use the geometry service for some reason, though, the first thing I would try is explicitly using the numerical value 9030 instead of the esri/tasks/GeometryService.UNIT_NAUTICAL_MILE constant to make sure that you're not somehow using the wrong constant.

roberttilson
New Contributor II

Thanks Jeff,

In the end I realized I needed to specify the bufferSpatialReference if specifying the units, and was able to replicate using the test harness. The UNIT_NAUTICAL_MILE constant resolved to 9030, so don't think it would matter which I used.

It's now working OK, but will look at the Geometry Engine solution as well.

Thanks