コード例 #1
0
 function IIRS_0_TIs_all($page_size = 0, $page_offset = 0)
 {
     //TODO: use the IIRS_0_TIs_nearby() with unlimited results
     //setting sensible limit of 5000 for performance purposes
     //TODO: admin warning when limit is at 4000
     $TIs = IIRS_0_TIs_nearby(0, 0, '', 5000);
     // required function
     return $TIs;
 }
コード例 #2
0
function IIRS_0_TI_vicinity_match($location_latitude, $location_longitude, $location_description)
{
    // returns TRUE or FALSE
    // $geokml, $location_description = potential matches to test for against the database
    // TIs may have identical location but different areas of interest.
    //   e.g. town vs. county areas but with same lat / lng
    $registered = FALSE;
    $TIs_nearby = IIRS_0_TIs_nearby($location_latitude, $location_longitude, $location_description);
    foreach ($TIs_nearby as $town_name => $aDetails) {
        /*
        // compare the new TI with the nearby ones to decide if this registration is acceptable
        // policy level decisions are needed to decide what duplicates are and are not acceptable
        // currently this is disabled awaiting those decisions
        // i think that all registrations should be accepted, even in identical locations but names should be unique
        // nearby or identical locations should be encouraged to cooperate, not compete for ownership of space
        // ownership of space is an abstract human concept. now, back to work :D
        if ( isset($aDetails['location_description'] ) ) {
          if ( strcasecmp($aDetails['location_description'], $location_description ) ) $registered = true;
        }
        
        // try to asses how close / similar the areas are
        if ( isset($aDetails['geokml'] ) ) {
          $geokml = $aDetails['geokml'];
          //TODO: area comparison
          if (false) $registered = TRUE;
        }
        */
    }
    return $registered;
}