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.
Solved! Go to Solution.
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.
supposedly fixed, but worth the look
BUG-000123225: Cannot use geometry with WGS 84 (wkid 4326) spatial .. (esri.com)
Thanks Dan, although it looks like this question is specifically about ArcGIS Runtime SDK for .NET rather than ArcGIS Pro.
Guess I assumed the geometry engine would be built the same regardless of platform 😉
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.
This issue should have been resolved in the 100.13 release - can you try updating to that version (or the latest) and retesting?
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.
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.