How to create Spatial Query with multiple layers?

1083
1
Jump to solution
03-08-2014 10:49 PM
MostafaElhalwagy1
New Contributor
my challenge in my work, how to create spatial query with multiple layers, i want to crate one button for spatial query tool, to make a query in three layers like this "Regions, Governorates, Security Services", when i want to select a specific region name layer it automatic update list for governorates only for this Region, also auto update list value for Security Services layer that contains for example (Police Station, Security Patrol, Traffic.....etc), i do not have any background for developing arcgis for silverlight or api for silverlight,only i know it depending on c# language, so can any one helping me, i just want to a guideline, and if any one want to the layers to test it, i can uploading it.
thank you
0 Kudos
1 Solution

Accepted Solutions
BrentHoskisson
Occasional Contributor III
If what you want is to click on the map and select all features from several layers, you will want to use the "FindTask".  This allows for a range of layer id's in one service.

If what you want is to send in an attribute, street name for example, and find everything in several layers that references that street name, you can use the "QueryTask", but you will have to send in one layer at a time, collect the results into a custom class, then run a query on the next layer and add those result to your custom class and repeat until all of your layers have been checked.  When all layers have been collected, bind to your custom class.  QueryTask doesn't allow multiple layers by default because most people have completely different attributes in their layers.

Good Luck

View solution in original post

1 Reply
BrentHoskisson
Occasional Contributor III
If what you want is to click on the map and select all features from several layers, you will want to use the "FindTask".  This allows for a range of layer id's in one service.

If what you want is to send in an attribute, street name for example, and find everything in several layers that references that street name, you can use the "QueryTask", but you will have to send in one layer at a time, collect the results into a custom class, then run a query on the next layer and add those result to your custom class and repeat until all of your layers have been checked.  When all layers have been collected, bind to your custom class.  QueryTask doesn't allow multiple layers by default because most people have completely different attributes in their layers.

Good Luck