<commit_before>#!/usr/bin/env bash

if [ ! -e data.pbf ]; then
	wget -O data.pbf http://download.geofabrik.de/europe/lithuania-latest.osm.pbf
fi

CONTAINER_DB=`docker-compose ps -q db`
# install shp2pgsql
docker exec $CONTAINER_DB sh -c 'apt update -qy && apt install -qy postgis'

# load data
docker run --rm -it -w /tmp/src -v `pwd`:/tmp/src --network "container:$CONTAINER_DB" -e PGPASSWORD=osm openmap/osm2pgsql:latest osm2pgsql -s -c -C 512 --multi-geometry -S db/osm2pgsql.style -d osm -U osm -H db data.pbf
docker exec -u postgres $CONTAINER_DB sh -c 'psql osm -f /src/db/index.sql'
docker exec -u postgres $CONTAINER_DB sh -c 'psql osm -f /src/db/tables/table_poi.sql'
docker exec -u postgres $CONTAINER_DB sh -c 'bunzip2 -ck /src/queries/coastline/coastline.sql.bz2 | psql osm'<commit_msg>Add missing db scripts to be executed in init.sh<commit_after>#!/usr/bin/env bash

if [ ! -e data.pbf ]; then
	wget -O data.pbf http://download.geofabrik.de/europe/lithuania-latest.osm.pbf
fi

CONTAINER_DB=`docker-compose ps -q db`
# install shp2pgsql
docker exec $CONTAINER_DB sh -c 'apt update -qy && apt install -qy postgis'

# load data
docker run --rm -it -w /tmp/src -v `pwd`:/tmp/src --network "container:$CONTAINER_DB" -e PGPASSWORD=osm openmap/osm2pgsql:latest osm2pgsql -s -c -C 512 --multi-geometry -S db/osm2pgsql.style -d osm -U osm -H db data.pbf
docker exec -u postgres $CONTAINER_DB sh -c 'psql osm -f /src/db/index.sql'
docker exec -u postgres $CONTAINER_DB sh -c 'psql osm -f /src/db/tables/table_poi.sql'
docker exec -u postgres $CONTAINER_DB sh -c 'psql osm -f /src/db/tables/table_gen_ways.sql'

docker exec -u postgres $CONTAINER_DB sh -c 'psql osm -f /src/db/gen_way.sql'
docker exec -u postgres $CONTAINER_DB sh -c 'psql osm -f /src/db/gen_water.sql'
docker exec -u postgres $CONTAINER_DB sh -c 'psql osm -f /src/db/gen_building.sql'
docker exec -u postgres $CONTAINER_DB sh -c 'psql osm -f /src/db/gen_forest.sql'
docker exec -u postgres $CONTAINER_DB sh -c 'psql osm -f /src/db/gen_protected.sql'

#docker exec -u postgres $CONTAINER_DB sh -c 'bunzip2 -ck /src/queries/coastline/coastline.sql.bz2 | psql osm'
{'fraction_non_alphanumeric': 0.1327392120075047, 'fraction_numerical': 0.008442776735459663, 'mean_word_length': 3.5479744136460556, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1293248', 'n_tokens_mistral': 957, 'n_tokens_neox': 883, 'n_words': 259}