Hey everybody,
I am looking for a way to select points from a feature layer that fall within this feature layer: Layer: Atl_slr_merged_2ft (ID: 6)
It sounds easy enough if you use ArcGIS Desktop but in javascript I am running into issues.
Using the method described here would work, union and then use the geometry of the union feature to select what falls within it. But if your feature layer has thousands of polygons, the union would take forever.
So my question is, am I approaching this issue wrong? Is my only option to union the layer before publishing it on a server ( which I sadly can't do, because I don't have the feature layer and rely on NOAA hosting it).
Any input would be greatly appreciated!
Thanks,
Tim
Solved! Go to Solution.
Tim,
I would tackle this in a multi-step solution then.
Tim,
You may need to consider your workflow for this. Do you really need to use all of the polygons from the NOAA map service in your app? Can you not set your workflow to minimize the intersect query before it is performed (i.e. have the user do some query to minimize the polygons evaluated or only query the polygons in the current map extent)?
Robert,
that might be an idea. Maybe I should have explained what my goal is.
I would like the user to be able to add their point featurlayer and see which points would fall within the flood zone.
Tim
Tim,
What does their point FL represent? Will it be a handful of points, hundreds, thousands?
Robert,
I would say anywhere between 10 - 200.
Tim,
I would tackle this in a multi-step solution then.
That is a great idea, I'll try that.
I just wish the javascript API had a similar tool like ArcGIS Desktop "Select by location"
Thanks!
One more question, how do I do step one?
I assume this happens here?
map.on('layer-add-result', function (evt){ //What code do I need? });
Tim,
Can one assume that the layer has been added as a FeayureLayer and thus you will have access to the layer geometry without doing a QueryTask?
Yes, it will be a FeatureLayer.