1 | #pragma once |
2 | |
3 | #include <mapbox/geometry.hpp> |
4 | #include <mapbox/variant.hpp> |
5 | |
6 | namespace mapbox { |
7 | namespace geojson { |
8 | |
9 | using value = mapbox::geometry::value; |
10 | using null_value_t = mapbox::geometry::null_value_t; |
11 | using identifier = mapbox::geometry::identifier; |
12 | using point = mapbox::geometry::point<double>; |
13 | using multi_point = mapbox::geometry::multi_point<double>; |
14 | using line_string = mapbox::geometry::line_string<double>; |
15 | using linear_ring = mapbox::geometry::linear_ring<double>; |
16 | using multi_line_string = mapbox::geometry::multi_line_string<double>; |
17 | using polygon = mapbox::geometry::polygon<double>; |
18 | using multi_polygon = mapbox::geometry::multi_polygon<double>; |
19 | using geometry = mapbox::geometry::geometry<double>; |
20 | using geometry_collection = mapbox::geometry::geometry_collection<double>; |
21 | using feature = mapbox::geometry::feature<double>; |
22 | using feature_collection = mapbox::geometry::feature_collection<double>; |
23 | |
24 | // Parse inputs of known types. Instantiations are provided for geometry, feature, and |
25 | // feature_collection. |
26 | template <class T> |
27 | T parse(const std::string &); |
28 | |
29 | // Parse any GeoJSON type. |
30 | using geojson = mapbox::util::variant<geometry, feature, feature_collection>; |
31 | geojson parse(const std::string &); |
32 | |
33 | // Stringify inputs of known types. Instantiations are provided for geometry, feature, and |
34 | // feature_collection. |
35 | template <class T> |
36 | std::string stringify(const T &); |
37 | |
38 | // Stringify any GeoJSON type. |
39 | std::string stringify(const geojson &); |
40 | |
41 | } // namespace geojson |
42 | } // namespace mapbox |
43 | |