Select to view content in your preferred language

Arcade negative Buffer returns null

656
5
Jump to solution
11-25-2024 11:09 PM
Labels (3)
Jan62
by
Emerging Contributor

I am trying to create a negative Buffer in Arcade to query features inside, as it was possible in older versions (2022). When I execute it noch for example in the Arcade Playground "null" is returned instead of a shrink polygon.

To reproduce open the Arcade Playground https://developers.arcgis.com/arcade/playground/  and insert

 

var poly = Polygon(
  {
    rings: [
      [
        Point(
          {
            x: -97.06138,
            y: 32.837,
            z: 100,
            hasZ: true,
            spatialReference: { wkid: 3857 }
          }
        ),
        Point(
          {
            x: -97.06133,
            y: 32.836,
            z: 50,
            hasZ: true,
            spatialReference: { wkid: 3857 }
          }
        ),
        Point(
          {
            x: -97.06124,
            y: 32.834,
            z: 20,
            hasZ: true,
            spatialReference: { wkid: 3857 }
          }
        ),
        Point(
          {
            x: -97.06127,
            y: 32.832,
            z: 0,
            hasZ: true,
            spatialReference: { wkid: 3857 }
          }
        )
      ]
    ],
    hasZ: true,
    spatialReference: { wkid: 3857 }
  }
);

Buffer(poly, -10) //return null
//BufferGeodetic(poly, -10) //return null

 

 Is this a bug or intention?

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

then the buffer size is too large relative to the size of the polygon (eg. bigger than its extent)


... sort of retired...

View solution in original post

0 Kudos
5 Replies
DanPatterson
MVP Esteemed Contributor

not sure about arcade but most polygon geometry usually has a duplicate first and last point, what you have given could be interpreted as a polyline


... sort of retired...
0 Kudos
Jan62
by
Emerging Contributor

Yes but it's the example polygon of the Arcade Playground. The result is also null if i add the first point at the end.

0 Kudos
DanPatterson
MVP Esteemed Contributor

then the buffer size is too large relative to the size of the polygon (eg. bigger than its extent)


... sort of retired...
0 Kudos
Jan62
by
Emerging Contributor

Yeah you are right the polygon was to small. (why is the default playground polygon so small?). This was also the error for the "Attribute Rule" I wanted to save. If the buffer is -1 (meters), the verification of the arcade statement fails. Under -0.3 the expression is valid.

Wich polygon is used for the statement verification in attribute rules in Pro 3.3?

0 Kudos
DanPatterson
MVP Esteemed Contributor

It would be prudent to calculate the poly extent in planar coordinates prior to trying a negative buffer.  At least the extent would give you the ability to assess other values like perimeter, area and other possible measures.


... sort of retired...
0 Kudos