From 1746b3dab809f530e9836dc6c0363f229adf7a9a Mon Sep 17 00:00:00 2001 From: Yaco Date: Tue, 2 Nov 2021 20:06:23 +0000 Subject: updates scripts to geolocate --- bin/reevotech/CompletaGeoPorDireccion.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/reevotech/CompletaGeoPorDireccion.sh b/bin/reevotech/CompletaGeoPorDireccion.sh index 6950e2dc..ab87018d 100755 --- a/bin/reevotech/CompletaGeoPorDireccion.sh +++ b/bin/reevotech/CompletaGeoPorDireccion.sh @@ -2,10 +2,18 @@ # Este script lo usamos para actualizar los datos de geolocalizcion ubicacion de experiencia a partir de los campos que contienen la dirección postal... Usamos OSM nominatim: `https://nominatim.org/release-docs/develop/api/Search/` # -# Se puede usar como: IFS=$(echo -en "\n\b") && for i in `php ../ListarPaginas.php Plantilla:Experiencia`; do ./CompletaGeoPorDireccion.sh "$i"; done +# Se puede usar como: IFS=$(echo -en "\n\b") && for i in `php ../ListarPaginas.php Plantilla:Experiencia`; do ./CompletaGeoPorDireccion.sh ecoversities "$i"; done + +if [ $# -eq 0 ] + then + echo "Missing parameters. Use: ./bin/reevotech/CompletaGeoPorDireccion.sh deployment Endorser:XXX Endorser" + exit +fi + DEPLOY="$1" EXP="$2" -DATA=`php PropiedadObtener.php -d="$DEPLOY" -t="$EXP" -p="ecoversity:place-street" -p="ecoversity:place-city" -p="ecoversity:place-state" -p="ecoversity:place-country" > /tmp/x && sed 's/ /+/g' /tmp/x | sed ':a;N;$!ba;s/\n/,/g'` +TEMPLATE="$3" +DATA=`php PropiedadObtener.php -d="$DEPLOY" -t="$EXP" -p="$TEMPLATE:place-street" -p="$TEMPLATE:place-city" -p="$TEMPLATE:place-state" -p="$DEPLOY:place-country" > /tmp/x && sed 's/ /+/g' /tmp/x | sed ':a;N;$!ba;s/\n/,/g'` echo "https://nominatim.openstreetmap.org/search.php?format=json&addressdetails=1&q=$DATA" if [ -z "$DATA" ] @@ -29,7 +37,7 @@ echo "Lat: $LAT" echo "Lon: $LON" if [ $LAT != "null" ]; then - php PropiedadActualizar.php -d="$DEPLOY" -t="$EXP" -f="true" -p="ecoversity:place|$LAT, $LON" + php PropiedadActualizar.php -d="$DEPLOY" -t="$EXP" -f="true" -p="$TEMPLATE:place|$LAT, $LON" sed -i "/$EXP/d" todos.log echo $EXP >> correctos.log else -- cgit v1.2.1