Skip to content

Instantly share code, notes, and snippets.

@pbogden
Last active December 16, 2015 22:48
Show Gist options
  • Select an option

  • Save pbogden/c2625768c1938715ffb4 to your computer and use it in GitHub Desktop.

Select an option

Save pbogden/c2625768c1938715ffb4 to your computer and use it in GitHub Desktop.
osm vectors
SOURCE_DATA = district-of-columbia-latest.shp.zip
SOURCE_SITE = http://download.geofabrik.de/north-america/us/
all: dc.json
.PHONY: clean all
# Download the data (zipped shapefiles -- 57 MB)
data/$(SOURCE_DATA):
curl -LO $(SOURCE_SITE)$(SOURCE_DATA)
mkdir data
mv $(SOURCE_DATA) data
# Convert shapefiles to topojson
# --no-quantization 87 MB JSON file without trying to save space
# 14 MB with default setting
dc.json: data/$(SOURCE_DATA)
@echo "making" $@
mkdir tmp
cp data/*.zip tmp
unzip data/$(SOURCE_DATA) -d tmp
topojson --no-quantization -p -o $@ -- tmp/roads.shp
# topojson --no-quantization -p -o $@ -- `find tmp/*.shp`
clean:
rm -r tmp
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment