public function Geometry::union in geoPHP 7
Same name and namespace in other branches
- 8 geoPHP/lib/geometry/Geometry.class.php \Geometry::union()
File
- geoPHP/
lib/ geometry/ Geometry.class.php, line 222
Class
- Geometry
- Geometry abstract class
Code
public function union(Geometry $geometry) {
if ($this
->geos()) {
if (is_array($geometry)) {
$geom = $this
->geos();
foreach ($geometry as $item) {
$geom = $geom
->union($item
->geos());
}
return geoPHP::geosToGeometry($geom);
}
else {
return geoPHP::geosToGeometry($this
->geos()
->union($geometry
->geos()));
}
}
}