17 #include <geos/export.h>
22 #include "geos/vend/include_nlohmann_json.hpp"
26 #pragma warning(disable: 4251)
33 class CoordinateSequence;
35 class GeometryCollection;
41 class MultiLineString;
54 enum class GeoJSONType {
55 GEOMETRY, FEATURE, FEATURE_COLLECTION
69 std::string write(
const geom::Geometry* geometry, GeoJSONType type = GeoJSONType::GEOMETRY);
71 std::string writeFormatted(
const geom::Geometry* geometry, GeoJSONType type = GeoJSONType::GEOMETRY,
int indent = 4);
73 std::string write(
const GeoJSONFeature& feature);
75 std::string write(
const GeoJSONFeatureCollection& features);
79 std::pair<double, double> convertCoordinate(
const geom::CoordinateXY* c);
83 void encode(
const geom::Geometry* g, GeoJSONType type, geos_nlohmann::ordered_json& j);
85 void encodeGeometry(
const geom::Geometry* g, geos_nlohmann::ordered_json& j);
87 void encodePoint(
const geom::Point* p, geos_nlohmann::ordered_json& j);
89 void encodeLineString(
const geom::LineString* l, geos_nlohmann::ordered_json& j);
91 void encodePolygon(
const geom::Polygon* p, geos_nlohmann::ordered_json& j);
93 void encodeMultiPoint(
const geom::MultiPoint* p, geos_nlohmann::ordered_json& j);
101 void encodeFeature(
const geom::Geometry* g, geos_nlohmann::ordered_json& j);
103 void encodeFeatureCollection(
const geom::Geometry* g, geos_nlohmann::ordered_json& j);
105 void encodeFeature(
const GeoJSONFeature& feature, geos_nlohmann::ordered_json& j);
107 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:56
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:51
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Definition: LineString.h:65
Models a collection of LineStrings.
Definition: MultiLineString.h:49
Definition: MultiPoint.h:50
Definition: MultiPolygon.h:58
Represents a linear polygon, which may include holes.
Definition: Polygon.h:60
Outputs the GeoJSON representation of a Geometry. See also GeoJSONReader for parsing.
Definition: GeoJSONWriter.h:65
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25