geoWithinPolygon() public method

Point coordinates are in x, y order (easting, northing for projected coordinates, longitude, latitude for geographic coordinates). The last point coordinate is implicitly connected with the first. Note: the $polygon operator only supports legacy coordinate pairs and 2d indexes. This cannot be used with 2dsphere indexes and GeoJSON shapes.
See also: Builder::geoWithinPolygon()
See also: http://docs.mongodb.org/manual/reference/operator/polygon/
public geoWithinPolygon ( )
コード例 #1
0
ファイル: ExprTest.php プロジェクト: im286er/ent
 /**
  * @expectedException InvalidArgumentException
  */
 public function testGeoWithinPolygonRequiresAtLeastThreePoints()
 {
     $expr = new Expr();
     $expr->geoWithinPolygon(array(0, 0), array(1, 1));
 }
コード例 #2
0
ファイル: Match.php プロジェクト: doctrine/mongodb
 /**
  * Add $geoWithin criteria with a $polygon shape to the query.
  *
  * Point coordinates are in x, y order (easting, northing for projected
  * coordinates, longitude, latitude for geographic coordinates).
  *
  * The last point coordinate is implicitly connected with the first.
  *
  * Note: the $polygon operator only supports legacy coordinate pairs and 2d
  * indexes. This cannot be used with 2dsphere indexes and GeoJSON shapes.
  *
  * @see Expr::geoWithinPolygon()
  * @see http://docs.mongodb.org/manual/reference/operator/polygon/
  * @param array $point,... Three or more point coordinate tuples
  * @return $this
  */
 public function geoWithinPolygon()
 {
     $this->query->geoWithinPolygon(...func_get_args());
     return $this;
 }
コード例 #3
0
ファイル: ExprTest.php プロジェクト: alcaeus/mongodb
 /**
  * @expectedException InvalidArgumentException
  */
 public function testGeoWithinPolygonRequiresAtLeastThreePoints()
 {
     $expr = new Expr();
     $expr->geoWithinPolygon([0, 0], [1, 1]);
 }