/** * * @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__); }
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; }
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; }
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)); }
public static function read() { $model = parent::read(); $model->processLineStrings(); return $model; }
public static function read() { $model = parent::read(); $model->geometry = [static::getPoint()]; return $model; }
public function get_coordinate() { return geometry::lat_long_to_os($this); }