Closed boesiii closed 6 years ago
I know that I can set the number of features returned to more than 1000 but wanted to see if another python way is possible.
When you do a query on the feature layer you need to set the ‘exceed_limit’ parameter to True to fetch all of the features. You can also use the iter_queries()
method.
features = lyr.query(exceed_limit=True)
What if I am not using the query method?
lyr = restapi.FeatureLayer(url,'user', 'pass')
for row in lyr.cursor().rows():
atts.update({row[0]: folder + str(row[26])})
for oid, att in atts.iteritems():
lyr.addAttachment(oid, att)
Ah, ok. Well, the cursor does use the query()
method under the hood, so when you define the cursor, just set that same parameter.
lyr = restapi.FeatureLayer(url,'user', 'pass')
for row in lyr.cursor(exceed_limit=True).rows():
atts.update({row[0]: folder + str(row[26])})
for oid, att in atts.iteritems():
lyr.addAttachment(oid, att)
Also, I have been terrible about updating the documentation for this package, but I do have a FeatureLayer.updateCursor()
as well that works very similar to the arcpy.da.UpdateCursor()
and supports attachments as well.
closing due to lack of feedback from OP.
My ArcGIS online feature layer is only returning the first 1000. How can a fetch the next 1000?