You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.0 KiB
49 lines
1.0 KiB
<?php |
|
|
|
declare(strict_types=1); |
|
|
|
namespace Brick\Geo; |
|
|
|
use Brick\Geo\Attribute\NoProxy; |
|
use Brick\Geo\Projector\Projector; |
|
|
|
/** |
|
* A MultiLineString is a MultiCurve whose elements are LineStrings. |
|
* |
|
* @extends MultiCurve<LineString> |
|
*/ |
|
class MultiLineString extends MultiCurve |
|
{ |
|
#[NoProxy] |
|
public function geometryType() : string |
|
{ |
|
return 'MultiLineString'; |
|
} |
|
|
|
#[NoProxy] |
|
public function geometryTypeBinary() : int |
|
{ |
|
return Geometry::MULTILINESTRING; |
|
} |
|
|
|
public function dimension() : int |
|
{ |
|
return 1; |
|
} |
|
|
|
protected function containedGeometryType() : string |
|
{ |
|
return LineString::class; |
|
} |
|
|
|
public function project(Projector $projector): MultiLineString |
|
{ |
|
return new MultiLineString( |
|
$projector->getTargetCoordinateSystem($this->coordinateSystem), |
|
...array_map( |
|
fn (LineString $lineString) => $lineString->project($projector), |
|
$this->geometries, |
|
), |
|
); |
|
} |
|
}
|
|
|