<commit_before>NAMESPACE = osm2vectortiles
POSTGIS_IMAGE = $(NAMESPACE)/postgis
IMPOSM_IMAGE = $(NAMESPACE)/imposm3

CWD = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PGDATA_DIR = $(CWD)/pgdata
IMPORT_DATA_DIR = $(CWD)/import
IMPORT_CACHE_DIR = $(CWD)/cache

OSM_DB = "osm_zurich"
OSM_USER = "osm"
OSM_PASSWORD = "<PASSWORD>"
ZURICH_PBF = https://s3.amazonaws.com/metro-extracts.mapzen.com/zurich_switzerland.osm.pbf

postgis:
	docker build -t $(POSTGIS_IMAGE) ./database/postgis

imposm3:
	docker build -t $(IMPOSM_IMAGE) ./database/imposm3

docker: postgis imposm3

prepare:
	mkdir -p $(PGDATA_DIR); \
    mkdir -p $(IMPORT_DATA_DIR); \
	mkdir -p $(IMPORT_CACHE_DIR);

build: docker

import: prepare docker
	wget --directory-prefix $(IMPORT_DATA_DIR) --no-clobber $(ZURICH_PBF); \
	docker run --name postgis \
		-v $(PGDATA_DIR):/var/lib/postgresql/data \
		-e OSM_DB=$(OSM_DB) \
		-e OSM_USER=$(OSM_USER) \
		-e OSM_PASSWORD=$(OSM_PASSWORD) \
		-d $(POSTGIS_IMAGE); \
	sleep 20; \
    @echo "Wait until PostGIS is initialized"; \
	docker run --rm --name imposm \
		-v $(IMPORT_DATA_DIR):/data/import \
		-v $(IMPORT_CACHE_DIR):/data/cache \
		--link postgis:db \
		-e OSM_DB=$(OSM_DB) \
		-e OSM_USER=$(OSM_USER) \
		-e OSM_PASSWORD=$(OSM_PASSWORD) \
		osm2vectortiles/imposm3

default: build
<commit_msg>Show output logs after running postgis container.<commit_after>NAMESPACE = osm2vectortiles
POSTGIS_IMAGE = $(NAMESPACE)/postgis
IMPOSM_IMAGE = $(NAMESPACE)/imposm3

CWD = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PGDATA_DIR = $(CWD)/pgdata
IMPORT_DATA_DIR = $(CWD)/import
IMPORT_CACHE_DIR = $(CWD)/cache

OSM_DB = "osm_zurich"
OSM_USER = "osm"
OSM_PASSWORD = "<PASSWORD>"
ZURICH_PBF = https://s3.amazonaws.com/metro-extracts.mapzen.com/zurich_switzerland.osm.pbf

postgis:
	docker build -t $(POSTGIS_IMAGE) ./database/postgis

imposm3:
	docker build -t $(IMPOSM_IMAGE) ./database/imposm3

docker: postgis imposm3

prepare:
	mkdir -p $(PGDATA_DIR); \
    mkdir -p $(IMPORT_DATA_DIR); \
	mkdir -p $(IMPORT_CACHE_DIR);

build: docker

import: prepare docker
	wget --directory-prefix $(IMPORT_DATA_DIR) --no-clobber $(ZURICH_PBF); \
	docker run --name postgis \
		-v $(PGDATA_DIR):/var/lib/postgresql/data \
		-e OSM_DB=$(OSM_DB) \
		-e OSM_USER=$(OSM_USER) \
		-e OSM_PASSWORD=$(OSM_PASSWORD) \
		-d $(POSTGIS_IMAGE); \
    echo "Wait until PostGIS is initialized"; \
	sleep 20; \
	docker logs postgis; \
	docker run --rm --name imposm \
		-v $(IMPORT_DATA_DIR):/data/import \
		-v $(IMPORT_CACHE_DIR):/data/cache \
		--link postgis:db \
		-e OSM_DB=$(OSM_DB) \
		-e OSM_USER=$(OSM_USER) \
		-e OSM_PASSWORD=$(OSM_PASSWORD) \
		osm2vectortiles/imposm3

default: build

{'fraction_non_alphanumeric': 0.15316315205327413, 'fraction_numerical': 0.007399186089530152, 'mean_word_length': 4.082706766917293, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5403447', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1136, 'n_words': 215}