15 #ifndef GEOS_IO_GEOJSONWRITER_H
16 #define GEOS_IO_GEOJSONWRITER_H
18 #include <geos/export.h>
23 #include "geos/vend/include_nlohmann_json.hpp"
27 #pragma warning(disable: 4251)
34 class CoordinateSequence;
36 class GeometryCollection;
42 class MultiLineString;
55 enum class GeoJSONType {
56 GEOMETRY, FEATURE, FEATURE_COLLECTION
70 std::string write(
const geom::Geometry* geometry, GeoJSONType type = GeoJSONType::GEOMETRY);
72 std::string writeFormatted(
const geom::Geometry* geometry, GeoJSONType type = GeoJSONType::GEOMETRY,
int indent = 4);
74 std::string write(
const GeoJSONFeature& feature);
76 std::string write(
const GeoJSONFeatureCollection& features);
84 void encode(
const geom::Geometry* g, GeoJSONType type, geos_nlohmann::ordered_json& j);
86 void encodeGeometry(
const geom::Geometry* g, geos_nlohmann::ordered_json& j);
88 void encodePoint(
const geom::Point* p, geos_nlohmann::ordered_json& j);
90 void encodeLineString(
const geom::LineString* l, geos_nlohmann::ordered_json& j);
92 void encodePolygon(
const geom::Polygon* p, geos_nlohmann::ordered_json& j);
94 void encodeMultiPoint(
const geom::MultiPoint* p, geos_nlohmann::ordered_json& j);
102 void encodeFeature(
const geom::Geometry* g, geos_nlohmann::ordered_json& j);
104 void encodeFeatureCollection(
const geom::Geometry* g, geos_nlohmann::ordered_json& j);
106 void encodeFeature(
const GeoJSONFeature& feature, geos_nlohmann::ordered_json& j);
108 void encodeGeoJSONValue(
const std::string& key,
const GeoJSONValue& value, geos_nlohmann::ordered_json& j);
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:55
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Definition: LineString.h:68
Models a collection of LineStrings.
Definition: MultiLineString.h:51
Definition: MultiPoint.h:54
Definition: MultiPolygon.h:59
Represents a linear polygon, which may include holes.
Definition: Polygon.h:64
Outputs the GeoJSON representation of a Geometry. See also GeoJSONReader for parsing.
Definition: GeoJSONWriter.h:66
Basic namespace for all GEOS functionalities.
Definition: Angle.h:26