-
Notifications
You must be signed in to change notification settings - Fork 1
/
Extractor.php
97 lines (84 loc) · 3.1 KB
/
Extractor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
declare(strict_types=1);
namespace GeoIO;
interface Extractor
{
/**
* Determines whether the given geometry is supported by this Extractor.
*/
public function supports(mixed $geometry): bool;
/**
* Extracts the type of the given geometry.
*/
public function extractType(mixed $geometry): GeometryType;
/**
* Extracts the dimension of the given geometry.
*/
public function extractDimension(mixed $geometry): Dimension;
/**
* Extracts the SRID of the given geometry.
*
* Must return `null` if the geometry has no SRID assigned.
*/
public function extractSrid(mixed $geometry): ?int;
/**
* Extracts the Coordinates of the given Point.
*
* Must return `null` if the Point is empty.
*/
public function extractCoordinatesFromPoint(mixed $point): ?Coordinates;
/**
* Extracts the Points of the given LineString.
*
* The iterable must yield Point representations which are accepted by the
* extractCoordinatesFromPoint() method of this Extractor.
*
* Must return an empty iterable if the LineString is empty.
*/
public function extractPointsFromLineString(mixed $lineString): iterable;
/**
* Extracts the LineStrings of the given Polygon.
*
* The iterable must yield LineString representations which are accepted
* by the extractPointsFromLineString() method of this Extractor.
*
* Must return an empty iterable if the Polygon is empty.
*/
public function extractLineStringsFromPolygon(mixed $polygon): iterable;
/**
* Extracts the Points of the given MultiPoint.
*
* The iterable must return Point representations which are accepted by the
* extractCoordinatesFromPoint() method of this Extractor.
*
* Must return an empty iterable if the MultiPoint is empty.
*/
public function extractPointsFromMultiPoint(mixed $multiPoint): iterable;
/**
* Extracts the LineStrings of the given MultiLineString.
*
* The iterable must yield LineString representations which are accepted
* by the extractPointsFromLineString() method of this Extractor.
*
* Must return an empty iterable if the MultiLineString is empty.
*/
public function extractLineStringsFromMultiLineString(mixed $multiLineString): iterable;
/**
* Extracts the Polygons of the given MultiPolygon.
*
* The iterable must yield Polygon representations which are accepted
* by the extractLineStringsFromPolygon() method of this Extractor.
*
* Must return an empty iterable if the MultiPolygon is empty.
*/
public function extractPolygonsFromMultiPolygon(mixed $multiPolygon): iterable;
/**
* Extracts the geometries of the given GeometryCollection.
*
* The iterable must yield geometry representations which are accepted
* by any of the extract*() methods of this Extractor.
*
* Must return an empty iterable if the GeometryCollection is empty.
*/
public function extractGeometriesFromGeometryCollection(mixed $geometryCollection): iterable;
}