Skip to content

Commit

Permalink
Fix estat 2020 data import
Browse files Browse the repository at this point in the history
  • Loading branch information
sanak committed Jul 24, 2024
1 parent 549f0fe commit 305da19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions scripts/download_estat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ set -e # Exit script immediately on first error.
#set -x # Print commands and their arguments as they are executed.

YEAR_TCODES=(
"2020 A002005212015"
"2015 A002005212015"
"2020 A002005212020"
"2015 A002005212015" # JGD2011 datum support started from 2015
#"2010 A002005212010"
#"2005 A002005212005"
#"2000 A002005512000"
Expand Down Expand Up @@ -72,11 +72,11 @@ BASE_URL="https://www.e-stat.go.jp/gis/statmap-search/data"
echo -e "Downloading zip files and extracting shp files..."
for pref_code in $(seq -w 1 47); do
# echo "Downloading prefecture ${i} in ${tcode} ..."
url="${BASE_URL}?dlserveyId=${tcode}&code=${pref_code}&coordSys=1&format=shape&downloadType=5"
zip="${OUT_ZIP_DIR}/${tcode}DDSWC${pref_code}.zip"
url="${BASE_URL}?dlserveyId=${tcode}&code=${pref_code}&coordSys=1&format=shape&downloadType=5&datum=2011"
zip="${OUT_ZIP_DIR}/${tcode}DDSWC${pref_code}-JGD2011.zip"
if [ ! -e "${zip}" ] ; then
curl -s "${url}" > "${zip}"
sleep 2
sleep 5
fi
unzip -qq -jo ${zip} -d ${OUT_SHP_DIR}
echo -ne "."
Expand Down
2 changes: 1 addition & 1 deletion scripts/import_estat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source .env

function exit_with_usage()
{
echo "Usage: bash scripts/import_estat.sh [Year (ex. 2019)]" 1>&2
echo "Usage: bash scripts/import_estat.sh [Year (ex. 2020)]" 1>&2
exit 1
}

Expand Down

0 comments on commit 305da19

Please sign in to comment.