17#include <geos/export.h>
22#include "geos/vend/include_nlohmann_json.hpp"
26#pragma warning(disable: 4251)
33class CoordinateSequence;
35class GeometryCollection;
54enum 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);
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:44
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:52
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Definition: LineString.h:66
Models a collection of LineStrings.
Definition: MultiLineString.h:50
Definition: MultiPoint.h:51
Definition: MultiPolygon.h:59
Represents a linear polygon, which may include holes.
Definition: Polygon.h:61
Outputs the GeoJSON representation of a Geometry. See also GeoJSONReader for parsing.
Definition: GeoJSONWriter.h:65
Basic namespace for all GEOS functionalities.
Definition: geos.h:39