Skip to main content
100%

Gist 745c7c03b5bf6b6f59d9

✓ Published0🌍 Public
RRCura
Last edited Mar 20, 2013
Created on Mar 20, 2013

This example splits a single ESRI Shapefile into multiple new Shapefiles, one for each unique value found in a specified attribute field. It demonstrates how to use the OGR library from GDAL to read the original dataset, extract all distinct attribute values, and then create filtered copies. The process first enumerates unique values, then iterates through them to create new Shapefile layers, applies an SQL attribute filter to exclude features not matching the current value, and deletes the remaining unwanted features.

AI-generated description

Similar vizzes