Skip to content

Commit

Permalink
sync master
Browse files Browse the repository at this point in the history
  • Loading branch information
teymour committed Aug 7, 2023
1 parent 4547ca9 commit 948d23c
Show file tree
Hide file tree
Showing 2,517 changed files with 20,924 additions and 41,586 deletions.
9 changes: 4 additions & 5 deletions bin/get_delimination_aoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,11 @@ cat $(find delimitation_aoc/ -name delimitations.json) | grep '^"' | sort -u | s
denomid=$(echo $line| sed 's/;.*//')
denomination=$(echo $line| sed 's/.*;//')
find delimitation_aoc -name $denomid".geojson" | while read file ; do
cat $file | jq -c .features[0].properties | sed 's/\\"//g' | sed 's/;/ /g' | jq -c '[.dt,.type_prod,.categorie,.type_denom,.type_ig,.id_app,.app,.id_denom,.denom,.insee,.nomcom,.insee2011,.nomcom2011,.id_aire,.crinao,.grp_name1,.grp_name2]' | awk -F '"' 'BEGIN{OFS = "\"" ;} {gsub(",", " -", $6); gsub(",", " -", $22); gsub(",", " -", $24); gsub(",", " -", $26); gsub(",", "|", $14); gsub(",", "|", $16); gsub(",", "|", $18); gsub(",", "|", $20); print $0}' | sed 's/,null,/,,/g' | sed 's/^\[//' | sed 's/\]$//' | sed 's/,/;/g' >> denominations.csv
cat $file | jq -c .features[0].properties | sed 's/\\"//g' | sed 's/;/ /g' | jq -c '[.dt,.type_prod,.categorie,.type_denom,.type_ig,.id_app,.app,.id_denom,.denom,.insee,.nomcom,.insee2011,.nomcom2011,.id_aire,.crinao,.grp_name1,.grp_name2]' | sed 's/]$//' | awk -F '"' 'BEGIN{OFS = "\"" ;} { gsub(",", " -@- ", $4); gsub(",", " -@- ", $6); gsub(",", " -@- ", $8); gsub(",", " -@- ", $10); gsub(",", " -@- ", $22); gsub(",", " -@- ", $24); gsub(",", " -@- ", $26); gsub(",", "|", $14); gsub(",", "|", $16); gsub(",", "|", $18); gsub(",", "|", $20); print $0}' | sed 's/,null/,/g' | sed 's/^\[//' | sed 's/"*$//' | sed 's/,/;/g' | sed 's/ -@- /,/g' >> denominations.csv
done
done
sed -i 's/Côtes de Bourg; Bourg et Bourgeais/Côtes de Bourg, Bourg et Bourgeais/' denominations.csv

echo "<html><head><script type='text/javascript' src='web/js/bootstrap.bundle.5.3.0-alpha3.min.js'></script><link rel='stylesheet' type='text/css' media='screen' href='web/css/bootstrap.5.3.0-alpha3.min.css'/></head><body><div class='container'><h1>Dénominations INAO</h1><ul>" > denominations.html
echo "<html><head><script type='text/javascript' src='web/js/bootstrap.bundle.5.3.0-alpha3.min.js'></script><link rel='stylesheet' type='text/css' media='screen' href='web/css/bootstrap.5.3.0-alpha3.min.css'/><title>Les délimitations INAO</title></head><body><div class='container'><h1>Dénominations INAO</h1><ul>" > denominations.html
tail -n +2 denominations.csv | sed 's/"//g' | awk -F ';' '{print $8";"$9}' | sort -u | awk -F ';' '{printf("<li><a href=\"denominations/%05d.html\">%s</a></li>\n", $1, $2);}' >> denominations.html
echo "</ul></div></body></html>" >> denominations.html

Expand All @@ -118,7 +117,7 @@ tail -n +2 denominations.csv | awk -F ';' '{print $8";"$9}' | sed 's/"//g' | sor
denomination=$(echo $line | sed 's/.*;//')
denomorig=$(echo $denomid | sed 's/^0*//')

echo "<html><head><script type='text/javascript' src='../web/js/bootstrap.bundle.5.3.0-alpha3.min.js'></script><link rel='stylesheet' type='text/css' media='screen' href='../web/css/bootstrap.5.3.0-alpha3.min.css'/></head><body><div class='container'><h1>"$denomination"</h1><p>Liste des villes:</p><table>" > "denominations/"$denomid".html"
echo "<html><head><script type='text/javascript' src='../web/js/bootstrap.bundle.5.3.0-alpha3.min.js'></script><link rel='stylesheet' type='text/css' media='screen' href='../web/css/bootstrap.5.3.0-alpha3.min.css'/><title>Les communes de la dénomination "$denomination"</title></head><body><div class='container'><h1>"$denomination"</h1><p>Liste des villes:</p><table>" > "denominations/"$denomid".html"
grep '";'$denomorig';"' denominations.csv | awk -F ';' '{if ($8 = '$denomorig') print $10";"$11;}' | sed 's/"//g' | awk -F ';' '{dep=substr($1,0,2); print "<tr class=\"ville\"><td>"dep"</td><td><a href=\"../carte.html?insee="$1"&denomid='$denomid'\">"$2"</a></td></tr>"}' >> "denominations/"$denomid".html"
echo "</table></div></body></html>" >> "denominations/"$denomid".html"
echo "denominations/"$denomid".html"
Expand All @@ -128,7 +127,7 @@ tail -n +2 denominations.csv | awk -F ';' '{print $8";"$9}' | sed 's/"//g' | sor
sed -i 's/,$/]/' "denominations/"$denomid".json"
done

echo "<html><head><script type='text/javascript' src='web/js/bootstrap.bundle.5.3.0-alpha3.min.js'></script><link rel='stylesheet' type='text/css' media='screen' href='web/css/bootstrap.5.3.0-alpha3.min.css'/></head><body><h1>Communes ayant des dénominations INAO</h1><ul>" > communes.html
echo "<html><head><script type='text/javascript' src='web/js/bootstrap.bundle.5.3.0-alpha3.min.js'></script><link rel='stylesheet' type='text/css' media='screen' href='web/css/bootstrap.5.3.0-alpha3.min.css'/><title>Les communes viticoles</title></head><body><h1>Communes ayant des dénominations INAO</h1><ul>" > communes.html
tail -n +2 denominations.csv | awk -F ';' '{print $10";"$11}' | sed 's/"//g' | sort -u | awk -F ';' '{ dep=substr($1,0, 2); print "<li><a href=\"carte.html?insee="$1"\">"$2" ("dep")</a></li>" }' >> communes.html
echo "</ul></div></body></html>" >> communes.html

2 changes: 1 addition & 1 deletion carte.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="charset" content="utf-8" />
<meta name="content-language" content="fr-FR" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Carte</title>
<title>Carte des dénominations de la commune</title>
<script type="text/javascript" src="web/js/lib/leaflet/leaflet.js"></script>
<script type="text/javascript" src="web/js/lib/jquery/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="web/js/colors.js"></script>
Expand Down
Loading

0 comments on commit 948d23c

Please sign in to comment.