You are here: > ESRI Forums > arcgis explorer discussion forums > Thread Replies

ArcGIS Explorer Discussion Forums

ArcGIS Explorer: SDK Developers forum

Spatial query on multiple geometries   Benjamin Falletti Dec 10, 2009
Re: Spatial query on multiple geometries   mike rudden Dec 14, 2009
Re: Spatial query on multiple geometries   Benjamin Falletti Dec 20, 2009
Re: Spatial query on multiple geometries   mike rudden Dec 21, 2009
Re: Spatial query on multiple geometries   Benjamin Falletti Jan 27, 2010
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Spatial query on multiple geometries 
Author Benjamin Falletti 
Date Dec 10, 2009 
Message Hi all

I'm trying to perform a spatial query to return the features from a feature layer that intersect all features from another feature layer (similar to a "select by location" in ArcMap).

From the SDK documentation I can see how to perform the search method (see sample code below).

//Perform a spatial query to find all mountains contained within the Edinburgh region

//get row for Edinburgh from Regions table
Row edinRow = regionsTable.GetRow(5);

//perform a spatial search
rows = mountainsTable.Search(new Filter(edinRow.Geometry, FilterSearchOptions.Contains));

My problem is I'd like to pass the geometry of the entire feature class (shapefile), and not just from a specific row. In the above example the search/spatial query is based on the geometry of edinRow only.
How can I get a geometry object for an entire table/feature layer?

Thanks
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Spatial query on multiple geometries 
Author mike rudden 
Date Dec 14, 2009 
Message Hi,

Unfortunately the Explorer API does not support layer on layer processing nor does it have a Union method which would allow you to create a shape representing all the features in one of your layers. (There is actually a GeometryOperations.Union method but it only accepts Envelope objects so unless your features were rectangular this wouldn't be appropriate).

However, there are a few possible ways you could work around this limitation:

1. If you have access to ArcGIS server then the best solution would be to set up a Geoprocessing service that performs the analysis. The SoaperConverter class would help you convert between ArcGIS Explorer geometry types and ArcGIS Server types. http://resources.esri.com/help/900/arcgisexplorer/sdk/html/7cae097c-6e76-e6b4-6814-88b341b8934a.htm

2. You could perform multiple searches in a loop, taking each geometry from one of the layers in turn. You'd have to process for duplicate results afterwards. This would only really be an option if the search geometry Table only has a small number of rows.

3. You could create a new single search geometry. Create a new Polygon then iterate over each geoemtry in turn, use the appropriate method (AddRing, AddPoints) on the Polygon class to add each existing geometry to build up the new single Polygon. Unfortunately there also isn't a way to perform a dissolve though. 
  Mike Rudden
ESRI 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Spatial query on multiple geometries 
Author Benjamin Falletti 
Date Dec 20, 2009 
Message Mike

Thanks for your reply.

I was successful in implementing a solution for the spatial query following your second suggested work around. I used the GetRows(Int32[]) method, passing an array of ObjectID value, to come up with a unique set of search results. Not very efficient, as the search method is called numerous times, but it works great nonetheless.

I also experimented with suggestion #3, i.e. creating a single geometry object to base the search on, but didn’t quite get a satisfying result (close, but not good enough). I would not recommend this option.

Finally I haven’t yet had the chance to try the first work around but I can see why you’re suggesting it is the best solution, as ultimately ArcGIS Explorer is designed primarily for consuming services and not so much for doing client-side geoprocessing. I haven’t yet tried using the SoapConverter class, but it seems simple enough. However I’d like to know if the next release of ArcGIS Explorer will provide the ability to add and consume a geoprocessing task without the need for a developer to build an interface specifically for this purpose, just like we were able to do with ArcGIS Explorer 500. Thanks for letting me know if ESRI will provide this functionality.

Regards,

Ben Falletti
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Spatial query on multiple geometries 
Author mike rudden 
Date Dec 21, 2009 
Message Hi Ben,

I can confirm that being able to run a Geoprocessing tool in the Explorer application is currently being worked on. It will provide a similar experience to that provided previously in 500, but within the context of the new application framework (i.e dockable windows, buttons, galleries). Unfortunately at this time, I cannot confirm for sure whether this will be part of the next release or not.

Regards 
  Mike Rudden
ESRI 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Spatial query on multiple geometries 
Author Benjamin Falletti 
Date Jan 27, 2010 
Message Thanks Mike, this is good news.

Ben Falletti