Plotting 20,000 points from SQL Server 2008

637
3
04-23-2011 06:48 PM
IgressT
New Contributor II
Hi,
I have a SQL Server 2008 table with over 20,000 points. How can I plot all these points on my silverlight app.
I have looked at
http://forums.arcgis.com/threads/27977-Cluster-of-50-000-Points-dynamically-add-remove-cluster
for solution and Morton uses FeatureLayer's/ Tiled service to show the data.

My thought is to show some kind of implementation of clustering (similar to http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SimpleClusterer) or a heat map and when user zooms in at a particular location then retrieve the actual data from server.
However my problem is:
1. I don't have a ArcGIS server or MapIT to create some kind of service to use it in my app.
2. The data I use resides in SQL Server 2008 and I cannot separate the data as it is a part of a huge database.

Is there a solution for this. Please give me some advice

Thanks
0 Kudos
3 Replies
LanceCrumbliss
Occasional Contributor II
how about a WCF service to query the SQL database and build the point geometries?

http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/03/11/Sending-geometry-between-Silverlig...

lance
0 Kudos
IgressT
New Contributor II
how about a WCF service to query the SQL database and build the point geometries?

http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/03/11/Sending-geometry-between-Silverlig...

lance


Is there a way to return data in parts. The way I am trying is
1. Determine how many points are there in the table (for example 20,000)
2. In my silverlight app I create a for loop and in the for loop I call the service multiple times (see the code below)
3. Is there a better way because first of all I am sure this approach sucks and secondly the browser freezes up and third it does not work

can any one suggest a better approach?

        
  take=100;
  skip=0;            
  for (int i = 0; i < 20000; i++)
                {
                    var results = ServiceContext.GetLocations(skip, take);
                    results.Completed += Results_Completed;

                    skip = skip + take;
                }

  private void Results_Completed(object sender, System.EventArgs e)
         {
  } 
0 Kudos
LanceCrumbliss
Occasional Contributor II
You could try adding some more functionality to the WCF service.  For example, a method to get the number of records, a method for returning the data in manageable sized chunks, etc.  Maybe the looping and logic should be done there instead of on the client.

Something like a robust WCF service that communicates with your SQL server is probably the best way to go about this since you wont be interfacing with ArcGIS server or MapIt.

Lance
0 Kudos