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);
83 getOutputDimension()
const
85 return defaultOutputDimension;
96 void setOutputDimension(uint8_t newOutputDimension);
99 uint8_t defaultOutputDimension = 3;
105 void encode(
const geom::Geometry* g, GeoJSONType type, geos_nlohmann::ordered_json& j);
107 void encodeGeometry(
const geom::Geometry* g, geos_nlohmann::ordered_json& j);
109 void encodePoint(
const geom::Point* p, geos_nlohmann::ordered_json& j);
111 void encodeLineString(
const geom::LineString* l, geos_nlohmann::ordered_json& j);
113 void encodePolygon(
const geom::Polygon* p, geos_nlohmann::ordered_json& j);
115 void encodeMultiPoint(
const geom::MultiPoint* p, geos_nlohmann::ordered_json& j);
123 void encodeFeature(
const geom::Geometry* g, geos_nlohmann::ordered_json& j);
125 void encodeFeatureCollection(
const geom::Geometry* g, geos_nlohmann::ordered_json& j);
127 void encodeFeature(
const GeoJSONFeature& feature, geos_nlohmann::ordered_json& j);
129 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
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:217
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:51
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:197
Definition: LineString.h:66
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:61
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