示例#1
0
 /**
  * @param array $positions The Point array
  *
  * @throws \Kdyby\Extension\GeoJson\InvalidArgumentException
  */
 public function __construct(array $positions)
 {
     if (count($positions) <= 1) {
         throw new InvalidArgumentException('LineString have to have at least two points.');
     }
     parent::__construct($positions);
 }
示例#2
0
 /**
  * The first linestring is the outer ring
  * The subsequent ones are holes
  * All lineStrings should be linearRings
  *
  * @param array $lineStrings The LineString array
  *
  * @throws \Kdyby\Extension\GeoJson\InvalidArgumentException
  */
 public function __construct(array $lineStrings)
 {
     if (count($lineStrings) < 1) {
         throw new InvalidArgumentException("Polygon have to have at least one line string.");
         // todo: the GeoJSON spec (http://geojson.org/geojson-spec.html) says nothing about linestring count.
     }
     parent::__construct($lineStrings);
 }
示例#3
0
 /**
  * Constructor
  *
  * @param array $points The Point array
  */
 public function __construct(array $points)
 {
     parent::__construct($points);
 }