Buffering zero distance

219
2
09-14-2023 07:23 AM
JonathanKressin
New Contributor III

 

Hello,

I wanted to check if anyone else has a situation where they allow a zero distance buffer on a selected feature.   I wrote a buffer tool for Web Experience Builder, and originally a user setting the distance to zero just captured all features within the buffered geometry.  However, since going live with this project, the call go GeometryService.buffer returns the following error:

{
"error": {
"code": 400,
"extendedCode": -2147220889,
"message": "Unable to complete operation.",
"details": [
"An error occurred during the buffer operation"
]
}
}

I'm wondering if this is a bug in Server with our geometry service or if this is just a limitation on the buffer call.  

Thanks!

Jonathan

 

0 Kudos
2 Replies
BhavinSanghani
Occasional Contributor II

@JonathanKressin Can you query the selected feature with some criteria instead of calling buffer() whenever the distance is 0? Alternatively, you can keep very small distance to create buffer whenever the distance is 0. e.g. 0.01 feet. 

I am not sure about the Experience Builder and how it works in your scenario. This is just a suggestion if it works for you. 

0 Kudos
JonathanKressin
New Contributor III

Behind the scenes, Experience Builder widgets are just Javascript (with layers on top, but still Javascript) and using the standard API calls.  That is why I am posting this here instead of in the EB developer boards as it really isn't an EB problem.

Even at 0.01 feet, if I buffer a parcel, I'll grab all the surrounding parcels which we don't want it to do.  

To your other suggestion, the buffer tool I wrote allows selection of both the selection and target layers to buffer any of the data in the app.  I still need to analyze features within the selected feature so couldn't just return a single features data.  However, in the same line of thought, I guess if distance was zero, I could perform an intersect instead of a buffer and feed the results to the same function afterwards.  

Still, it would be handy to know if anyone else has tried the buffer with a zero distance and if it works or not in their environment.


Thanks!

Jonathan

 

 

0 Kudos