Skip to content

Commit

Permalink
Manual merge branch master () into githubpages
Browse files Browse the repository at this point in the history
  • Loading branch information
teymour committed Feb 13, 2024
1 parent 4fd89cc commit 2eb00ff
Show file tree
Hide file tree
Showing 20 changed files with 11,474 additions and 156 deletions.
165 changes: 165 additions & 0 deletions bin/chevauchent.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
sed -i 's/.-0.493680924086802,47.33634580426346.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.463529076437804,47.32759412686128.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.463435383676394,47.32755934707508.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.463346693561499,47.32753225747194.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.462543914383763,47.33505826955758.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.462572822965445,47.33495783648472.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.462609704349045,47.33482896136389.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.462651848959801,47.33468100626406.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.462690290613083,47.33454550656879.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.462709762668551,47.33447959645772.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.462726737586212,47.33442223110735.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.462784900362655,47.334224688495496.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/.-0.462878062019943,47.333908148606895.,//g' delimitation_aoc/49/49050/*.geojson
sed -i 's/-0.463077150646705,47.33321620654894/-0.4630547179943045,47.333226342121435/g' delimitation_aoc/49/49050/*.geojson

sed -i 's/"coordinates":....-0.682428847098432,47.28637419822648.*/]}/' delimitation_aoc/49/49092/*.geojson
sed -i 's/,."type":"Feature","properties":.[^\{]*,"geometry":."type":"MultiPolygon",..$/]}/' delimitation_aoc/49/49092/*.geojson

sed -i 's/,."type":"Feature",.*/]}/' delimitation_aoc/49/49262/*geojson

sed -i 's/.-0.839546772292939,47.37199272032195.,//' delimitation_aoc/49/49244/00195.geojson delimitation_aoc/49/49244/00176.geojson delimitation_aoc/49/49244/00174.geojson
sed -i 's/.-0.823217615818851,47.361530296806386.,//' delimitation_aoc/49/49244/00195.geojson delimitation_aoc/49/49244/00176.geojson delimitation_aoc/49/49244/00174.geojson
sed -i 's/.-0.823151245697094,47.36161332611277.,//' delimitation_aoc/49/49244/00195.geojson delimitation_aoc/49/49244/00176.geojson delimitation_aoc/49/49244/00174.geojson

sed -i 's/,."type":"Feature",.*/]}/' delimitation_aoc/49/49244/00173.geojson

sed -i 's/,."type":"Feature",.*/]}/' delimitation_aoc/49/49194/00173.geojson

sed -i 's/.-0.47797990375016,47.37941639544299.,//g' delimitation_aoc/49/49167/00173.geojson delimitation_aoc/49/49167/00179.geojson delimitation_aoc/49/49167/00195.geojson delimitation_aoc/49/49167/00220.geojson delimitation_aoc/49/49167/00221.geojson
sed -i 's/.-0.477974911016515,47.37942123054248.,//g' delimitation_aoc/49/49167/00173.geojson delimitation_aoc/49/49167/00179.geojson delimitation_aoc/49/49167/00195.geojson delimitation_aoc/49/49167/00220.geojson delimitation_aoc/49/49167/00221.geojson
sed -i 's/.-0.477969670979481,47.37942634337014.,//g' delimitation_aoc/49/49167/00173.geojson delimitation_aoc/49/49167/00179.geojson delimitation_aoc/49/49167/00195.geojson delimitation_aoc/49/49167/00220.geojson delimitation_aoc/49/49167/00221.geojson
sed -i 's/.-0.477844821378301,47.379366824853996.,//g' delimitation_aoc/49/49167/00173.geojson delimitation_aoc/49/49167/00179.geojson delimitation_aoc/49/49167/00195.geojson delimitation_aoc/49/49167/00220.geojson delimitation_aoc/49/49167/00221.geojson
sed -i 's/.-0.47771335502348,47.37931777662868.,//g' delimitation_aoc/49/49167/00173.geojson delimitation_aoc/49/49167/00179.geojson delimitation_aoc/49/49167/00195.geojson delimitation_aoc/49/49167/00220.geojson delimitation_aoc/49/49167/00221.geojson
sed -i 's/.-0.477660817288225,47.37929727277617.,//g' delimitation_aoc/49/49167/00173.geojson delimitation_aoc/49/49167/00179.geojson delimitation_aoc/49/49167/00195.geojson delimitation_aoc/49/49167/00220.geojson delimitation_aoc/49/49167/00221.geojson

