1 | <?php |
||
24 | class GlobeCoordinateParser implements ValueParser { |
||
25 | |||
26 | const FORMAT_NAME = 'globe-coordinate'; |
||
27 | |||
28 | /** |
||
29 | * Option specifying the globe. Should be a string containing a Wikidata concept URI. Defaults |
||
30 | * to Earth. |
||
31 | */ |
||
32 | const OPT_GLOBE = 'globe'; |
||
33 | |||
34 | private $options; |
||
35 | |||
36 | 122 | public function __construct( ParserOptions $options = null ) { |
|
42 | |||
43 | /** |
||
44 | * @see StringValueParser::stringParse |
||
45 | * |
||
46 | * @param string $value |
||
47 | * |
||
48 | * @throws ParseException |
||
49 | * @return GlobeCoordinateValue |
||
50 | */ |
||
51 | 122 | public function parse( $value ) { |
|
75 | |||
76 | /** |
||
77 | * @param LatLongValue $latLong |
||
78 | * @param string $precisionDetector |
||
79 | * |
||
80 | * @return float|int |
||
81 | */ |
||
82 | 117 | private function detectPrecision( LatLongValue $latLong, $precisionDetector ) { |
|
92 | |||
93 | /** |
||
94 | * @return ValueParser[] |
||
95 | */ |
||
96 | 122 | private function getParsers() { |
|
106 | |||
107 | /** |
||
108 | * @param float $degree |
||
109 | * |
||
110 | * @return float|int |
||
111 | */ |
||
112 | 29 | private function detectDdPrecision( $degree ) { |
|
115 | |||
116 | /** |
||
117 | * @param float $degree |
||
118 | * |
||
119 | * @return float|int |
||
120 | */ |
||
121 | 25 | private function detectDmPrecision( $degree ) { |
|
131 | |||
132 | /** |
||
133 | * @param float $degree |
||
134 | * |
||
135 | * @return float|int |
||
136 | */ |
||
137 | 42 | private function detectDmsPrecision( $degree ) { |
|
147 | |||
148 | /** |
||
149 | * @param float $degree |
||
150 | * |
||
151 | * @return float|int |
||
152 | */ |
||
153 | 62 | private function detectFloatPrecision( $degree ) { |
|
162 | |||
163 | } |
||
164 |