NGen
|
Classes | |
struct | wkb |
A recursive WKB reader. More... | |
Enumerations | |
enum | wkb_geom_t { geometry = 0 , point = 1 , linestring = 2 , polygon = 3 , multipoint = 4 , multilinestring = 5 , multipolygon = 6 , geometry_collection = 7 } |
Functions | |
geojson::geometry | build_geometry (const ngen::sqlite::database::iterator &row, const std::string &geom_col, std::vector< double > &bounding_box) |
Build a geometry object from GeoPackage WKB. | |
geojson::PropertyMap | build_properties (const ngen::sqlite::database::iterator &row, const std::string &geom_col) |
Build properties from GeoPackage table columns. | |
geojson::Feature | build_feature (const ngen::sqlite::database::iterator &row, const std::string &id_col, const std::string &geom_col) |
Build a feature from a GPKG table row. | |
std::shared_ptr< geojson::FeatureCollection > | read (const std::string &gpkg_path, const std::string &layer, const std::vector< std::string > &ids) |
Build a feature collection from a GPKG layer. | |
void | throw_if_not_type (uint32_t given, wkb_geom_t expected) |
geojson::Feature ngen::geopackage::build_feature | ( | const ngen::sqlite::database::iterator & | row, |
const std::string & | id_col, | ||
const std::string & | geom_col ) |
Build a feature from a GPKG table row.
[in] | row | SQLite iterator at the row to build a feature from |
[in] | geom_col | Name of geometry column containing GPKG WKB |
References build_geometry(), build_properties(), geojson::GeometryCollection, ngen::sqlite::database::iterator::get(), geojson::LineString, geojson::MultiLineString, geojson::MultiPoint, geojson::MultiPolygon, geojson::Point, and geojson::Polygon.
geojson::geometry ngen::geopackage::build_geometry | ( | const ngen::sqlite::database::iterator & | row, |
const std::string & | geom_col, | ||
std::vector< double > & | bounding_box ) |
Build a geometry object from GeoPackage WKB.
[in] | row | SQLite iterator at the row containing a geometry column |
[in] | geom_col | Name of geometry column containing GPKG WKB |
[out] | bounding_box | Bounding box of the geometry to output |
References utils::copy_from(), ngen::sqlite::database::iterator::get(), ngen::srs::epsg::get(), and ngen::srs::epsg::wgs84.
Referenced by build_feature().
geojson::PropertyMap ngen::geopackage::build_properties | ( | const ngen::sqlite::database::iterator & | row, |
const std::string & | geom_col ) |
Build properties from GeoPackage table columns.
[in] | row | SQLite iterator at the row containing the data columns |
[in] | geom_col | Name of geometry column containing GPKG WKB to ignore |
References ngen::sqlite::database::iterator::columns(), and ngen::sqlite::database::iterator::types().
Referenced by build_feature().
std::shared_ptr< geojson::FeatureCollection > ngen::geopackage::read | ( | const std::string & | gpkg_path, |
const std::string & | layer = "", | ||
const std::vector< std::string > & | ids = {} ) |
Build a feature collection from a GPKG layer.
[in] | gpkg_path | Path to GPKG file |
[in] | layer | Layer name within GPKG file to create a collection from |
[in] | ids | optional subset of feature IDs to capture (if empty, the entire layer is converted) |
void ngen::geopackage::throw_if_not_type | ( | uint32_t | given, |
wkb_geom_t | expected ) |