1 | <?php |
||
34 | class LatLongParser extends StringValueParser { |
||
35 | |||
36 | const TYPE_FLOAT = 'float'; |
||
37 | const TYPE_DMS = 'dms'; |
||
38 | const TYPE_DM = 'dm'; |
||
39 | const TYPE_DD = 'dd'; |
||
40 | |||
41 | /** |
||
42 | * The symbols representing the different directions for usage in directional notation. |
||
43 | * @since 0.1 |
||
44 | */ |
||
45 | const OPT_NORTH_SYMBOL = 'north'; |
||
46 | const OPT_EAST_SYMBOL = 'east'; |
||
47 | const OPT_SOUTH_SYMBOL = 'south'; |
||
48 | const OPT_WEST_SYMBOL = 'west'; |
||
49 | |||
50 | /** |
||
51 | * The symbols representing degrees, minutes and seconds. |
||
52 | * @since 0.1 |
||
53 | */ |
||
54 | const OPT_DEGREE_SYMBOL = 'degree'; |
||
55 | const OPT_MINUTE_SYMBOL = 'minute'; |
||
56 | const OPT_SECOND_SYMBOL = 'second'; |
||
57 | |||
58 | /** |
||
59 | * The symbol to use as separator between latitude and longitude. |
||
60 | * @since 0.1 |
||
61 | */ |
||
62 | const OPT_SEPARATOR_SYMBOL = 'separator'; |
||
63 | |||
64 | /** |
||
65 | * @see StringValueParser::stringParse |
||
66 | * |
||
67 | * @since 0.1 |
||
68 | * |
||
69 | * @param string $value |
||
70 | * |
||
71 | * @return LatLongValue |
||
72 | * @throws ParseException |
||
73 | */ |
||
74 | protected function stringParse( $value ) { |
||
85 | |||
86 | /** |
||
87 | * @return StringValueParser[] |
||
88 | */ |
||
89 | protected function getParsers() { |
||
99 | |||
100 | /** |
||
101 | * Convenience function for determining if something is a valid coordinate string. |
||
102 | * Analogous to creating an instance of the parser, parsing the string and checking isValid on the result. |
||
103 | * |
||
104 | * @since 0.1 |
||
105 | * |
||
106 | * @param string $string |
||
107 | * |
||
108 | * @return boolean |
||
109 | */ |
||
110 | public static function areCoordinates( $string ) { |
||
119 | |||
120 | } |
||
121 |