sed -i 's/-0.463065291398099,47.390667784452624/-0.46306374744250434,47.39066951881196/' delimitation_aoc/49/49167/00173.geojson delimitation_aoc/49/49167/00179.geojson delimitation_aoc/49/49167/00195.geojson delimitation_aoc/49/49167/00220.geojson delimitation_aoc/49/49167/00221.geojson delimitation_aoc/49/49167/00240.geojson

sed -i 's/-0.366671575018428,47.17588348116715/-0.3666707306337287,47.175882780652074/' delimitation_aoc/49/49125/*.geojson
sed -i 's/-0.360379369186044,47.18981529360219/-0.3603810850572131,47.18981573084173/' delimitation_aoc/49/49125/*.geojson
sed -i 's/.-0.360231053437796,47.1899125917934.,//' delimitation_aoc/49/49125/*.geojson
sed -i 's/.-0.359597521439796,47.190408469278154.,//' delimitation_aoc/49/49125/*.geojson
sed -i 's/.-0.359523047883956,47.190464786307764.,//' delimitation_aoc/49/49125/*.geojson
sed -i 's/.-0.359422999137568,47.19054338161251.,//' delimitation_aoc/49/49125/*.geojson
sed -i 's/{"type":"Feature","properties":{[^}]*},"geometry":{"type":"MultiPolygon","coordinates":....-0.211260939266934,47.2294852345738.,[^}]*}},//' delimitation_aoc/49/49125/*.geojson
sed -i 's/{"type":"Feature","properties":{[^}]*},"geometry":{"type":"MultiPolygon","coordinates":....-0.386476558703238,47.17890938304046.,[^}]*}},//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.363674137084008,47.17564732234506.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/-0.363674137084008,47.17564732234506/-0.363681361038579,47.175617015597076/' delimitation_aoc/49/49125/00195.geojson
sed -i 's/-0.3666707306337287,47.175882780652074/-0.3666653049098727,47.175861105110016/' delimitation_aoc/49/49125/00195.geojson


sed -i 's/.-0.469504789904452,47.25568969771887.,//' delimitation_aoc/49/49086/00195.geojson
sed -i 's/.-0.470207925875636,47.25690373090373.,//' delimitation_aoc/49/49086/*.geojson
sed -i 's/.-0.47050408323173,47.25702570715097.,//' delimitation_aoc/49/49086/*.geojson
sed -i 's/.-0.471487096935685,47.25734086012787.,//' delimitation_aoc/49/49086/*.geojson
sed -i 's/.-0.463259009124087,47.254522734810365.,//' delimitation_aoc/49/49086/00195.geojson
sed -i 's/.-0.463333241757377,47.254557372579306.,//' delimitation_aoc/49/49086/00195.geojson
sed -i 's/.-0.463488037692398,47.25462835116199.,//' delimitation_aoc/49/49086/00195.geojson
sed -i 's/.-0.463501529288348,47.2545809994774.,//' delimitation_aoc/49/49086/00195.geojson
sed -i 's/.-0.463750000102378,47.25433738972888.,//' delimitation_aoc/49/49086/*.geojson
sed -i 's/.-0.463149314678758,47.25447591009309.,//' delimitation_aoc/49/49086/00195.geojson
sed -i 's/.-0.463665896436323,47.25442884403242.,//' delimitation_aoc/49/49086/00195.geojson

sed -i 's/-0.519947012388707,47.25096838258669/-0.5199440786080345,47.25094540356011/g' delimitation_aoc/49/49086/*.geojson
sed -i 's/-0.520096586340343,47.25102728069129/-0.5201012410994963,47.25100473601654/g' delimitation_aoc/49/49086/*.geojson
sed -i 's/-0.518854397850825,47.250562972215214/-0.5188923684841029,47.250526742977115/g' delimitation_aoc/49/49086/*.geojson
sed -i 's/-0.51817661110854947.25032591080469/-0.5181976075368482,47.250305073667136/g' delimitation_aoc/49/49086/*.geojson
sed -i 's/.-0.470886834189289,47.257185009511225.,//' delimitation_aoc/49/49086/*.geojson
sed -i 's/-0.469687307577982,47.25551752575568/-0.46968629573983084,47.25551875021697/g' delimitation_aoc/49/49086/*.geojson

sed -i 's/-0.463489560349719,47.25462938700837/-0.46348700260372766,47.254628066916894/' delimitation_aoc/49/49086/00176.geojson
sed -i 's/-0.463504829708662,47.25458702848835/-0.4634999107348676,47.25458016429508/' delimitation_aoc/49/49086/00176.geojson
sed -i 's/-0.463665896436323,47.25442884403242/-0.46366761709538196,47.254421450440645/' delimitation_aoc/49/49086/00176.geojson

sed -i 's/.1.334080316973559,47.47067198278644.,//g' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.334019735003935,47.47086496620063.,//g' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.333961838345493,47.4710143199334.,//g' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.333851697386265,47.47123378537449.,//g' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.332789899424111,47.4723298266704.,//g' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.332808226072886,47.47233405070676.,//g' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.332801415608286,47.472339535502755.,//g' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.332781255279468,47.47235581369508.,//g' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.332739991913628,47.472354682653936.,//g' delimitation_aoc/41/41059/00195.geojson
sed -i 's/1.333826640963897,47.47128366761161/1.3335062742290518,47.47133706178727/' delimitation_aoc/41/41059/00195.geojson
sed -i 's/1.334224919013651,47.47021126006307/1.3339271896365688,47.4701532983473/' delimitation_aoc/41/41059/00195.geojson

sed -i 's/1.334104795053798,47.470593730478654/1.3337737784520414,47.47051838189782/g' delimitation_aoc/41/41059/00195.geojson

sed -i 's/.1.346229556344542,47.47354120961909.,//g' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.346198207922965,47.47373878241242.,//g' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.346100713541382,47.47428320093719.,//g' delimitation_aoc/41/41059/00195.geojson

sed -i 's/1.346230204142949,47.47353700509515/1.3461125611488285,47.47354650491897/' delimitation_aoc/41/41059/00195.geojson

sed -i 's/,.1.372619630524981,47.45332202370818.//' delimitation_aoc/41/41059/00195.geojson
sed -i 's/1.372619630524981,47.45332202370818/1.37186166593546,47.456846556126074/' delimitation_aoc/41/41059/00195.geojson
sed -i 's/,.1.372582446299521,47.45350250532887.//' delimitation_aoc/41/41059/00195.geojson
sed -i 's/,.1.372401705989139,47.454502063434866.//' delimitation_aoc/41/41059/00195.geojson
sed -i 's/,.1.37223748119116,47.45536728256896.//' delimitation_aoc/41/41059/00195.geojson
sed -i 's/,.1.371966091023203,47.456866591236256.//' delimitation_aoc/41/41059/00195.geojson

sed -i 's/.1.377263452496285,47.4644253394975.,//' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.377176437428711,47.46445019220961.,//' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.377059788190415,47.464477215814995.,//' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.376100944312572,47.46454656234303.,//' delimitation_aoc/41/41059/00195.geojson
sed -i 's/.1.377087434495269,47.46447141568801.,//' delimitation_aoc/41/41059/00195.geojson
sed -i 's/1.376572059591961,47.46453341450734/1.376270323313463,47.464519281396434/' delimitation_aoc/41/41059/00195.geojson

sed -i 's/-0.519947012388707,47.25096838258669/-0.5199440786080345,47.25094540356011/g' delimitation_aoc/49/49345/*.geojson
sed -i 's/-0.520096586340343,47.25102728069129/-0.5201012410994963,47.25100473601654/g' delimitation_aoc/49/49345/*.geojson
sed -i 's/-0.518854397850825,47.250562972215214/-0.5188923684841029,47.250526742977115/g' delimitation_aoc/49/49345/*.geojson
sed -i 's/-0.51817661110854947.25032591080469/-0.5181976075368482,47.250305073667136/g' delimitation_aoc/49/49345/*.geojson
sed -i 's/.-0.470886834189289,47.257185009511225.,//' delimitation_aoc/49/49345/*.geojson
sed -i 's/-0.469687307577982,47.25551752575568/-0.46968629573983084,47.25551875021697/g' delimitation_aoc/49/49345/*.geojson
sed -i 's/-0.463489560349719,47.25462938700837/-0.46348700260372766,47.254628066916894/' delimitation_aoc/49/49345/*.geojson
sed -i 's/-0.463504829708662,47.25458702848835/-0.4634999107348676,47.25458016429508/' delimitation_aoc/49/49345/*.geojson
sed -i 's/-0.463665896436323,47.25442884403242/-0.46366761709538196,47.254421450440645/' delimitation_aoc/49/49345/*.geojson
sed -i 's/-0.518176611108549,47.25032591080469/-0.5181858569240774,47.25030624119242/' delimitation_aoc/49/49345/*.geojson
sed -i 's/.-0.51833020105465,47.250377479953855.,//' delimitation_aoc/49/49345/*.geojson
sed -i 's/-0.51833020105465,47.250377479953855/-0.5181858569240774,47.25030624119242/' delimitation_aoc/49/49345/*.geojson

sed -i 's/0.149625243142544,46.709724764682186/0.14961156311989043,46.7097301271624/' delimitation_aoc/86/86053/02305.geojson
sed -i 's/.0.148652725820893,46.70930497318295.,//' delimitation_aoc/86/86053/02305.geojson
sed -i 's/0.146744366351357,46.7084687089323/0.14674287051957435,46.7084803659898/' delimitation_aoc/86/86053/02305.geojson


sed -i 's/{"type":"Feature","properties":{[^}]*},"geometry":{"type":"MultiPolygon","coordinates":....4.96114845989713,44.21548054335366.,[^}]*}},//' delimitation_aoc/84/84096/01403.geojson

sed -i 's/.-0.329650783969377,47.193380654925264.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.329717762255929,47.19338422518262.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.329813653224386,47.193397866888.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.330016422463587,47.19345529050851.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.330437662606298,47.19358031776752.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.330471392828106,47.193591331805266.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.33106564662821,47.193784186836005.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/-0.329596968567008,47.19339112333283/-0.3296459866713519,47.19331973697189/' delimitation_aoc/49/49125/00195.geojson
sed -i 's/-0.33118713495748,47.19382691667198/-0.3311918062879897,47.19381741323605/' delimitation_aoc/49/49125/00195.geojson
sed -i 's/,.-0.32667439051050018,47.192819656246428.//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/,.-0.3266743905105002,47.19281965624643.//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/,.-0.326817889396615,47.19284188284764.//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/,.-0.326677221771782,47.192820244263025.//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/-0.326585570711399,47.19278962802879/-0.32658670873038886,47.19278989287349/' delimitation_aoc/49/49125/00195.geojson
sed -i 's/-0.32656766885703,47.192767345153044/-0.3265684361839476,47.19276699580956/g' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.327189070642598,47.19289726502379.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/-0.329177012688742,47.193395721408564/-0.32917654782016825,47.19339256798415/' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.32769541048341,47.19304760945717.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.328396971059698,47.19323378904281.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.328036372879463,47.19314440609132.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.328241052584587,47.193194298873934.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.328392967811659,47.193233183270905.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/.-0.319588741554396,47.17939114437534.,//' delimitation_aoc/49/49125/00195.geojson
sed -i 's/-0.319543763764683,47.179369006311454/-0.319543369467425,47.1793704041975/' delimitation_aoc/49/49125/00195.geojson














8 changes: 4 additions & 4 deletions bin/get_delimination_aoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sha1=$(sha1sum parcellaire-aoc-shp.zip)
#################################
# Données de https://www.data.gouv.fr/fr/datasets/delimitation-parcellaire-des-aoc-viticoles-de-linao/
#################################
if ! test $sha1 = $( curl -s https://www.data.gouv.fr/fr/datasets/delimitation-parcellaire-des-aoc-viticoles-de-linao/ | grep -A 30 parcellaire-aoc-shp.zip | grep -A 6 sha1 | tail -n 1 | awk '{print $1" parcellaire-aoc-shp.zip"}' ) ; then
if ! test "$sha1" = "$( curl -s https://www.data.gouv.fr/fr/datasets/delimitation-parcellaire-des-aoc-viticoles-de-linao/ | grep -A 30 parcellaire-aoc-shp.zip | grep -A 6 sha1 | tail -n 1 | awk '{print $1" parcellaire-aoc-shp.zip"}' )" ; then
curl -s -L $( curl -s https://www.data.gouv.fr/fr/datasets/delimitation-parcellaire-des-aoc-viticoles-de-linao/ | grep -A 30 parcellaire-aoc-shp.zip | grep -B 1 Télécharger | grep href | awk -F '"' '{print $2}' ) -o parcellaire-aoc-shp.zip -z parcellaire-aoc-shp.zip
fi
actualsha1=$(sha1sum parcellaire-aoc-shp.zip)
Expand Down Expand Up @@ -53,6 +53,7 @@ cd ..

rgrep id_denom geo/features/ | sed 's/.*id_denom"://' | sed 's/,.*//' | sort -u | while read iddenom; do
iddenum_print=$( printf '%05d' $iddenom )
find delimitation_aoc/ -name $iddenum_print".geojson" -delete
rgrep -l '"id_denom": *'$iddenom',' geo/features/ | while read json ; do
insee=$(cat $json | sed 's/.*"insee": *"//' | sed 's/".*//' )
if test "$insee" = '{ '; then
Expand All @@ -69,9 +70,8 @@ rgrep id_denom geo/features/ | sed 's/.*id_denom"://' | sed 's/,.*//' | sort -u
cat $file | tr -d '\n' > $file".tmp"
mv -f $file".tmp" $file
else
echo '{"type": "FeatureCollection","name": "aoc_geojson","features": [' > $file."tmp"
cat $file | jq --compact-output .features[0] >> $file".tmp"
echo "," >> $file".tmp"
echo '{"type": "FeatureCollection","name": "aoc_geojson","features": ' > $file."tmp"
cat $file | jq --compact-output .features | sed 's/]$/,/' >> $file".tmp"
cat $json | jq --compact-output . >> $file".tmp"
echo ']}' >> $file".tmp"
cat $file".tmp" | tr -d '\n' > $file
Expand Down
3 changes: 3 additions & 0 deletions bin/rsync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

rsync -av --exclude=delimitation_aoc --exclude=geo --exclude=.gitignore --exclude=.git ../opendatawine_master/ .
11 changes: 11 additions & 0 deletions bin/test_geojson.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
include("/home/actualys/odgloire_preprod/project/plugins/acVinParcellairePlugin/lib/vendor/geoPHP/geoPHP.inc");
$geo = file_get_contents($argv[1]);
if (!geoPHP::geosInstalled()) {
throw new sfException("php-geos needed");
}

$g = geoPHP::load($geo);
$g->area();
$g->intersection($g)->area();

Loading

0 comments on commit 2eb00ff

Please sign in to comment.