-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
648 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Submodule overturemaps-py
added at
5148bf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# postgres | ||
POSTGRES_USER=postgres | ||
POSTGRES_DATABASE=postgres | ||
|
||
# define cities | ||
cities=("tokyo" "tateyama" "hamamatsu" "higashi_hiroshima" "kumamoto" "morioka") | ||
city_labels=("Tokyo" "Tateyama" "Hmaamatsu" "Higashi-hiroshima" "Kumamoto" "Morioka") ## becase of shape file 'Hmaamatsu' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# move to working directory | ||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
cd "${SCRIPT_DIR}" | ||
|
||
# set config | ||
source config.sh | ||
|
||
for city in "${cities[@]}"; do | ||
echo $city | ||
sql="\copy ( | ||
select | ||
building, | ||
count(*) as cnt | ||
from osm.building_$city | ||
group by | ||
building | ||
order by | ||
cnt desc | ||
) to '$SCRIPT_DIR/tsv/osm_building_cnt_$city.tsv' | ||
with csv delimiter E'\t';" | ||
psql -d $POSTGRES_DATABASE -U $POSTGRES_USER -c "$sql" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# move to working directory | ||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
cd "${SCRIPT_DIR}" | ||
|
||
# set config | ||
source config.sh | ||
|
||
sql="\copy ( | ||
select | ||
distinct building | ||
from osm.building | ||
order by building | ||
) to '$SCRIPT_DIR/tsv/osm_building_distinct_tag.tsv' | ||
with csv delimiter E'\t';" | ||
psql -d $POSTGRES_DATABASE -U $POSTGRES_USER -c "$sql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
#!/bin/bash | ||
|
||
cities=("tokyo" "tateyama" "hamamatsu" "higashi_hiroshima" "kumamoto" "morioka") | ||
# move to working directory | ||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
cd "${SCRIPT_DIR}" | ||
|
||
# set config | ||
source config.sh | ||
|
||
for city in "${cities[@]}"; do | ||
echo $city | ||
sql="\copy (select area_id, id, ST_AsText(geom)from building_$city) to '~/tsv/osm_building_$city.tsv' with csv delimiter E'\t';" | ||
psql -d shimazaki -U postgres -c "$sql" | ||
sql="\copy ( | ||
select | ||
area_id, | ||
id, | ||
ST_AsText(geom), | ||
building, | ||
height | ||
from osm.building_$city | ||
) to '$SCRIPT_DIR/tsv/osm_building_$city.tsv' | ||
with csv delimiter E'\t';" | ||
psql -d $POSTGRES_DATABASE -U $POSTGRES_USER -c "$sql" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
#!/bin/bash | ||
|
||
cities=("tokyo" "tateyama" "hamamatsu" "higashi_hiroshima" "kumamoto" "morioka") | ||
# move to working directory | ||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
cd "${SCRIPT_DIR}" | ||
|
||
# set config | ||
source config.sh | ||
|
||
for city in "${cities[@]}"; do | ||
echo $city | ||
sql="\copy ( | ||
select | ||
class, subclass, count(*) as subclass_cnt | ||
from poi_$city | ||
from osm.poi_$city | ||
group by class, subclass | ||
order by class, subclass_cnt desc) | ||
to '~/osm/tsv/poi_cnt_$city.tsv' | ||
with csv delimiter E'\t'; | ||
order by class, subclass_cnt desc | ||
) to '$SCRIPT_DIR/tsv/osm_poi_cnt_$city.tsv' | ||
with csv delimiter E'\t'; | ||
" | ||
psql -d shimazaki -U postgres -c "$sql" | ||
psql -d $POSTGRES_DATABASE -U $POSTGRES_USER -c "$sql" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# move to working directory | ||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
cd "${SCRIPT_DIR}" | ||
|
||
# set config | ||
source config.sh | ||
|
||
cnt=0 | ||
for city in "${cities[@]}"; do | ||
echo $city | ||
sql=" | ||
select | ||
count(height) as cnt_height | ||
from osm.building_$city | ||
" | ||
psql -d $POSTGRES_DATABASE -U $POSTGRES_USER -c "$sql" | ||
|
||
((cnt++)) | ||
done |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
copy ( | ||
select | ||
area_id, | ||
id, | ||
ST_asText (geom), | ||
building, | ||
height | ||
from | ||
osm.building | ||
where | ||
area_id is not null | ||
and geom is not null | ||
order by | ||
area_id | ||
) | ||
to STDOUT with csv header delimiter E'\t' \g '../tsv/building.tsv' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.