I am trying to dissolve grid spaces by category using GeoPandas'
dissolve function, but it doesn't finish after hours of running and I want to make sure I'm not doing something wrong and/or there isn't some way to speed it up.
Here's what I've got so far:
outputData = gp.GeoDataFrame(outputData[['category','geometry']]) outputData['geometry'] = outputData['geometry'].apply(wkt.loads) outputDataFrame = outputData.dissolve(by='category')
Here's the breakdown: I've got a Dataframe called
outputData with many variables/columns, so I limit it to the two I need and convert it into a geoDataFrame. In order to use the geometry column, I need to apply
wtk.loads else I get an error about it being a
str type. There are 12 values in the category column (0-11) and around 200,000 rows in the DataFrame.
I've run dissolve before (e.g. to get region boundaries from counties) but never on so many geometries. I'm thinking that because in this case the geometries are all simple and non-overlapping (a grid) there may be a better way to combine them. But if
dissolve is just
unary_union, then I don't know what could be better than that.
Is this a known unsolvable problem with large datasets or are there any tricks to speed it up significantly (e.g., by setting an option or using a different library/function)?