<commit_before>all: buildings/buildings.shp addresses/addresses.shp districts/districts.shp chunks osm

clean:
	rm -f building_footprints_shape_09-13.zip
	rm -f NYC_AddressPoints_0913.zip
	rm -f nyedwi_13a.zip

building_footprints_shape_09-13.zip:
	curl -L "https://data.cityofnewyork.us/download/tb92-6tj8/application/zip" -o building_footprints_shape_09-13.zip

NYC_AddressPoints_0913.zip:
	curl -L "https://data.cityofnewyork.us/download/4iq4-tuhq/application/zip" -o NYC_AddressPoints_0913.zip

nyedwi_13a.zip:
	curl -L "http://www.nyc.gov/html/dcp/download/bytes/nyedwi_13a.zip" -o nyedwi_13a.zip

buildings: building_footprints_shape_09-13.zip
	unzip building_footprints_shape_09-13.zip -d buildings

addresses: NYC_AddressPoints_0913.zip
	unzip NYC_AddressPoints_0913.zip -d addresses

districts: nyedwi_13a.zip
	unzip -d districts -j nyedwi_13a.zip

buildings/buildings.shp: buildings
	rm -f buildings/buildings.*
	ogr2ogr -simplify 0.2 -t_srs EPSG:4326 -overwrite buildings/buildings.shp buildings/building_footprints_shape_09-13.shp

addresses/addresses.shp: addresses
	rm -f addresses/addresses.*
	ogr2ogr -t_srs EPSG:4326 -overwrite addresses/addresses.shp addresses/NYC_AddressPoints_0913.shp

districts/districts.shp: districts
	rm -f districts/districts.*
	ogr2ogr -simplify 20 -t_srs EPSG:4326 -overwrite districts/districts.shp districts/nyedwi.shp

chunks: directories
	python chunk.py buildings/buildings.shp districts/districts.shp chunks/buildings-%s.shp ElectDist
	python chunk.py addresses/addresses.shp districts/districts.shp chunks/addresses-%s.shp ElectDist

directories:
	mkdir -p chunks
	mkdir -p osm

osm: chunks
	python convert.py<commit_msg>Cleaner make, and use old addresses until we've got a shape file up there.<commit_after>all: buildings/buildings.shp addresses/addresses.shp districts/districts.shp chunks osm

clean:
	rm -f building_footprints_shape_09-13.zip
	rm -f NYC_AddressPoint.zip
	rm -f nyedwi_13a.zip

building_footprints_shape_09-13.zip:
	curl -L "https://data.cityofnewyork.us/download/tb92-6tj8/application/zip" -o building_footprints_shape_09-13.zip

NYC_AddressPoint.zip:
	curl -L "https://dl.dropboxusercontent.com/u/479174/NYC/NYC_AddressPoint.zip" -o NYC_AddressPoint.zip

nyedwi_13a.zip:
	curl -L "http://www.nyc.gov/html/dcp/download/bytes/nyedwi_13a.zip" -o nyedwi_13a.zip

buildings: building_footprints_shape_09-13.zip
	rm -rf buildings
	unzip building_footprints_shape_09-13.zip -d buildings
	rm -rf building_footprints_shape_09-13.zip

addresses: NYC_AddressPoint.zip
	rm -rf addresses
	unzip NYC_AddressPoint.zip -d addresses
	rm NYC_AddressPoint.zip

districts: nyedwi_13a.zip
	rm -rf districts
	unzip -d districts -j nyedwi_13a.zip
	rm nyedwi_13a.zip

buildings/buildings.shp: buildings
	rm -f buildings/buildings.*
	ogr2ogr -simplify 0.2 -t_srs EPSG:4326 -overwrite buildings/buildings.shp buildings/building_footprints_shape_09-13.shp

addresses/addresses.shp: addresses
	rm -f addresses/addresses.*
	ogr2ogr -t_srs EPSG:4326 -overwrite addresses/addresses.shp addresses/NYC_AddressPoint.shp

districts/districts.shp: districts
	rm -f districts/districts.*
	ogr2ogr -simplify 20 -t_srs EPSG:4326 -overwrite districts/districts.shp districts/nyedwi.shp

chunks: directories
	python chunk.py buildings/buildings.shp districts/districts.shp chunks/buildings-%s.shp ElectDist
	python chunk.py addresses/addresses.shp districts/districts.shp chunks/addresses-%s.shp ElectDist

directories:
	mkdir -p chunks
	mkdir -p osm

osm: chunks
	python convert.py
{'fraction_non_alphanumeric': 0.09243458475540386, 'fraction_numerical': 0.04436860068259386, 'mean_word_length': 5.011965811965812, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '268847', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1318, 'n_words': 258}