Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1712 → Rev 1713

/trunk/scripts/modules/201310-bulk-coord-update.php
41,12 → 41,6
printf("cache already contains %d entries, will start in 4 seconds:\n", count($cache));
sleep(4);
 
// correction
$db->query('UPDATE coel_structure SET cs_longitude = REPLACE(cs_longitude, ",", "."), cs_latitude = REPLACE(cs_latitude, ",", ".")');
$db->query('ALTER TABLE coel_structure MODIFY cs_longitude DOUBLE(12,9) NULL DEFAULT NULL');
$db->query('ALTER TABLE coel_structure MODIFY cs_latitude DOUBLE(12,9) NULL DEFAULT NULL');
$db->query('UPDATE coel_structure SET cs_latitude = NULL, cs_longitude = NULL WHERE cs_latitude = "0" AND cs_longitude = "0"');
$db->query('UPDATE coel_structure SET cs_nbre_personne = NULL WHERE cs_nbre_personne = 0');
// smooth:
$q = "SELECT * FROM coel_structure".
" WHERE cs_latitude IS NULL OR cs_latitude = '' OR cs_longitude IS NULL".