This repository has been archived by the owner on Aug 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
906508c
commit a8120b3
Showing
2 changed files
with
25 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# download | ||
wget -r ftp://ftp2.census.gov/geo/tiger/TIGER2018/ROADS/* | ||
|
||
# unzip files | ||
mkdir ./all_2018_roads | ||
find ftp2.census.gov -type f -name "*.zip" -print0 | xargs -0 -I{} unzip {} -d ./all_2018_roads | ||
|
||
|
||
# subset all of the shapefiles to each of the road classes | ||
mkdir ./TIGER2018_S1200_roads | ||
|
||
# if ls is aliased to `ls --color` than ansi color strings will be returned, preventing the grep from working! | ||
for f in `\ls all_2018_roads/ | grep .shp$`; do | ||
ogr2ogr -where "MTFCC = 'S1200'" TIGER2018_S1200_roads/$f all_2018_roads/$f | ||
done | ||
|
||
# merge all of these together | ||
# utility taken from the python-gdal package | ||
ogrmerge.py -o all_TIGER_roads_2018.gpkg TIGER2018_S1200_roads/*.shp -progress -f GPKG | ||
|
||
# cleanup | ||
rm -r ftp2.census.gov | ||
rm -r all_2018_roads | ||
rm -r TIGER2018_S1200_roads | ||
|
This file was deleted.
Oops, something went wrong.