From c7d784c58f742f9e5187263bc09765e8993a6875 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Fri, 13 May 2011 14:29:59 +0200 Subject: [PATCH] Adds scripts to retrieve pre geocoded data from dev server. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- upgrade/1.1.2/README | 2 ++ upgrade/1.1.2/retrieve_address_tables.sh | 6 ++++++ upgrade/1.1.2/xx_retrieve_geocoding.sql | 11 +++++++++++ 3 files changed, 19 insertions(+) create mode 100644 upgrade/1.1.2/README create mode 100755 upgrade/1.1.2/retrieve_address_tables.sh create mode 100644 upgrade/1.1.2/xx_retrieve_geocoding.sql diff --git a/upgrade/1.1.2/README b/upgrade/1.1.2/README new file mode 100644 index 0000000..272bed9 --- /dev/null +++ b/upgrade/1.1.2/README @@ -0,0 +1,2 @@ +Once all sql/php scripts have be run, run retrieve_address_tables.sh and finally xx_retrieve_geocoding.sql. +Then "./formatAddresses.php -g -t g -r e" will format the last ungeocoded addresses. diff --git a/upgrade/1.1.2/retrieve_address_tables.sh b/upgrade/1.1.2/retrieve_address_tables.sh new file mode 100755 index 0000000..94cdb9a --- /dev/null +++ b/upgrade/1.1.2/retrieve_address_tables.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +mysqldump -h murphy geocoding profile_addresses | sed -e 's/profile_addresses/tmp_profile_addresses/' | mysql x5dat +mysqldump -h murphy geocoding profile_addresses_components | mysql x5dat +mysqldump -h murphy geocoding profile_addresses_components_enum | mysql x5dat + diff --git a/upgrade/1.1.2/xx_retrieve_geocoding.sql b/upgrade/1.1.2/xx_retrieve_geocoding.sql new file mode 100644 index 0000000..95da5cd --- /dev/null +++ b/upgrade/1.1.2/xx_retrieve_geocoding.sql @@ -0,0 +1,11 @@ + UPDATE profile_addresses AS pa +INNER JOIN tmp_profile_addresses AS ta ON (pa.pid = ta.pid AND pa.jobid = ta.jobid AND pa.groupid = ta.groupid AND pa.type = ta.type AND pa.text = ta.text) + SET pa.id = ta.id, pa.postalText = ta.postalText, pa.formatted_address = ta.formatted_address, pa.types = ta.types, + pa.latitude = ta.latitude, pa.longitude = ta.longitude, pa.southwest_latitude = ta.southwest_latitude, + pa.southwest_longitude = ta.southwest_longitude, pa.northeast_latitude = ta.northeast_latitude, pa.northeast_longitude = ta.northeast_longitude, + pa.location_type = ta.location_type, pa.partial_match = ta.partial_match, + pa.geocoding_date = ta.geocoding_date, pa.geocoding_calls = ta.geocoding_calls; + +DROP TABLE tmp_profile_addresses; + +-- vim:set syntax=mysql: -- 2.1.4