コード例 #1
0
ファイル: Collection.class.php プロジェクト: rccc/simpleGeo
 /**
  *  
  * @param $components
  * @param $class
  * @return unknown_type
  */
 public function __construct($components = array(), $class = null)
 {
     if (!empty($components)) {
         $this->addComponents($components);
     }
     parent::__construct(isset($class) ? $class : __CLASS__);
 }
コード例 #2
0
ファイル: multiPoint.php プロジェクト: nailfor/esri
 public static function read()
 {
     $model = parent::read();
     $reader = static::$reader;
     $numGeometries = $reader->read("d");
     for ($i = 0; $i < $numGeometries; $i++) {
         $model->geometry[] = static::getPoint();
     }
     return $model;
 }
コード例 #3
0
ファイル: OS.php プロジェクト: robchett/uknxcl
 public static function cells()
 {
     if (!isset(self::$cells)) {
         self::$cells = new collection();
         foreach (self::$cell_codes as $code) {
             $cell = new lat_lng_bound(geometry::os_to_lat_long($code . '99999999'), geometry::os_to_lat_long($code . '000000'));
             $cell->code = $code;
             self::$cells[] = $cell;
         }
     }
     return self::$cells;
 }
コード例 #4
0
ファイル: wpt_to_kml.php プロジェクト: robchett/uknxcl
function deg_min_2_os($lat, $lon)
{
    $lat = explode(' ', $lat);
    if ($lat[0] == "S" || $lat[0] == "W") {
        $lat = -round((int) $lat[1] + (int) $lat[2] / 60 + (double) $lat[3] / 3600, 4);
    } else {
        $lat = round((int) $lat[1] + (int) $lat[2] / 60 + (double) $lat[3] / 3600, 4);
    }
    $lon = explode(' ', $lon);
    if ($lon[0] == "S" || $lon[0] == "W") {
        $lon = -round((int) $lon[1] + (int) $lon[2] / 60 + (double) $lon[3] / 3600, 4);
    } else {
        $lon = round((int) $lon[1] + (int) $lon[2] / 60 + (double) $lon[3] / 3600, 4);
    }
    return geometry::lat_long_to_os(new lat_lng($lat, $lon));
}
コード例 #5
0
ファイル: polyline.php プロジェクト: nailfor/esri
 public static function read()
 {
     $model = parent::read();
     $model->processLineStrings();
     return $model;
 }
コード例 #6
0
ファイル: point.php プロジェクト: nailfor/esri
 public static function read()
 {
     $model = parent::read();
     $model->geometry = [static::getPoint()];
     return $model;
 }
コード例 #7
0
ファイル: lat_lng.php プロジェクト: robchett/uknxcl
 public function get_coordinate()
 {
     return geometry::lat_long_to_os($this);
 }