Getting extremely small values from Area and Lengths online REST service

694
2
02-11-2021 07:49 AM
PaulvanHagen
New Contributor

Hello,

I'm quite new to using GIS in general and conscious of some ignorance on my side but here's the problem: I'm trying to use the online ArcGIS REST service to calculate areas and lengths of polygons. I'm working in WGS84 (ECGS:4236) coordinate system. I've been trying to get the same done using the Google Maps JS API but that requires to physically build HTML content and bootstrap the API from there. I don't like that and don't need that. Hence, my experiment with ArcGIS.

Based on the tutorials for the geometry "Areas and Lengths" service I constructed the following polygon definition:

[{"rings":[[[4.4598942,52.0477526],[4.4603368,52.0477295],[4.4618683,52.0451429],[4.4592317,52.0445375],[4.4598942,52.0477526]]]}]

This describes a small polygon area of my neighborhood in world coordinates (longitude, latitude).

I have passed the areaUnit as: {"areaUnit" : "esriHectares"} and the lengthUnit as 9001 (International meter).

I'm passing 4326 as the WKID to match the world coordinate system.

The response I get back from the API call is the following (in JSON):

{"areas":[1.3990022088844E-13],"lengths":[0.000164707662238204]}

The value are extremely small and not according my expectations. Both in QGIS and Google Maps the area should be around 3.5 Ha.

I've been using the following URL: http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/areasAndLengths

I've been playing with the ring definition, e.g. swapping coordinates and making sure the winding order is clockwise. I've also played with different coordinate systems and area units but still getting back values that don't make sense.

I would appreciate some guidance from the GIS experts here in telling me what I'm doing wrong.

Thanks for your help.

--Paul

0 Kudos
2 Replies
DavidPike
MVP Frequent Contributor

I think it needs to be projected from the geographic coordinate system (WGS84) first.

I used the project method of the geometry server with the following (GET is in the URL) Project (GeometryServer) (arcgisonline.com)

I just used UTM Zone 32 (32632) - as it looks about that area - also N.B. with no transformation defined. You could of course use a better local projection and transformation.

It gave me the following UTM 32 coords:

[{"rings": [[
 [
  188847.49508755904,
  5775784.331175954
 ],
 [
  188662.59842636256,
  5775728.359224541
 ],
 [
  188730.37223520142,
  5776082.8376690475
 ],
 [
  188760.54062178195,
  5776078.371437502
 ],
 [
  188847.49508755904,
  5775784.331175954
 ]
]]}]

the GET in the Area and Lengths - Areas and Lengths (Geometry) (arcgisonline.com)

This yielded:

Areas: 3.51154050112513
Lengths: 891.207370500902

Not perfect, but pretty close I guess, and possibly a way ahead.

0 Kudos
PaulvanHagen
New Contributor

Hi David,

Thanks for your prompt reply. That should be it. I just wasn't aware that this was required but it makes a lot of sense. I'm from the Netherlands and the standard projection system there is EPSG:28992 (Bessel 1841). Let me try as you propose. The numbers that came out of your test are indeed very close.

Thanks again. --Paul