Select to view content in your preferred language

geometryEngine.geodesicBuffer gives error "not implemented" when creating buffer for a layer

1767
3
03-10-2021 04:47 AM
MichaelLev
Frequent Contributor

in my code I do:

var buffers = geometryEngine.geodesicBuffer(
          geometries, // geometries
        [bufferDistance], // distance
        "meters", // unit
         true // unionResults into SINGLE polygon
);

But suddenly, for new layers, I get error msg "Not Implemented".

What in the layer(s) can cause such an error?

0 Kudos
3 Replies
MichaelLev
Frequent Contributor

Dear Robert

can you help please?

0 Kudos
MichaelLev
Frequent Contributor

From my trials I understand that

if the layer spatial reference is 102100 (that is 3857 WGS 1984 Web Mercator) then from its geometries then I can create a buffer, by the code above,

but

if the layer spatial reference is wkid:2039 (Israel TM Grid) then when I try to create a buffer from its geometries by the code above, I get the error mentioned above.

So, what should I do? I need to create a buffer, and I need  spatial reference = wkid:2039 (Israel TM Grid) in order that the automatic computed area for polygons will be correct.

Help will be gereatly appreciated!

Michael 

 

0 Kudos
Maarten-de-Rijk
New Contributor

Hi Michael, 

I was having a similar problem. My solution was to use buffer() instead of geodesicBuffer(). 

From the documentation:

The GeometryEngine has two methods for buffering geometries client-side: buffer and geodesicBuffer. Use caution when deciding which method to use. As a general rule, use geodesicBuffer if the input geometries have a spatial reference of either WGS84 (wkid: 4326) or Web Mercator. Only use buffer (this method) when attempting to buffer geometries with a projected coordinate system other than Web Mercator. 

This worked for me:

 

 const point = new Point({
    type: "point",
    x: 187043,
    y: 333702,
    spatialReference: {
      wkid: 28992
    }
  });

  let buffer = geometryEngine.buffer(point, 100, "meters");

 

 

0 Kudos