I have a huge dataset with flowpaths containing a catchment area for each line. The attribute table has ~ 780.000 rows, and thereby 780.000 features in the mapwindow.
Is it possible by using a field to merge the data in intervals, so you get a multi-part feature instead?
For instance merge all the features so those with a catchment area of 1-10.000 become one, from 10.001-20.000, 20.001-30000 and so on? The interval doesn't have to be 10.000 but can be another value.
I was messing around with the dissolve feature, but other than doing a manual population of a field and then dissolving by that attribute, I couldn't find another way to do it.
Basically I want what the symbology window does, but I want to do it to the dataset.
I have ArcGIS Desktop 10.5.1 with the Advanced License.
import pandas as pd import arcpy fc = r'C:\Users\JGJ\Desktop\DatabaseVejle.gdb\StromningsVeje' #Change to match your data bins = [-1,10000,50000,100000,200000,500000,1000000,5000000,10000000,100000000,1000000000] #Add/remove bins df = pd.DataFrame.from_records(data=arcpy.da.SearchCursor(fc,['OID@','flow']),columns=['OID','flow']) df['Interval'] = pd.cut(df['flow'], bins=bins).astype(str) intervaldictionary = dict(zip(df.OID,df.Interval)) with arcpy.da.UpdateCursor(fc,['OID@','Intervalfield']) as cursor: for row in cursor: if row in intervaldictionary: row = intervaldictionary[row] else: row = 'Unknown interval' cursor.updateRow(row)
Ran into a snack, when processing a large dataset:
Runtime error Traceback (most recent call last): File "<string>", line 7, in <module> File "C:\Python27\ArcGIS10.5\lib\site-packages\pandas\core\frame.py", line 950, in from_records values += data MemoryError
Any suggestions on how to get passed this?