I want to add a compressed shapefile with gis.content.add. This works great with shapefiles except large shapefiles.
If i try to add a large shapefile the following error message appears:
Traceback (most recent call last):
File "xxx\publishgeodata.py", line 236, in <module>
shpfile = gis.content.add(item_properties={'type':'Shapefile', 'licenseinfo':license_text, 'commentsEnabled':False, 'title':m_data['titel'], 'description':m_data['beschreibung'], 'tags':m_data['stichworte']}, upload_size=1e7, data=shp_fullname)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 5124, in add
folder=folder,
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 4773, in _add_by_part
os.remove(ffile)
PermissionError: [WinError 32] Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird: 'C:\\Users\\MUELLE~1\\AppData\\Local\\Temp\\split00de.part2'
checking the split00de.part2 file shows, that the file was blocked by python, so it is not possible to delete this file.
Has someone else the same problem. Is there a workaround?
thanks
Armin
Solved! Go to Solution.
Could you try reading the shapefile into a GeoAccessor first, then creating the feature service from that?
Could you try reading the shapefile into a GeoAccessor first, then creating the feature service from that?