|
SFCGAL
2.3.0
|
Main Input/output namespace. More...
Namespaces | |
| OBJ | |
| OBJ file format tools. | |
| STL | |
| VKT | |
| VKT file format tools. | |
| VTK | |
Classes | |
| class | BinarySerializer |
| Binary serialization wrapper for SFCGAL geometries. More... | |
| class | BinaryUnserializer |
| Binary deserialization wrapper for SFCGAL geometries. More... | |
| struct | GeoJSONOptions |
| Options for GeoJSON serialization. More... | |
Functions | |
| auto | writeBinaryGeometry (const SFCGAL::Geometry &geom) -> std::string |
| Convert a Geometry to its binary representation. More... | |
| auto | writeBinaryPrepared (const SFCGAL::PreparedGeometry &preparedGeom) -> std::string |
| Convert a PreparedGeometry to its binary representation. More... | |
| auto | readBinaryGeometry (const std::string &str) -> std::unique_ptr< SFCGAL::Geometry > |
| Read a Geometry from a binary representation. More... | |
| auto | readBinaryPrepared (const std::string &str) -> std::unique_ptr< SFCGAL::PreparedGeometry > |
| Read a PreparedGeometry from a binary representation. More... | |
| auto | readEwkt (std::istream &s) -> std::unique_ptr< PreparedGeometry > |
| Read a EWKT prepared geometry from an input stream. More... | |
| auto | readEwkt (const std::string &s) -> std::unique_ptr< PreparedGeometry > |
| Read a EWKT geometry from a string. More... | |
| auto | readEwkt (const char *str, size_t len) -> std::unique_ptr< PreparedGeometry > |
| Read a EWKT geometry from a char array. More... | |
| auto | readGeoJSON (const std::string &json) -> std::unique_ptr< Geometry > |
| Read a Geometry from a GeoJSON string. More... | |
| auto | readGeoJSON (const char *str, size_t len) -> std::unique_ptr< Geometry > |
| Read a Geometry from a GeoJSON char array. More... | |
| auto | readGeoJSON (const nlohmann::json &json) -> std::unique_ptr< Geometry > |
| Read a Geometry from a parsed JSON object. More... | |
| auto | readGeoJSONPrepared (const std::string &json) -> std::unique_ptr< PreparedGeometry > |
| Read a PreparedGeometry (Geometry + SRID) from GeoJSON. More... | |
| auto | readGeoJSONPrepared (const char *str, size_t len) -> std::unique_ptr< PreparedGeometry > |
| Read a PreparedGeometry (Geometry + SRID) from a GeoJSON char array. More... | |
| auto | readGeoJSONPrepared (const nlohmann::json &json) -> std::unique_ptr< PreparedGeometry > |
| Read a PreparedGeometry from a parsed JSON object. More... | |
| auto | writeGeoJSON (const Geometry &geometry, const GeoJSONOptions &options={}) -> std::string |
| Write a Geometry to GeoJSON string. More... | |
| auto | writeGeoJSONObject (const Geometry &geometry, const GeoJSONOptions &options={}) -> nlohmann::json |
| Write a Geometry to a JSON object. More... | |
| auto | writeGeoJSON (const PreparedGeometry &prepared, const GeoJSONOptions &options={}) -> std::string |
| Write a PreparedGeometry to GeoJSON string. More... | |
| auto | isNativeGeoJSONType (GeometryType geomType) -> bool |
| Check if a geometry type is natively supported by GeoJSON (RFC 7946). More... | |
| auto | geoJSONTypeName (const Geometry &geometry, bool strict=true) -> std::string |
| Get the GeoJSON type name for a geometry. More... | |
| SFCGAL_API osg::Geometry * | toOsgGeometry (const Geometry &g) |
| [helper] converts a SFCGAL::Geometry to an OSG geometry More... | |
| auto | readWkb (std::istream &stream, bool asHexString=false) -> std::unique_ptr< Geometry > |
| Read a WKB geometry from an input stream. More... | |
| auto | readWkb (const std::string &s, bool asHexString=false) -> std::unique_ptr< Geometry > |
| Read a WKB geometry from a string. More... | |
| auto | readWkb (const char *str, size_t len, bool asHexString=false) -> std::unique_ptr< Geometry > |
| Read a WKB geometry from a char array. More... | |
| auto | readEwkb (std::istream &stream, bool asHexString) -> std::unique_ptr< PreparedGeometry > |
| Read a WKB geometry from an input stream. More... | |
| auto | readEwkb (const std::string &s, bool asHexString=false) -> std::unique_ptr< PreparedGeometry > |
| Read a EWKB geometry from a string. More... | |
| auto | readEwkb (const char *str, size_t len, bool asHexString) -> std::unique_ptr< PreparedGeometry > |
| Read a WKB geometry from a char*. More... | |
| auto | readWkt (std::istream &s) -> std::unique_ptr< Geometry > |
| Read a WKT geometry from an input stream. More... | |
| auto | readWkt (const std::string &s) -> std::unique_ptr< Geometry > |
| Read a WKT geometry from a string. More... | |
| auto | readWkt (const char *str, size_t len) -> std::unique_ptr< Geometry > |
| Read a WKT geometry from a char array. More... | |
Main Input/output namespace.
| SFCGAL_API auto SFCGAL::io::geoJSONTypeName | ( | const Geometry & | geometry, |
| bool | strict = true |
||
| ) | -> std::string |
Get the GeoJSON type name for a geometry.
In strict mode, returns the RFC 7946 equivalent type. In extension mode, returns the SFCGAL type name.
| geometry | Geometry |
| strict | Use strict RFC 7946 types |
| SFCGAL_API auto SFCGAL::io::isNativeGeoJSONType | ( | GeometryType | geomType | ) | -> bool |
Check if a geometry type is natively supported by GeoJSON (RFC 7946).
| geomType | Geometry type ID |
| SFCGAL_API auto SFCGAL::io::readBinaryGeometry | ( | const std::string & | str | ) | -> std::unique_ptr< SFCGAL::Geometry > |
Read a Geometry from a binary representation.
| str | binary representation |
| SFCGAL_API auto SFCGAL::io::readBinaryPrepared | ( | const std::string & | str | ) | -> std::unique_ptr< SFCGAL::PreparedGeometry > |
Read a PreparedGeometry from a binary representation.
| str | binary representation |
| SFCGAL_API auto SFCGAL::io::readEwkb | ( | std::istream & | stream, |
| bool | asHexString = false |
||
| ) | -> std::unique_ptr< PreparedGeometry > |
Read a WKB geometry from an input stream.
Read a EWKB geometry from an input stream.
| stream | The input stream to read from |
| asHexString | Whether the EWKB data is encoded as hex string |
| SFCGAL_API auto SFCGAL::io::readEwkb | ( | const std::string & | s, |
| bool | asHexString = false |
||
| ) | -> std::unique_ptr< PreparedGeometry > |
Read a EWKB geometry from a string.
| s | The string containing EWKB data |
| asHexString | Whether the EWKB data is encoded as hex string |
| SFCGAL_API auto SFCGAL::io::readEwkb | ( | const char * | str, |
| size_t | len, | ||
| bool | asHexString = false |
||
| ) | -> std::unique_ptr< PreparedGeometry > |
Read a WKB geometry from a char*.
Read a EWKB geometry from a char array.
| str | The character array containing EWKB data |
| len | The length of the character array |
| asHexString | Whether the EWKB data is encoded as hex string |
| SFCGAL_API auto SFCGAL::io::readEwkt | ( | std::istream & | s | ) | -> std::unique_ptr< PreparedGeometry > |
Read a EWKT prepared geometry from an input stream.
| s | The input stream to read from |
| SFCGAL_API auto SFCGAL::io::readEwkt | ( | const std::string & | s | ) | -> std::unique_ptr< PreparedGeometry > |
Read a EWKT geometry from a string.
| s | The string containing EWKT data |
| SFCGAL_API auto SFCGAL::io::readEwkt | ( | const char * | str, |
| size_t | len | ||
| ) | -> std::unique_ptr< PreparedGeometry > |
Read a EWKT geometry from a char array.
| str | The character array containing EWKT data |
| len | The length of the character array |
| SFCGAL_API auto SFCGAL::io::readGeoJSON | ( | const std::string & | json | ) | -> std::unique_ptr< Geometry > |
Read a Geometry from a GeoJSON string.
Supports Geometry, Feature, and FeatureCollection. For Feature/FeatureCollection, only the geometry part is extracted.
| json | GeoJSON string |
| std::runtime_error | on parse error |
| SFCGAL_API auto SFCGAL::io::readGeoJSON | ( | const char * | str, |
| size_t | len | ||
| ) | -> std::unique_ptr< Geometry > |
Read a Geometry from a GeoJSON char array.
Supports Geometry, Feature, and FeatureCollection. For Feature/FeatureCollection, only the geometry part is extracted.
| str | The GeoJSON character array |
| len | The length of the character array |
| std::runtime_error | on parse error |
| SFCGAL_API auto SFCGAL::io::readGeoJSON | ( | const nlohmann::json & | json | ) | -> std::unique_ptr< Geometry > |
Read a Geometry from a parsed JSON object.
| json | nlohmann::json object |
| std::runtime_error | on invalid geometry |
| SFCGAL_API auto SFCGAL::io::readGeoJSONPrepared | ( | const std::string & | json | ) | -> std::unique_ptr< PreparedGeometry > |
Read a PreparedGeometry (Geometry + SRID) from GeoJSON.
If CRS is specified in GeoJSON, extracts the EPSG code as SRID.
| json | GeoJSON string |
| SFCGAL_API auto SFCGAL::io::readGeoJSONPrepared | ( | const char * | str, |
| size_t | len | ||
| ) | -> std::unique_ptr< PreparedGeometry > |
Read a PreparedGeometry (Geometry + SRID) from a GeoJSON char array.
If CRS is specified in GeoJSON, extracts the EPSG code as SRID.
| str | The GeoJSON character array |
| len | The length of the character array |
| SFCGAL_API auto SFCGAL::io::readGeoJSONPrepared | ( | const nlohmann::json & | json | ) | -> std::unique_ptr< PreparedGeometry > |
Read a PreparedGeometry from a parsed JSON object.
| json | nlohmann::json object |
| SFCGAL_API auto SFCGAL::io::readWkb | ( | std::istream & | stream, |
| bool | asHexString = false |
||
| ) | -> std::unique_ptr< Geometry > |
Read a WKB geometry from an input stream.
| stream | The input stream to read from |
| asHexString | Whether the WKB data is encoded as hex string |
| SFCGAL_API auto SFCGAL::io::readWkb | ( | const std::string & | s, |
| bool | asHexString = false |
||
| ) | -> std::unique_ptr< Geometry > |
Read a WKB geometry from a string.
| s | The string containing WKB data |
| asHexString | Whether the WKB data is encoded as hex string |
| SFCGAL_API auto SFCGAL::io::readWkb | ( | const char * | str, |
| size_t | len, | ||
| bool | asHexString = false |
||
| ) | -> std::unique_ptr< Geometry > |
Read a WKB geometry from a char array.
| str | The character array containing WKB data |
| len | The length of the character array |
| asHexString | Whether the WKB data is encoded as hex string |
| SFCGAL_API auto SFCGAL::io::readWkt | ( | std::istream & | s | ) | -> std::unique_ptr< Geometry > |
Read a WKT geometry from an input stream.
| s | The input stream to read from |
| SFCGAL_API auto SFCGAL::io::readWkt | ( | const std::string & | s | ) | -> std::unique_ptr< Geometry > |
Read a WKT geometry from a string.
| s | The string containing WKT data |
| SFCGAL_API auto SFCGAL::io::readWkt | ( | const char * | str, |
| size_t | len | ||
| ) | -> std::unique_ptr< Geometry > |
Read a WKT geometry from a char array.
| str | The character array containing WKT data |
| len | The length of the character array |
| SFCGAL_API osg::Geometry* SFCGAL::io::toOsgGeometry | ( | const Geometry & | g | ) |
[helper] converts a SFCGAL::Geometry to an OSG geometry
| g | The SFCGAL geometry to convert |
| SFCGAL_API auto SFCGAL::io::writeBinaryGeometry | ( | const SFCGAL::Geometry & | geom | ) | -> std::string |
Convert a Geometry to its binary representation.
| geom | Geometry to convert |
| SFCGAL_API auto SFCGAL::io::writeBinaryPrepared | ( | const SFCGAL::PreparedGeometry & | preparedGeom | ) | -> std::string |
Convert a PreparedGeometry to its binary representation.
| preparedGeom | PreparedGeometry to convert |
| SFCGAL_API auto SFCGAL::io::writeGeoJSON | ( | const Geometry & | geometry, |
| const GeoJSONOptions & | options = {} |
||
| ) | -> std::string |
Write a Geometry to GeoJSON string.
| geometry | Geometry to serialize |
| options | Serialization options |
| SFCGAL_API auto SFCGAL::io::writeGeoJSON | ( | const PreparedGeometry & | prepared, |
| const GeoJSONOptions & | options = {} |
||
| ) | -> std::string |
Write a PreparedGeometry to GeoJSON string.
If SRID is non-zero, includes a CRS member (non-standard but useful).
| prepared | PreparedGeometry to serialize |
| options | Serialization options |
| SFCGAL_API auto SFCGAL::io::writeGeoJSONObject | ( | const Geometry & | geometry, |
| const GeoJSONOptions & | options = {} |
||
| ) | -> nlohmann::json |
Write a Geometry to a JSON object.
| geometry | Geometry to serialize |
| options | Serialization options |
1.8.10