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

Mark Lewin
Mark is an authorized Esri and CompTIA CTT+ certified instructor, Esri certified Web Developer Associate and experienced web development professional. In a career spanning over 15 years, Mark has built dozens of sophisticated web applications and taught others to do the same, and has a particular interest in web mapping. Highlights include the development of a highly complex volcanic ash cloud modeling system for the UK's Met Office and using ArcGIS Server and the Flex API, and a state of the art cell phone tracking system for a defense contractor using the ArcGIS Server API for JavaScript. He has taught hundreds of GIS professionals how to build custom applications using Esri's ArcGIS Server and open source platforms (MapServer, OpenLayers, Leaflet) and delivered geospatial software tutorials and demonstrations to thousands

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