Skip to content

Instantly share code, notes, and snippets.

@chadcooper
Last active August 29, 2015 13:56
Show Gist options
  • Save chadcooper/9029882 to your computer and use it in GitHub Desktop.
Save chadcooper/9029882 to your computer and use it in GitHub Desktop.
Open tl_2013_us_county.shp, select records where STATEFP = 24 (Maryland), write out those geometries and the STATEFP, COUNTYFP, and NAME fields only to 24.shp. Overwrite 24.shp if it exists.
#!/bin/bash
ogr2ogr -f "ESRI Shapefile" 24.shp -overwrite -select STATEFP,COUNTYFP,NAME -where "STATEFP = '24'" tl_2013_us_county.shp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment