function findNearestPlace($radius, $gazetteer = '') { #require_once('geograph/gazetteer.class.php'); if (!isset($this->nateastings)) { $this->getNatEastings(); } $gaz = new Gazetteer(); return $gaz->findBySquare($this, $radius, null, $gazetteer); }
/** * Saves update tables based on gridimage */ function updatePlaceNameId($gridsquare = null) { global $CONF; $db =& $this->_getDB(); if (!$gridsquare) { $gridsquare = $this->grid_square; } if (!isset($gridsquare->nateastings)) { $gridsquare->getNatEastings(); } $gaz = new Gazetteer(); //to optimise the query, we scan a square centred on the //the required point $radius = 30000; $places['pid'] = $gaz->findBySquare($gridsquare, $radius, array('C', 'T')); $db->Execute("update gridimage set placename_id = '{$places['pid']}',upd_timestamp = '{$this->upd_timestamp}' where gridimage_id = {$this->gridimage_id}"); }