Skip to content

Commit

Permalink
fix: repair spatial import for non-nested ZIP files
Browse files Browse the repository at this point in the history
  • Loading branch information
friedjoff committed Apr 27, 2020
1 parent 90d3730 commit faa02a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/data/spatial/1-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ _import () {
cd /data/spatial
wget --no-check-certificate "${URL}" -O "${TARGET}.zip"
7z x -aoa -o"${TARGET}" "${TARGET}.zip"
if [ -f "/data/spatial/${TARGET}/${TARGET}.zip" ]; then
7z x -aoa -o"${TARGET}" "${TARGET}/${TARGET}.zip"
rm "${TARGET}/${ZIPFILE}.zip"
fi
cd ${TARGET}
#mv ${TARGET}/${SHPFILE}.* .
rm "${TARGET}.zip"
if [ -f "/data/spatial/${TARGET}/${ZIPFILE}/${SHPFILE}.shp" ]; then
mv ${ZIPFILE}/${SHPFILE}.* .
else
7z x -aoa -o"." "${ZIPFILE}.zip"
rm "${ZIPFILE}.zip"
fi
rename "s/${SHPFILE}/${TARGET}/" ${SHPFILE}.*
else
echo "$TARGET already downloaded! Will be reused ..."
Expand Down

0 comments on commit faa02a6

Please sign in to comment.