1
|
|
|
<?php |
2
|
|
|
namespace geoPHP\Geometry; |
3
|
|
|
|
4
|
|
|
use geoPHP\geoPHP; |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* A Surface is a 2-dimensional abstract geometric object. |
8
|
|
|
* |
9
|
|
|
* OGC 06-103r4 6.1.10 specification: |
10
|
|
|
* A simple Surface may consists of a single “patch” that is associated with one “exterior boundary” and 0 or more |
11
|
|
|
* “interior” boundaries. A single such Surface patch in 3-dimensional space is isometric to planar Surfaces, by a |
12
|
|
|
* simple affine rotation matrix that rotates the patch onto the plane z = 0. If the patch is not vertical, the |
13
|
|
|
* projection onto the same plane is an isomorphism, and can be represented as a linear transformation, i.e. an affine. |
14
|
|
|
* |
15
|
|
|
* @package GeoPHPGeometry |
16
|
|
|
*/ |
17
|
|
|
abstract class Surface extends Collection |
18
|
|
|
{ |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @param Curve[] $components |
22
|
|
|
* @param bool $allowEmptyComponents |
23
|
|
|
* @param string $allowedComponentType |
24
|
|
|
*/ |
25
|
|
|
public function __construct( |
26
|
|
|
array $components = [], |
27
|
|
|
bool $allowEmptyComponents = true, |
28
|
|
|
string $allowedComponentType = Curve::class |
29
|
|
|
) { |
30
|
|
|
parent::__construct($components, $allowEmptyComponents, $allowedComponentType); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @return string "Surface" |
35
|
|
|
*/ |
36
|
|
|
public function geometryType(): string |
37
|
|
|
{ |
38
|
|
|
return Geometry::SURFACE; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @return int 2 |
43
|
|
|
*/ |
44
|
|
|
public function dimension(): int |
45
|
|
|
{ |
46
|
|
|
return 2; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function isClosed(): bool |
50
|
|
|
{ |
51
|
|
|
return true; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function length3D(): float |
55
|
|
|
{ |
56
|
|
|
return 0.0; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function haversineLength(): float |
60
|
|
|
{ |
61
|
|
|
return 0.0; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function greatCircleLength($radius = geoPHP::EARTH_WGS84_SEMI_MAJOR_AXIS): float |
65
|
|
|
{ |
66
|
|
|
return 0.0; |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|