spatial.to_featurelayer fails with 'maximum number of records allowed has been exceeded'

202
0
06-16-2021 09:14 AM
PhilLarkin1
Occasional Contributor III

The Spatial DataFrame is unable to export to a Hosted Feature Layer at API version 1.8.5. It seems the to_featurelayer function should handle batching. The feature layer I am exporting from has 219k records. 

 

from arcgis.gis import GIS
import pandas as pd
gis = GIS(url, username, password)

premiseLayer = gis.content.get(fsItemId)
fLyr = premiseLayer.layers[0]
df = pd.DataFrame.spatial.from_layer(fLyr)

df[columnList].spatial.to_featurelayer('NewName',folder='folderName')

...

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\geo\_accessor.py, in to_featurelayer:
Line 2182:  return content.import_data(self._data, folder=folder, title=title, tags=tags)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py, in import_data:
Line 5361:  res = self._portal.con.post(path, postdata)#, use_ordered_dict=True) - OrderedDict >36< PropertyMap

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in post:
Line 720:   force_bytes=kwargs.pop('force_bytes', False))

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in _handle_response:
Line 502:   raise Exception(data['error'])

Exception: {'code': 400, 'message': 'The maximum number of records allowed (1000) has been exceeded.', 'requestId': '', 'traceId': 'f7ed4d8d8f6b6647b195319ca2c420a8'}

 

Tags (1)
0 Kudos
0 Replies