Leveraging sql server to improve vector display through point clustering

494 views
438 views

Published on



Presented at the 2011 Texas GIS Forum

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
494
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Leveraging sql server to improve vector display through point clustering

  1. 1. Leveraging SQL Server to Improve Vector Display through Point Clustering
  2. 2. The Problem… Due to Java Script limitation, Large Numbers of Vectors don’t draw in Web-Mapping Environments. Cutoff is ~ 300-500 Features
  3. 3. Current ways to solve…1. Use Silverlight or Flash  Increases capacity roughly an order of magnitude, but similar limitation exists.2. Show Pictures, Query Features  Has the capability to show and query ALL features for a pleasant user experience, but takes time to build tile cash (the pretty pictures).  However, Tile Caches are Large and are, basically, redundant storage.3. Use a WMS to feed ‘pictures’ dynamically and then use a separate, spatial query for feature attributes.  Extra ‘moving’ parts in the solution.  Possibly extra cost in licenses.
  4. 4. Why Invent a ‘Better’ Solution??? Original Design…  Texas Hydrologic Information System (TexasHIS)  www.waterdatafortexas.org  Client desires immediate access to vector data and attributes Data Characteristics  Lots of tightly packed ‘Sites’ ~ 300K+  data with gobs of related attribute data ~ 5,000,000+ related records!
  5. 5. Factors Affecting a Good ‘Clustering’ The Data Solution…  Density  Distribution The Scale  Large – Basically Draw everything  ‘Medium’ – Draw some, Cluster some – Lots of Code and Logic!  Small – Basically Cluster everything Logic  Thresholds/Limits of when to Cluster vs. When to Draw  How to Carve the display to deal with Data Distribution  Complex Algorithms to determine the optimal number of features to draw.
  6. 6.  Create a ‘smart’ solution that…  Isn’t affected by the java script limit  Only queries the database one time (other solutions can query the database for image creation and attribute retrieval.  Is still capable of retrieving vector attributes for single features
  7. 7. Solution Basics…1. Drawing Thresholds  When to Draw everything  When to Cluster  When to take no action2. Carving The Display  At first glance, a 16 x 16 ‘Grid’ would be best. It would yield 256 Cluster ‘Features’3. Clustering Logic  Draw the Singles  Cluster Everything Else
  8. 8. Solution Basics: Thresholds…1. Drawing Thresholds  Draw Everything – if the total number of Points to ‘cluster’ is below 500  Cluster – If there are 500 (Lower Limit) to 5000 (Upper Limit)  Above the Upper Limit – Take no action. The Clustering Query becomes too expensive. So much so that user experience is drastically diminished.
  9. 9. Solution Basics: Carving up the Display and Applying the Logic Rules… Spatial Indexes are Similar in concept 16 x 16 creates 256 Cells – Near the upper limit of our display threshold Polygons with more than 1 Site are ‘Cluster Candidates’. The Centroid of the polygon will represent the cluster spatially. Threshold values are variables so that they are easily ‘tuned’ in a series of runs.
  10. 10. Solution Basics: How it works…  The Envelope of the Display is passed as a parameter  First Function, a Scalar-Valued Function, determines how ‘big’ the cells will be in the X and Y direction – Returns a comma separated number pair – “0.3456778,0.3456777”  Second Function, a Table-Valued Function, returns a table of polygon cells that are ‘built’ from the output of the SVF and the starting point of the Display Envelope. A ‘cutter’ variable is used to build-out polygons with @var_Y rows and @var_X columns.  The results of these functions are then used to 0perate on the ‘Sites’ point dataset.
  11. 11. XY
  12. 12. At Long Last… DEMO!!!
  13. 13. Further Improvements… Add logic to always draw ‘up-to’ the lower limit. Possibly add some ‘weight’ to the clustered point so that it doesn’t show in such a ‘regular’ way. Others…
  14. 14. TNRIS Information Services… Richard Wade – Team Lead Ryan Mitchell – Web Systems and Data Czar Yvette Giraud – Web Development Ragunath Jayabalakrishnan – Developer (Contract) Chris Williams – Database Administrator
  15. 15. www.foursquare.com

×