Last active
March 26, 2016 22:51
-
-
Save portableant/bbf693fd0957a6c653fc to your computer and use it in GitHub Desktop.
An R file to split shapefiles from the OS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(foreign) | |
dfblocks = read.dbf('/Users/danielpett/Documents/research/osData/england/parish_region.dbf', as.is=TRUE) | |
unitID = unique(dfblocks$UNIT_ID) | |
unitID <- as.data.frame(unitID) | |
for (i in 1:nrow(unitID)){ | |
id <- unitID[i, "unitID"] | |
strOGR = paste( | |
"ogr2ogr -where 'UNIT_ID = ", id, "' /Users/danielpett/Documents/research/osData/Data/ParishRegion /Users/danielpett/Documents/research/osData/england/ parish_region -nln ", id, sep="" | |
) | |
system(strOGR) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment