Select to view content in your preferred language

Is there any limit on number of features a query task returns?

6229
5
Jump to solution
05-10-2013 05:05 AM
srujand
Emerging Contributor
Hi Group,
I want to perform a query task against a feature layer in ArcGISDynamic Layer which contains 36527 features .But When I query the feature layer and count the fatures length ,I see only 1000.My question is does query returns a maximum of 1000 or is it possible that the map REST service layer is set to 1000 records .Because I noticed the same query on map service from the URL returns just 1000.
Here is the code related the query .The queryTask.executeForCount is printing 36527 but I see in only 1000 features after query task exceuted.
I need the solution very soon.Could anyone help me understand what's going on here.

var layerId = getlayerIdByName("primary_dataset","Active Road Crossings");   var queryTask = new esri.tasks.QueryTask(primaryMapUrl + "/"+layerId);      var query = new esri.tasks.Query();      query.returnGeometry = false;      query.outFields = ["OBJECTID","ENG_XING"];        query.where = "1=1" ;             queryTask.executeForCount(query,function(count){         alert(count);       },function(error){         console.log(error);       });      queryTask.execute(query,populateDotXingNumbers);
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor
Yes, this is set within the Parameters of the service.  Ex:

[ATTACH=CONFIG]24194[/ATTACH]

See the following help link here.

Maximum number of records returned by the server:   Clients, such as the ArcGIS web APIs, can perform query operations to  return specific information, or records, from a map service.  This  property specifies  how many records can be returned by the server to a  client for any given query operation.  Specifying a large number of  records to be returned by the server can slow the performance of client  applications consuming your map service, such as web browsers, and your  GIS server.

View solution in original post

5 Replies
JakeSkinner
Esri Esteemed Contributor
Yes, this is set within the Parameters of the service.  Ex:

[ATTACH=CONFIG]24194[/ATTACH]

See the following help link here.

Maximum number of records returned by the server:   Clients, such as the ArcGIS web APIs, can perform query operations to  return specific information, or records, from a map service.  This  property specifies  how many records can be returned by the server to a  client for any given query operation.  Specifying a large number of  records to be returned by the server can slow the performance of client  applications consuming your map service, such as web browsers, and your  GIS server.
srujand
Emerging Contributor
Yes, this is set within the Parameters of the service.  Ex:

[ATTACH=CONFIG]24194[/ATTACH]

See the following help link here.

Maximum number of records returned by the server:   Clients, such as the ArcGIS web APIs, can perform query operations to  return specific information, or records, from a map service.  This  property specifies  how many records can be returned by the server to a  client for any given query operation.  Specifying a large number of  records to be returned by the server can slow the performance of client  applications consuming your map service, such as web browsers, and your  GIS server.


Awesome!!! That was very helpful.
From which tool is that screen shot from ?
0 Kudos
JakeSkinner
Esri Esteemed Contributor
That screen shot is from when you are publishing a map service at 10.1.
0 Kudos
JssrRR
by
Frequent Contributor

Hi Jake,

When I go change the number to 2000 or higher, while publishing the map service, I am getting this error, do you know how I can fix this?

ScriptError.PNG

I asked a question this morning in the forum, because I am not getting an accurate result when the selected features are more than 1000 within the buffer distance, here :

Re: Selected features within a buffer not getting accurate results

Thanks for your help!

0 Kudos
srujand
Emerging Contributor
That screen shot is from when you are publishing a map service at 10.1.

Thanks A lot!!!
0 Kudos