Visible precision errors when clipping using AGSGeometryEngine.difference

1313
10
10-04-2022 02:36 AM
frankm
by
Occasional Contributor

Hi,

I am trying to figure out an issue we are having relating to clipping overlapping geometries in features. When we add new features with geometries, we allow the user to "clip" the new geometry with others that overlap the new geometry. We use AGSGeometryEngine.difference to create a new geometry and then store the new feature. However, the resulting geometry is then adjusted by the SDK (I believe the issue could be the featureTable.addFeature-method "simplifying" the geometry when saving, the docs mentions this).

The end result is a visible error in precision with either overlap or gaps between the geometries. Does anyone know of a way around this or are we hitting some precision limit in the spatial reference being used here? It only happens when being in "online" mode, if we work on offline-maps, all is well - until we go online 🙂

I had a theory the problem was we were comparing already saved geometries with unsaved, and that if we created the new feature first, then clipped it would work better, but it does not seem to matter.

0 Kudos
10 Replies
frankm
by
Occasional Contributor

Just wanted to specify the (possible solution), by doing the additional clipping: here I meant to first do the difference with object A and B and then perform the opposite difference, object B and A. Specifically Load() then set the new geometry (result from difference()) and perform Update() after each clip, then finish with applyEdits() when both operations are complete. This seems to move everything in the correct place without gaps or overlaps.

0 Kudos