Another question about maxRecordCount.
My AGOL Hosted point Feature Layer only allows up to 1000 selected features in my Webapp.
Like many others before me, I have tried updating the Service Definition maxRecordCount to a higher number(10,000) and save, but the selection still stays at 1000. and it also reverts back to 1000 in the Service Defintion. there are a few places to update that maxRecordCount in the definition, and only one of those reverts back to the lower number.
ESRI can we please get an explanation on Selecting AGOL Hosted Features? please advise how to raise that maximum selection.
thx!
Solved! Go to Solution.
Using the script for ArcGIS Enterprise, despite being successful at all stages, the definition is not actually updated.
And when I try to use the same update_dict syntax directly in Enterprise, it also indicates success but does not update the json.
But thanks for sharing the code.
i had same problem, resolved by updating a featureLayer collection made from the item and using an integer for maxRecord Count
flc = FeatureLayerCollection.fromitem(item)
flc.manager.update_definition({'maxRecordCount': 10000})
@Clubdebambos Wondering if you could assist me with this?
Having a hard time getting this to work for AGOL Portal.
Hi @ModernElectric,
The below works fine for me in AGOL.
from arcgis.gis import GIS
## Access ArcGIS Online
agol = GIS("home")
## get the feature service as an Item object
item = agol.content.get("FS_ITEM_ID")
## for each Feature Layer in the Feature Service
## update to the maximum record count per geometry type
for lyr in item.layers:
print(lyr.properties.name)
if lyr.properties.geometryType in ("esriGeometryPolygon", "esriGeometryPolyline"):
print(lyr.manager.update_definition({"maxRecordCount" : 4000})) # 4000 is the max for Polygon & Polyline
elif lyr.properties.geometryType == "esriGeometryPoint":
print(lyr.manager.update_definition({"maxRecordCount" : 32000})) # 32000 is the max for Point
You can also update the maxRecordCountFactor.
for lyr in item.layers:
print(lyr.properties.name)
if lyr.properties.geometryType in ("esriGeometryPolygon", "esriGeometryPolyline"):
print(lyr.manager.update_definition({"maxRecordCount" : 4000, "maxRecordCountFactor" : 2})) # 4000 is the max for Polygon & Polyline
elif lyr.properties.geometryType == "esriGeometryPoint":
print(lyr.manager.update_definition({"maxRecordCount" : 32000, "maxRecordCountFactor" : 2})) # 32000 is the max for Point
When using the ArcGIS API for Python Feature Layer query() method you can set the return_type parameter to "standard" which will use the standardMaxRecordCount which is multiplied by the maxRecordCountFactor (eg 4000 * 2 = 8000 or 32000 * 2 = 64000)
@Paco wrote:Yes. I am opening the specific Hosted Feature Layer in AGOL(using 'View' URL on the Overview page. which gets me to the ArcGIS REST Services Directory, and clicking on "Admin" in the upper right, and clicking on "Update Definition" at the bottom.
searching for and updating "maxRecordCount" and "lastEditDate"(10,000 and null) and clicking on "Update Service Defintion".
But after you click 'View', are you clicking on the layer name before clicking 'Admin'?
Holly! I actually was going to post a conclusion to my question earlier today! and THIS was the issue. thanks for posting. I was not going far enough into the Service and choosing the specific Layer. I didn't think I needed to because I only had One Layer per Service, but I did.
so, click Service URL, CHOOSE LAYER, Admin, and alter the field numbers. even if there is only One Layer in the Service.
Thank you everyone for your input. moving forward now!
p
Cool! Glad I could help! (Or that you figured it out on your own!) 🙂
what is the maxrecordcount that you can set. i'm querying a service that has about 491,000 records and i know that my query should have about 144,771 records in it. how can I pull back that or is it too much?
According to this resource, "for ArcGIS Online hosted services, maxRecordCount has an upper limit of 32000 for points, and an upper limit of 4000 for lines and polygons."