summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/reevotech/CompletaGeoPorDireccion.sh14
1 files 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