Skip to content

Commit

Permalink
Fix quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
frafra committed Feb 16, 2024
1 parent 599154e commit f4b036a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ latest: $(LATEST)

$(BOUNDARIES_DATABASE): $(LATEST) $(SCRIPTS)/boundaries.ini $(SCRIPTS)/boundaries.sql
$(dir_guard)
$(SCRIPTS)/boundaries.sh $@ $^
$(SCRIPTS)/boundaries.sh "$@" "$^"

$(BOUNDARIES_GEOJSON): $(BOUNDARIES_DATABASE) $(SCRIPTS)/boundaries_geojson.sql
$(dir_guard)
Expand All @@ -81,7 +81,7 @@ pbf: $(PBF_REGIONI) $(PBF_PROVINCE) $(PBF_COMUNI)

$(GPKG_DIR)/%.gpkg: $(PBF_DIR)/%.osm.pbf
$(dir_guard)
rm -f $(@F)
rm -f "$(@F)"
ogr2ogr -f GPKG -dsco VERSION=1.2 "$@" "$<" >/dev/null

PBF_FILES = $(wildcard $(PBF_DIR)/*/*.osm.pbf)
Expand Down
2 changes: 1 addition & 1 deletion backend/scripts/extract_6_province.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ EOF
osmium extract --overwrite \
--polygon="$file" \
--output="$OUTPUT/$name.osm.pbf" \
"$OUTPUT"/../regioni/"$parent.osm.pbf"
"$OUTPUT/../regioni/$parent.osm.pbf"
done

2 changes: 1 addition & 1 deletion backend/scripts/extract_8_comuni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ EOF
osmium extract --overwrite \
--polygon="$file" \
--output="$OUTPUT/$name.osm.pbf" \
"$OUTPUT"/../province/"$parent.osm.pbf"
"$OUTPUT/../province/$parent.osm.pbf"
done
18 changes: 9 additions & 9 deletions backend/scripts/topojson.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -o pipefail
OUTPUT="$1"
DATABASE="$2"

sqlite_custom="sqlite3 -bail "$DATABASE""
sqlite_custom="sqlite3 -bail $DATABASE"

cd "$OUTPUT"

Expand Down Expand Up @@ -106,9 +106,9 @@ select ref_istat
where admin_level = 4;
EOF
) |
while read istat
while read -r istat
do
cat << EOF | $sqlite_custom | mapshaper -i - -simplify 0.005 -o limits_R_${istat}_provinces.json
cat << EOF | $sqlite_custom | mapshaper -i - -simplify 0.005 -o limits_R_"$istat"_provinces.json
.load mod_spatialite
select json_object(
'type', 'FeatureCollection',
Expand All @@ -131,8 +131,8 @@ select json_object(
where reg_istat_code = '$istat' and admin_level = 6
group by true;
EOF
geo2topo limits_R_${istat}_provinces.json -o limits_R_${istat}_provinces_topo.json
mv limits_R_${istat}_provinces{_topo,}.json
geo2topo limits_R_"$istat"_provinces.json -o limits_R_"$istat"_provinces_topo.json
mv limits_R_"$istat"_provinces{_topo,}.json
done


Expand All @@ -144,9 +144,9 @@ select ref_istat
where admin_level = 6;
EOF
) |
while read istat
while read -r istat
do
cat << EOF | $sqlite_custom | mapshaper -i - -simplify 5% -o limits_P_${istat}_municipalities.json
cat << EOF | $sqlite_custom | mapshaper -i - -simplify 5% -o limits_P_"$istat"_municipalities.json
.load mod_spatialite
select json_object(
'type', 'FeatureCollection',
Expand All @@ -169,6 +169,6 @@ select json_object(
where pro_istat_code = '$istat' and admin_level = 8
group by true;
EOF
geo2topo limits_P_${istat}_municipalities.json -o limits_P_${istat}_municipalities_topo.json
mv limits_P_${istat}_municipalities{_topo,}.json
geo2topo limits_P_"$istat"_municipalities.json -o limits_P_"$istat"_municipalities_topo.json
mv limits_P_"$istat"_municipalities{_topo,}.json
done

0 comments on commit f4b036a

Please sign in to comment.