示例#1
0
 /**
  *  
  * @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
 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
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
 public function get_coordinate()
 {
     return geometry::lat_long_to_os($this);
 }