Increase Max Record Count for Content/Features/Generate

682
5
Jump to solution
07-23-2020 09:22 PM
SushantSardeshpande
New Contributor II

Hello,

We are using the feature generation API - sharing/rest/content/features/generate for getting features from a shape file zip (ZIP created on extracting layer data in SHP format using ArcGis Pro).
Using the endpoint https://heathconsultants.maps.arcgis.com/sharing/rest/content/features/generate from our online Organization. It works as expected when we are trying to generate features from a file with <4000 items (features). Tried with files with 1200+ and 2k+ records which was successful, but did not work when we were trying to get data from files with 8k+ or 12k+ records.
Get the error - {"error":{"code":400,"message":"The maximum number of records allowed (4000) has been exceeded.","requestId":""}}
Sending the publish parameters - {"name":"sbulargemapsheetshapefiles10-15-19-mod","targetSR":{"latestWkid":3857,"wkid":102100},"maxRecordCount":10000,"enforceInputFileSizeLimit":true,"enforceOutputJsonSizeLimit":true,"generalize":true,"maxAllowableOffset":10,"reducePrecision":true,"numberOfDigitsAfterDecimal":0}
Where targetSR is generated from the spatial reference of the map created via ArcGis JS SDK in a Web Application.

Wanted to know how we can go about increasing this max record count.

Any help would be appreciated. Thank you in advance

0 Kudos
1 Solution

Accepted Solutions
SushantSardeshpande
New Contributor II

While, max-record count cannot be modified for this particular service, found a work around which could be used to satisfy the use case.

1. Publish the shape file as a hosted feature layer using - /sharing/rest/content/users/User/publish

(Alternatively a data item can be added using /sharing/rest/content/users/User/addItem and then published - if required separately)

2. Check the action status for success - /sharing/rest/content/users/User/items/ItemId/status

(This can be directly displayed via the Arc Gis JS APIs by directly refering to the item id, in case you need the map data on the back end for some processing, further steps can be followed)

3. Export the hosted feature layer as a feature collection using - /sharing/rest/content/users/User/export

4. Check for the status of the operation again using - /sharing/rest/content/users/User/items/ItemId/status 

5. Get data from exported feature collection using - /sharing/rest/content/items/itemId/data

View solution in original post

0 Kudos
5 Replies
Egge-JanPollé1
MVP Regular Contributor

Hi Sushant Sardeshpande‌,

Via rest/admin/services you will have access to UpdateDefinition, like for example:

https://services6.arcgis.com/xxxxxxxxxxxxxArcGIS/rest/admin/services/My_Observations/FeatureServer/0...

You will find a step-by-step instruction on how to increase this value on this page:

How To: Update the maximum record count for feature services in ArcGIS Online 

HTH,

Egge-Jan

0 Kudos
SushantSardeshpande
New Contributor II

Hello Egge-Jan

Thank you for the reply, was confused on one end - would Arc Gis Online suffice for the increase of this max record count - currently accessing the publicly hosted API's via the Arc Gis Online organisation. Do we need to also host an Arc Gis Server with Enterprise and expose it via Arc Gis Online and then we can change this max record count or just Arc Gis Online would suffice?

Currently was accessing just the generate API via the portal so wasn't sure about whether it would support the max record count increase - couldn't access the admin page here even with an admin user.

Thanks in Advance

0 Kudos
Egge-JanPollé1
MVP Regular Contributor

Hi Sushant Sardeshpande,

Yes, you should be able to accomplish this with ArcGIS Online only. (No need to also host an ArcGIS Server with Enterprise to do this.)

Please note: there is no link to this admin page, you will have to manually modify the URL to get there...

So, go to the Service URL for the layer to be updated in the feature service. The ArcGIS REST Services Directory page opens. And now you have to insert "admin" between "rest" and "services" (see my previous post).

On this page scroll all the way down to find the Update Definition operation.

Please let us know whether you managed to solve the issue or not.

BR,

Egge-Jan

0 Kudos
SushantSardeshpande
New Contributor II

Hello Egge-Jan,

Thank you for your reply, I able to access the admin content for a feature service that I hosted, however, for features/generate that is available on the content item APIs the admin url is invalid.

Generate—ArcGIS REST API | ArcGIS for Developers  -> This is the one I am trying to use and while it mentions that GeoJson has a limit of 4000, I get the 4k limit error with a shapefile as well, maybe I am missing something but can a content API be also provided as a feature service and then configured as a feature service instead?

Thanks a lot for you time and assitance

0 Kudos
SushantSardeshpande
New Contributor II

While, max-record count cannot be modified for this particular service, found a work around which could be used to satisfy the use case.

1. Publish the shape file as a hosted feature layer using - /sharing/rest/content/users/User/publish

(Alternatively a data item can be added using /sharing/rest/content/users/User/addItem and then published - if required separately)

2. Check the action status for success - /sharing/rest/content/users/User/items/ItemId/status

(This can be directly displayed via the Arc Gis JS APIs by directly refering to the item id, in case you need the map data on the back end for some processing, further steps can be followed)

3. Export the hosted feature layer as a feature collection using - /sharing/rest/content/users/User/export

4. Check for the status of the operation again using - /sharing/rest/content/users/User/items/ItemId/status 

5. Get data from exported feature collection using - /sharing/rest/content/items/itemId/data

View solution in original post

0 Kudos