运行以下脚本时遇到以下MemoryError。任何帮助将不胜感激。我查询的图层包含235,896个功能,我担心这个问题。
脚本
import arcgis
import json
from arcgis import ArcGIS
service = ArcGIS("http://mapping.dekalbcountyga.gov/arcgis/rest/services/LandUse/MapServer")
query = service.get(0, count_only=False)
json_query = json.dump(query)
f = open("dekalb_parcels.geojson", "w")
f.write(json_query)
f.close()
错误
Traceback (most recent call last):
File "G:/Python/Scripts/dekalb_parcel_query.py", line 8, in <module>
query = service.get(0, count_only=False)
File "C:\Python27\lib\site-packages\arcgis\arcgis.py", line 146, in get
jsobj = self.get_json(layer, where, fields, count_only, srid)
File "C:\Python27\lib\site-packages\arcgis\arcgis.py", line 90, in get_json
return response.json(strict=False)
File "C:\Python27\lib\site-packages\requests\models.py", line 802, in json
return json.loads(self.text, **kwargs)
File "C:\Python27\lib\site-packages\requests\models.py", line 769, in text
content = str(self.content, encoding, errors='replace')
MemoryError
答案 0 :(得分:3)
我能够通过切换到64位Python来纠正这个问题。当它达到2GB的RAM使用时,该进程崩溃了,但是通过切换到64位Python我避免了这个问题。