CartONG – 23 boulevard du musée, 73000 Chambéry – France
www.cartong.org | info@cartong.org
info@cartong.org | www.cartong.org Page 1 | 3
HOW-TO: HARVESTIN G L ARGE QUA NTITY OF DAT A
FR OM AR CGIS REST SER VICES USING A NEW TO OL!
If you have ever worked with ArcGIS REST Services, either through ArcGIS Online or
ArcGIS Server, you might have faced a limitation of 1000 features by response, and
you wouldn’t be the only one! Googling “1000 limit on ArcGIS REST service” would already
give you a good idea of how much this has been a recurring issue for users for quite some time.
This limitation is defined by the maxRecordCount service property and it is set to 1000
by default. As mentioned by Esri, this implies that only that specific number of “records can be
returned by the server to a client for any given query operation”. Therefore, as users, we are
unable to access a whole dataset with a single query, making us search for workarounds
which could allow to perform either a global analysis of the dataset or operations needing access
to all records at once, like a “Find Closest Facility”.
Why are services de facto limited?
There are some valid reasons explaining such default value. The main one is to ensure
an acceptable performance level for both clients but also servers. As it is explained by Esri, the
data we are handling is quite heavy and take a lot of memory space in one’s browser, especially
if we are talking about polygons. Without the 1,000 graphics limit, we could easily reach the
capacity of the server to process and send requests, and the user’s browser to smoothly display
a map including so many features.
Having said that, some of the complains on the matter are dated from more than five years ago,
so one could wonder if the technology hasn’t advanced enough to increase the 1,000 graphics
limit. Besides, the limitation was built around the idea of a worst-case scenario, i.e. using a
polygon layer, when one often only needs points (a couple of numbers) or simple tabular data.
In any case, if you are the data publisher, it is hard to say what could be a reasonable number
today, as it depends on each environment and use case.
Yes… but give me all!
One shouldn’t worry! Even if we cannot increase the limitation of the service we are using, either
because of technical constraints or because we are not the server maintainers, there are still
several methods to query all the data at once.
II.1. Grouped object IDs approach
One of them, which is mentioned by Esri, has to do with performing sequential queries to
groups of 1000 Objectids (or as many Objectids as the limitation is set).
“While there is a limit to the number of features included in the feature set response, there is
no limit to the number of object IDs returned in the ID array response. Clients can exploit this
to get all the query conforming object IDs by specifying returnIdsOnly=true and subsequently
requesting feature sets for subsets of object IDs.” (Esri).