Dealing with Lots and Lots of Point Data in a Web Application

by | May 15, 2015

I recently had a fun question from a student on the Building Custom ArcGIS Server Applications with JavaScript class. He has a busy map service with in excess of 50,000 points on it, and was after some advice as to how to improve performance in a web application he has built to consume that service.

Sure, 50,000 points is a lot of data. But we’ve seen worse and thankfully there are a number of features in the ArcGIS Server API for JavaScript we can take advantage of to keep our users happy when interacting with large data sets like these.

How regularly is the data likely to change?

If hardly at all, consider creating a cached map service from all your points. You won’t be able to send the feature geometries and their associated attributes down to the browser for immediate responsiveness like you could with a Feature Layer, but users can still interact with your data via a QueryTask, although each interaction with a feature will require a server round trip to work.

See: Creating a Cached Map Service in ArcGIS Server

What if you need that level of interaction?

If interactivity is likely to require a lot of round trips, but users are likely to want to focus on discrete geographical areas when using your application, consider using a Feature Layer, and setting its mode to “on demand” so that points are only brought down to the client when the user requires them. Conversely, if users are likely to want to work on large areas with most of the points for a decent period of time, it might be better to use “snapshot” mode and take the initial hit of downloading all the data when the application loads. Experiment to see what works best.

See here for a demo of on demand retrieval.

Consider clustering your point data

Clustering involves “lumping together” points at smaller map scales, so you don’t display the invidual points, just a single marker with a label that denotes the number of points that marker actually represents.

clusters

Esri has a really nice sample that shows you how to do this using the Class Breaks Renderer on the Resources Center:

Do you need to see ALL points at ALL scales?

If you can get away with only showing certain features at certain scales, use scale-dependent rendering. Features can be hidden or displayed only at certain scale levels.

See an example:

So you can see that with a bit of creative use of the API, even layers with gazillions of point features can prevent us from using them in our web applications!

Categories

Recent Posts

Eric Pimpler
Eric is the founder and owner of GeoSpatial Training Services (geospatialtraining.com) and has over 25 years of experience implementing and teaching GIS solutions using ESRI, Google Earth/Maps, Open Source technology. Currently Eric focuses on ArcGIS scripting with Python, and the development of custom ArcGIS Server web and mobile applications using JavaScript. Eric is the author of Programming ArcGIS with Python Cookbook - 1st and 2nd Edition, Building Web and Mobile ArcGIS Server Applications with JavaScript, Spatial Analytics with ArcGIS, and ArcGIS Blueprints. Eric has a Bachelor’s degree in Geography from Texas A&M University and a Master's of Applied Geography degree with a concentration in GIS from Texas State University.

Sign up for our weekly newsletter
to receive content like this in your email box.