Skip to content

Commit

Permalink
change dir name from SQL to Bash, and change Abbreviation from ovt to…
Browse files Browse the repository at this point in the history
… omf
  • Loading branch information
ke-lm committed Jul 26, 2024
1 parent 6210313 commit 6fd389c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
drop table ovt.tokyo_bld;
create table ovt.tokyo_bld (
drop table omf.tokyo_bld;
create table omf.tokyo_bld (
ogc_fid integer,
wkb_geometry geometry(MULTIPOLYGON, 4326),
id varchar,
Expand All @@ -26,8 +26,8 @@ create table ovt.tokyo_bld (
)
;

drop table ovt.hamamatsu_bld;
create table ovt.hamamatsu_bld (
drop table omf.hamamatsu_bld;
create table omf.hamamatsu_bld (
ogc_fid integer,
wkb_geometry geometry(MULTIPOLYGON, 4326),
id varchar,
Expand All @@ -53,8 +53,8 @@ create table ovt.hamamatsu_bld (
area_name char(50))
;

drop table ovt.tateyama_bld;
create table ovt.tateyama_bld (
drop table omf.tateyama_bld;
create table omf.tateyama_bld (
ogc_fid integer,
wkb_geometry geometry(MULTIPOLYGON, 4326),
id varchar,
Expand All @@ -81,8 +81,8 @@ create table ovt.tateyama_bld (
)
;

drop table ovt.kumamoto_bld;
create table ovt.kumamoto_bld (
drop table omf.kumamoto_bld;
create table omf.kumamoto_bld (
ogc_fid integer,
wkb_geometry geometry(MULTIPOLYGON, 4326),
id varchar,
Expand All @@ -109,8 +109,8 @@ create table ovt.kumamoto_bld (
)
;

drop table ovt.higashi_hiroshima_bld;
create table ovt.higashi_hiroshima_bld (
drop table omf.higashi_hiroshima_bld;
create table omf.higashi_hiroshima_bld (
ogc_fid integer,
wkb_geometry geometry(MULTIPOLYGON, 4326),
id varchar,
Expand All @@ -137,8 +137,8 @@ create table ovt.higashi_hiroshima_bld (
)
;

drop table ovt.morioka_bld;
create table ovt.morioka_bld (
drop table omf.morioka_bld;
create table omf.morioka_bld (
ogc_fid integer,
wkb_geometry geometry(MULTIPOLYGON, 4326),
id varchar,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# It will takes 25 minutes to process 5 areas
# Initialize the command in seconds.
SECONDS=0
Expand All @@ -8,40 +9,40 @@ cd "${SCRIPT_DIR}"

mkdir ./data/202405/overturemaps/

psql -U postgres -d postgres -c "create schema ovt;"
psql -U postgres -d postgres -c "create schema omf;"

psql -U postgres -d postgres -c "drop table if exists ovt.hamamatsu_bld;"
psql -U postgres -d postgres -c "drop table if exists ovt.tokyo_bld;"
psql -U postgres -d postgres -c "drop table if exists ovt.tateyama_bld;"
psql -U postgres -d postgres -c "drop table if exists ovt.kumamoto_bld;"
psql -U postgres -d postgres -c "drop table if exists ovt.higashi_hiroshima_bld;"
psql -U postgres -d postgres -c "drop table if exists ovt.morioka_bld;"
psql -U postgres -d postgres -c "drop table if exists omf.hamamatsu_bld;"
psql -U postgres -d postgres -c "drop table if exists omf.tokyo_bld;"
psql -U postgres -d postgres -c "drop table if exists omf.tateyama_bld;"
psql -U postgres -d postgres -c "drop table if exists omf.kumamoto_bld;"
psql -U postgres -d postgres -c "drop table if exists omf.higashi_hiroshima_bld;"
psql -U postgres -d postgres -c "drop table if exists omf.morioka_bld;"

psql -U postgres -d postgres -f ./create_tables.sql

# Tokyo
overturemaps download --bbox=139.74609375,35.67514744,139.83398438,35.74651226 -f geojson --type=building -o ./data/202405/overturemaps/tokyo.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln ovt.tokyo_bld -nlt multipolygon ./data/202405/overturemaps/tokyo.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln omf.tokyo_bld -nlt multipolygon ./data/202405/overturemaps/tokyo.geojson

# Hamamatsu
overturemaps download --bbox=137.63671875,34.66935855,137.72460938,34.7416125 -f geojson --type=building -o ./data/202405/overturemaps/hamamatsu.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln ovt.hamamatsu_bld -nlt multipolygon ./data/202405/overturemaps/hamamatsu.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln omf.hamamatsu_bld -nlt multipolygon ./data/202405/overturemaps/hamamatsu.geojson

# Tateyama
overturemaps download --bbox=139.83398438,34.95799531,139.921875,35.02999637 -f geojson --type=building -o ./data/202405/overturemaps/tateyama.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln ovt.tateyama_bld -nlt multipolygon ./data/202405/overturemaps/tateyama.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln omf.tateyama_bld -nlt multipolygon ./data/202405/overturemaps/tateyama.geojson

# Kumamoto
overturemaps download --bbox=130.68726409,32.72948989,130.77515472,32.80174385 -f geojson --type=building -o ./data/202405/overturemaps/kumamoto.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln ovt.kumamoto_bld -nlt multipolygon ./data/202405/overturemaps/kumamoto.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln omf.kumamoto_bld -nlt multipolygon ./data/202405/overturemaps/kumamoto.geojson

# Higashi_hiroshima
overturemaps download --bbox=132.69418348,34.38622724,132.7820741,34.45848119 -f geojson --type=building -o ./data/202405/overturemaps/higashi_hiroshima.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln ovt.higashi_hiroshima_bld -nlt multipolygon ./data/202405/overturemaps/higashi_hiroshima.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln omf.higashi_hiroshima_bld -nlt multipolygon ./data/202405/overturemaps/higashi_hiroshima.geojson

# Morioka
overturemaps download --bbox=141.07765453,39.6823863,141.16554516,39.75375112 -f geojson --type=building -o ./data/202405/overturemaps/morioka.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln ovt.morioka_bld -nlt multipolygon ./data/202405/overturemaps/morioka.geojson
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres" -nln omf.morioka_bld -nlt multipolygon ./data/202405/overturemaps/morioka.geojson


# Display the measurement time.
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 6fd389c

Please sign in to comment.