Improved Arcade Speed for Intersects with FeatureSetByName - Large Datasets

681
2
Jump to solution
09-09-2022 02:31 PM
Labels (1)
RyanBohan
Occasional Contributor III

I have a parcel pop-up and would like to include Flood Zone information from the FEMA Rest Service

The FEMA Rest Service is huge 3,981,995 records, and seems to slow down when demand peaks, taking up to a minute to return.  I am trying to optimized my arcade

var Overlay = Intersects(FeatureSetByName($map,"NFHL - Flood Hazard Zones",['FLD_ZONE'],true),$feature);

It was suggested to exclude geometry.  This seems to work, and goes much faster.  

var Overlay = Intersects(FeatureSetByName($map,"NFHL - Flood Hazard Zones",['FLD_ZONE'],false),$feature);

How does the Intersects work with out the geometry?  It's great that is faster, but I do not understand how it is working.

Any other tips to improve the Arcade speed when working with a Rest Service would be great.

Thank you

 

1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

When the code is executed, it submits a query to the service's REST endpoint. When you query a service, you can use a geometry to subset your results, which is what Intersect is doing. This is quite different from your query's returnGeometry parameter being set to True, which is what that last true in the featureset function is doing.

If I recall, submitting a spatial relationship with the query relies on your layer's spatial index and happens on the server side, so it's able to perform fairly quickly. Returning the geometry requires that each individual feature needs to be returned as a Geometry object to your map. Especially for large-feature layers like the Flood Hazard Zones, that requires a lot of data to be transmitted.

Anything you can do to limit the amount of data passing back and forth from other endpoints will improve things. You can take a look at your browser's Network tab to see what requests it's sending, and the volume of data being exchanged.

- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Esteemed Contributor

When the code is executed, it submits a query to the service's REST endpoint. When you query a service, you can use a geometry to subset your results, which is what Intersect is doing. This is quite different from your query's returnGeometry parameter being set to True, which is what that last true in the featureset function is doing.

If I recall, submitting a spatial relationship with the query relies on your layer's spatial index and happens on the server side, so it's able to perform fairly quickly. Returning the geometry requires that each individual feature needs to be returned as a Geometry object to your map. Especially for large-feature layers like the Flood Hazard Zones, that requires a lot of data to be transmitted.

Anything you can do to limit the amount of data passing back and forth from other endpoints will improve things. You can take a look at your browser's Network tab to see what requests it's sending, and the volume of data being exchanged.

- Josh Carlson
Kendall County GIS
RyanBohan
Occasional Contributor III

Thank you @jcarlson your explanation makes sense.  You are correct it is much faster when the geometry is excluded. 

I was getting the input and output confused.  The query do the intersection, and the part in blue is the  results.  As my arcade as no further need for the geometry no reason to return it, so False would be quicker.

RyanBohan_0-1663001317786.png

Thank you!  I think I get it now

0 Kudos