5

I am able to add shapefiles with less than 1000 points by using the ArcGIS Portal REST API as shown in this example: https://developers.arcgis.com/javascript/jssamples/portal_addshapefile.html

However, there is a 1000 point maxRecordCount through their service. I have tried setting the maxRecordCount in the publishParameters without any luck. I also thought it may be possible to publish our own service with a raised maxRecordCount, but I am not very experienced in publishing custom scripts and did not know whether there was a toolbox that already provided this functionality.

So my question is, is there a way to use the ArcGIS Portal REST API to return more than 1000 records? If not, what would be the best approach to solve this problem?

1

yes, it is possible to manipulate the maxRecordCount of hosted services in ArcGIS Online/Portal/Server. Administering ArcGIS Online hosted services - Update Definition: Feature Layer http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Update_Definition_Feature_Layer/02r30000022p000000/

example url:

http://services.myserver.com/ERmEceOGq5cHrItq/ArcGIS/rest/admin/services/example5/FeatureServer/1/updateDefinition

example POST body:

{ "maxRecordCount" : 2000 }

Its worth noting though that displaying thousands of individual geometries and their corresponding attributes at one time does not typically lend itself to the best user experience possible. Using scale dependency or some other mechanism to avoid this is worth considering.

| improve this answer | |
  • I believe that this rest-based functionality updates the FeatureServer service definition. It is not applicable to feature collections added directly to maps (from Shapefiles) via the Javascript API described in the question. – JasonInVegas Jan 29 '15 at 23:22
  • 1
    Bottom line: either ArcGIS Server or an Organizational Subscription for AGOL is required so that a Feature Service can be created.--that's what you need in order to manage record counts flexibly. Simply uploading a shapefile into a map as a feature collection will unavoidably hit the 1000 feature limit. – JasonInVegas Jan 29 '15 at 23:29
0

If I understand correctly you want to upload shapefiles (>1000 features) with the ArcGIS Javascript Api?

If you look at the sample code you see the following lines of code:

var params = {
          'name': name,
          'targetSR': map.spatialReference,
          'maxRecordCount': 1000,
          'enforceInputFileSizeLimit': true,
          'enforceOutputJsonSizeLimit': true
        };

Adjust the 'maxRecordCount' value and it should work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.