JavaScript 3.27 API - Buffer tool isn't buffering to the correct distances

162
2
Jump to solution
02-27-2019 09:21 AM
CarlTownsend1
New Contributor III

I've been using the JS 3.27 api buffer tool:
https://developers.arcgis.com/javascript/3/jssamples/util_buffergraphic.html

I've got it working in my custom map, but the buffer sizes are wrong. For example, I've done a buffer of 1600 metres, but when I measure it, it is about 1900 metres. It's not the measure tool, because I've buffered some grid roads, the distances of which are 1600 metres apart, so when I buffer a line in the middle, it goes over by about 150m on each side

 I've measured other buffers and they are wrong too, by about 20%.

Have a look at my attachment, it shows two grid roads (north-south), 1,600 metres apart. The buffer was supposed to be 1,600 metres wide, but when measured it is around ,1900 metres.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Carl,

   If your map is Geographic or WebMercator then you need to use 

params.geodesic = true;

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Carl,

   If your map is Geographic or WebMercator then you need to use 

params.geodesic = true;
0 Kudos
CarlTownsend1
New Contributor III

Thanks so much! That has fixed the problem! I sort of suspected something like that, but that parameter wasn't in the code to begin with.

0 Kudos