Select to view content in your preferred language

Snapping / Generalized geometry returned from QueryFeaturesAsync

1047
2
Jump to solution
02-08-2021 12:25 PM
JeffSiemens
Emerging Contributor

Hi,

Our team has developed a snapping tool. It works on FeatureLayers. We find a snappable point using FeatureTable.QueryFeaturesAsync() with QueryParameters. This is run every time the user moves the pointer to find a new snapping point. We have found that for online polygons and polygons, the geometries returned from this method are generalized, so we're not getting the real full geometry back. This is obviously really bad for snapping because it means that the point we're snapping to isn't a real point. We have discovered that if you query a ServiceFeatureTable and pass in QueryFeatureFields.LoadAll as an argument, then we get the real full geometry. This is surprising. Also, if we use MapView.IdentifyLayersAsync instead of QueryFeatutresAsync(), then we are also able to get the full geometry. The problem is that in both cases (ServiceFeatureTable.QueryFeaturesAsync with QueryFeatureFields.LoadAll and MapView.IdentifyLayersAsync), that while it does get the real geometry, it also performs a network request to do so. The entire method call, including the network request, proves sufficiently slow that snapping bogs down heavily and eventually just freezes up. So this isn't a viable solution.

So we can have accurate, but slow retrieval of geometries, or we can have have but inaccurate. Is there anyway to have both fast and accurate as is needed for snapping?

I also find it surprising that the ArcGIS Runtime would at any point return generalized geometry as a result of calling a Query method. 

0 Kudos
1 Solution

Accepted Solutions
MichaelBranscomb
Esri Frequent Contributor

Hi Jeff,

The behavior you're seeing was introduced with tiled requests for features: https://www.esri.com/arcgis-blog/products/developers/announcements/announcing-arcgis-runtime-100-9/....

Feature tiles uses a combination of parameters to request features with geometry resolution appropriate for the display scale. It significantly improves performance and allows for the retrieval and display of more features in the view making it great for display. But the tradeoff is lower resolution geometries. 

For editing/snapping scenarios where you need the full resolution geometry you can disable feature tiles by setting the FeatureLayer.TilingMode Property to Disabled.

View solution in original post

0 Kudos
2 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi Jeff,

The behavior you're seeing was introduced with tiled requests for features: https://www.esri.com/arcgis-blog/products/developers/announcements/announcing-arcgis-runtime-100-9/....

Feature tiles uses a combination of parameters to request features with geometry resolution appropriate for the display scale. It significantly improves performance and allows for the retrieval and display of more features in the view making it great for display. But the tradeoff is lower resolution geometries. 

For editing/snapping scenarios where you need the full resolution geometry you can disable feature tiles by setting the FeatureLayer.TilingMode Property to Disabled.

0 Kudos
JeffSiemens
Emerging Contributor

Thanks Mike! That's exactly what I was looking for!

0 Kudos