Select to view content in your preferred language

How to display a large number of query results on the graphicslayer?

2798
6
05-17-2011 12:51 PM
DanDong
Deactivated User
Hi guys,

I found that spatial query can only return up to 1000 results. I am not 100% sure on this....Does someone have a answer for this?

So my codes can only make 1000 results display on the graphicslayer...
MessageBox.Show(args.FeatureSet.Features.Count().ToString());
foreach (Graphic selectedGraphic in args.FeatureSet.Features)
{
       selectedGraphic.Symbol = LayoutRoot.Resources["DefaultLineSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
       graphicsLayer.Graphics.Add(selectedGraphic);
}


Appreciate that there maybe some ideas or thoughts on how to solve this 🙂
0 Kudos
6 Replies
wangzhifang
Frequent Contributor
ArcGIS Server 10 returns max 1000 records while querying, ArcGIS Server 9.3.1 and pre version returns 500.
This can be changed by modifying the service configuration file which is under <arcgis server install folder>/server/user directory. Change the <MaxRecordCount> tag, then restart your service.
Also can be done in Parameters tab in service properties dialog in AGS 10.
One thing you should pay attention to is that graphicslayer will get really stuck when adding more than about 2000 graphics in it. you should always use graphics cluster to display.
0 Kudos
weiliang
Deactivated User
Zhifang is right, but you still need to restart the ArcGIS Server SOM service after you change the .cfg file to make the change into effect.

Good luck,

Wei
0 Kudos
DanDong
Deactivated User
ArcGIS Server 10 returns max 1000 records while querying, ArcGIS Server 9.3.1 and pre version returns 500.
This can be changed by modifying the service configuration file which is under <arcgis server install folder>/server/user directory. Change the <MaxRecordCount> tag, then restart your service.
Also can be done in Parameters tab in service properties dialog in AGS 10.
One thing you should pay attention to is that graphicslayer will get really stuck when adding more than about 2000 graphics in it. you should always use graphics cluster to display.


Hey Zhifang, thank you for the advice. I can see that adding 1000 results is already slow the performance. So based on your advice I am thinking to use the graphicscluster to display the query results (I mean more than 1000). Could you share some sample codes or some clues on how to implement this? I really don't know how to do step the first step...Thank you very much!
0 Kudos
wangzhifang
Frequent Contributor
Hey Zhifang, thank you for the advice. I can see that adding 1000 results is already slow the performance. So based on your advice I am thinking to use the graphicscluster to display the query results (I mean more than 1000). Could you share some sample codes or some clues on how to implement this? I really don't know how to do step the first step...Thank you very much!

If you use ArcGIS API for Javascriipt, I'm sorry that you could not use a out-of-box cluster solution. For Flex API and Silverlight API, you can check the cluster example here and here.

If you really need to display large amounts of data in Javascript API, consider using ArcGISDynamicMapServiceLayer which render them on server side. In addition, FYI: http://www.arcgis.com/home/item.html?id=5e32a79350b241f38032f9ca0321ccde
0 Kudos
DanDong
Deactivated User
Hey Zhifang, thanks very much! Actually I am using Silverlight API. I checked the sample and also modified my codes. It is so amazing 😄

I think the cluster method is pretty useful for street layer, zipcode point layer or similar things, especially when the spatial query should return a large number of results which need to be displayed on the graphicslayer later.

In my codes, since I need to display the streets, I change the 'MediumMarkerSymbol' to 'MediumLineSymbol'
<esri:SimpleLineSymbol x:Key="MediumLineSymbol" Color="Red" Width="4" />

I didn't change the FlareCluster part which I think is so cool 😛

But since the query results will be displayed on a datagrid and now the datagrid can only display 1000 results (and the graphicslayer only shows these 1000 results), if I want to display more than 1000 results, I must modify the service configuration file as you suggested, right? And since I am using the graphics cluster method, modifying the service configuration file won't slow down the performance right?
0 Kudos
wangzhifang
Frequent Contributor
Hey Zhifang, thanks very much! Actually I am using Silverlight API. I checked the sample and also modified my codes. It is so amazing 😄

I think the cluster method is pretty useful for street layer, zipcode point layer or similar things, especially when the spatial query should return a large number of results which need to be displayed on the graphicslayer later.

In my codes, since I need to display the streets, I change the 'MediumMarkerSymbol' to 'MediumLineSymbol'
<esri:SimpleLineSymbol x:Key="MediumLineSymbol" Color="Red" Width="4" />

I didn't change the FlareCluster part which I think is so cool 😛

But since the query results will be displayed on a datagrid and now the datagrid can only display 1000 results (and the graphicslayer only shows these 1000 results), if I want to display more than 1000 results, I must modify the service configuration file as you suggested, right? And since I am using the graphics cluster method, modifying the service configuration file won't slow down the performance right?


Yes, to return more than 1,000 records while query from server, you need to modify the service configuration file(or change the number on Parameters tab on service properties dialog).
However, you should be aware that the more records server returns, the more travel time of the data returns from server. In additaion, cluster is used when graphics are displayed by marker symbols. If you use cluster in line symbols or fill symbols, it may not make any sense.
0 Kudos