Best way to select features within features

4094
11
Jump to solution
07-17-2015 07:27 AM
TimWitt2
MVP Alum

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

0 Kudos
11 Replies
RobertScheitlin__GISP
MVP Emeritus

OK, then use this:

map.on('layer-add-result', function (evt){  
  var mp = new Multipoint();
  array.map(evt.layer.graphics, function(gra){
    mp.addPoint(gra.geometry);
  });
});
RickeyFight
MVP Regular Contributor

Tim,

Are you thinking something like this?

Webapp- Show points within a selected polygon