We have a very large shapefile with over 30000 features and want to merge it with a script on a server. Currently we try it with QGIS, but the processing takes way too much time.
Is there a way to do it with the GDAL/OGR Tools or Python?
Answer
In GIS context, the better is organize your data in a database (!).
Then, many kinds of operations will be simple. With PostGIS (using PostgreSQL as database) the command that solves your problem is
SELECT ST_Collect(geom) FROM your30000features_table;
And the commands are standard, see standard OGC functions ST_Collect and ST_Union.
Using as input "OSM-Coastline Polygons", you are using POLYGON OGC types in the database. The ST_Collect(geom) of a set of POLYGONs will return a GEOMETRYCOLLECTION, but you can convert it into a MULTIPOLYGON, or produce it directly by the ST_Union function.
No comments:
Post a Comment