Select to view content in your preferred language

GeometryEngine.BufferGeodetic with negative distance returns always an exception

784
7
Jump to solution
08-08-2022 09:57 PM
CarstenSchumacher
New Contributor

Hello community, i hope you can help me.

I'm using arcgis runtime for .net (100.11.2). I have a simple polygon graphic (created from sketcheditor) and want to create a buffer inside the polygon.

When i use GeometryEngine.BufferGeodetic with a positive distance i get a new geometry with the buffer.

When i use GeometryEngine.BufferGeodetic with a negative distance i get always an exception with the message "distance". The API describes the possibility to use a negative value as distance.

My geometry has a spatial reference of WGS84 (Wkid: 4326). 

Does anyone know what the problem is? Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
CarstenSchumacher
New Contributor

Thanks Michael, actually its not possible to update to 100.13 or later. But i found another solution. I used the GeometryEngine.BufferGeodetic(Geometry, double, LinearUnit?, ...) method for creating a negative buffer but always not successfull. There is another method for creating a geodetic buffer --> GeometryEngine.BufferGeodetic(IEnumerable<Geometry>, IEnumerable<double>, LinearUnits?, ...). These method works with a negative distance. Thats my actual workaround.

View solution in original post

7 Replies
DanPatterson
MVP Esteemed Contributor

supposedly fixed, but worth the look

BUG-000123225: Cannot use geometry with WGS 84 (wkid 4326) spatial .. (esri.com)


... sort of retired...
0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Thanks Dan, although it looks like this question is specifically about ArcGIS Runtime SDK for .NET rather than ArcGIS Pro. 

0 Kudos
DanPatterson
MVP Esteemed Contributor

Guess I assumed the geometry engine would be built the same regardless of platform 😉


... sort of retired...
0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Well, a substantial amount of geometry is shared... so there's a good chance you were onto something.

But, digging a bit deeper, it appears the negative value check was over-zealous validation at the .NET API level and should have been resolved in the 100.13 release. 

MichaelBranscomb
Esri Frequent Contributor

This issue should have been resolved in the 100.13 release - can you try updating to that version (or the latest) and retesting?

CarstenSchumacher
New Contributor

Thanks Michael, actually its not possible to update to 100.13 or later. But i found another solution. I used the GeometryEngine.BufferGeodetic(Geometry, double, LinearUnit?, ...) method for creating a negative buffer but always not successfull. There is another method for creating a geodetic buffer --> GeometryEngine.BufferGeodetic(IEnumerable<Geometry>, IEnumerable<double>, LinearUnits?, ...). These method works with a negative distance. Thats my actual workaround.

MichaelBranscomb
Esri Frequent Contributor

I just double checked the API source code for 100.11.2 - what you found is correct, only the single geometry BufferGeodetic checked for and rejected negative values, the overload that takes `IEnumerable<Geometry>` does not check.

 

I'm curious why you can't update to 100.13 (or ideally 100.14.1) at this stage.

0 Kudos