15 #ifndef GEOS_IO_GEOJSON_H 16 #define GEOS_IO_GEOJSON_H 18 #include <geos/export.h> 26 #include <geos/geom/Geometry.h> 30 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 42 class GEOS_DLL GeoJSONValue {
46 enum class Type { NUMBER, STRING, NULLTYPE, BOOLEAN, OBJECT, ARRAY };
55 std::map<std::string, GeoJSONValue> o;
56 std::vector<GeoJSONValue> a;
63 struct GeoJSONTypeError {};
66 GeoJSONValue(
const std::string&);
69 GeoJSONValue(
const std::map<std::string, GeoJSONValue>&);
70 GeoJSONValue(
const std::vector<GeoJSONValue>&);
73 GeoJSONValue(
const GeoJSONValue&);
74 GeoJSONValue& operator=(
const GeoJSONValue&);
76 double getNumber()
const;
77 const std::string& getString()
const;
78 std::nullptr_t getNull()
const;
79 bool getBoolean()
const;
80 const std::map<std::string, GeoJSONValue>& getObject()
const;
81 const std::vector<GeoJSONValue>& getArray()
const;
83 bool isNumber()
const;
84 bool isString()
const;
86 bool isBoolean()
const;
87 bool isObject()
const;
92 class GEOS_DLL GeoJSONFeature {
96 GeoJSONFeature(std::unique_ptr<geom::Geometry> g,
97 const std::map<std::string, GeoJSONValue>& p);
99 GeoJSONFeature(std::unique_ptr<geom::Geometry> g,
100 std::map<std::string, GeoJSONValue>&& p);
102 GeoJSONFeature(GeoJSONFeature
const& other);
104 GeoJSONFeature(GeoJSONFeature&& other);
106 GeoJSONFeature& operator=(
const GeoJSONFeature&);
108 GeoJSONFeature& operator=(GeoJSONFeature&&);
110 const geom::Geometry* getGeometry()
const;
112 const std::map<std::string, GeoJSONValue>& getProperties()
const;
116 std::unique_ptr<geom::Geometry> geometry;
118 std::map<std::string, GeoJSONValue> properties;
122 class GEOS_DLL GeoJSONFeatureCollection {
126 GeoJSONFeatureCollection(
const std::vector<GeoJSONFeature>& f);
128 GeoJSONFeatureCollection(std::vector<GeoJSONFeature>&& f);
130 const std::vector<GeoJSONFeature>& getFeatures()
const;
134 std::vector<GeoJSONFeature> features;
145 #endif // #ifndef GEOS_IO_GEOJSON_H Basic namespace for all GEOS functionalities.
Definition: Angle.h:26