コード例 #1
0
ファイル: fix_geocoding.php プロジェクト: rdmpage/bioguid
<?php

// geocode a reference
require_once dirname(__FILE__) . '/db.php';
require_once dirname(__FILE__) . '/lib.php';
require_once dirname(__FILE__) . '/geocoding.php';
require_once dirname(__FILE__) . '/bhl_text.php';
$ids = array(55225);
foreach ($ids as $reference_id) {
    global $db;
    echo $reference_id . "\n";
    // remove any existing geocoding...
    $pages = bhl_retrieve_reference_pages($reference_id);
    foreach ($pages as $page) {
        $sql = 'DELETE FROM rdmp_locality_page_joiner WHERE PageID=' . $page->PageID;
        $result = $db->Execute($sql);
        if ($result == false) {
            die("failed [" . __FILE__ . ":" . __LINE__ . "]: " . $sql);
        }
    }
    // redo
    bhl_geocode_reference($reference_id);
}
コード例 #2
0
ファイル: display_reference.php プロジェクト: rdmpage/bioguid
 function Retrieve()
 {
     if ($this->id != 0) {
         $this->object = db_retrieve_reference($this->id);
         $this->in_bhl = db_reference_from_bhl($this->id);
     }
     // Geocoding?
     if ($this->in_bhl) {
         if (!bhl_has_been_geocoded($this->id)) {
             bhl_geocode_reference($this->id);
         }
         $this->localities = bhl_localities_for_reference($this->id);
     }
     // Specimens?
     if ($this->in_bhl) {
         if (!specimens_has_been_parsed($this->id)) {
             specimens_from_reference($this->id);
         }
         $this->specimens = specimens_from_db($this->id);
     }
     return $this->object;
 }