|
NGen
|
Classes | |
| class | GeoPackageReader |
| Reads feature collections out of the layers of a single GeoPackage. More... | |
| 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, const std::string &geom_col, geojson::PropertyMap properties) |
| Build a feature from a GPKG table row. | |
| GeoPackageReader | make_reader (const std::string &gpkg_path) |
Open gpkg_path for generic reading. | |
| static void | check_table_name (const std::string &table) |
| Reject table names that are unsafe to interpolate into a query. | |
| 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, | ||
| const std::string & | geom_col, | ||
| geojson::PropertyMap | properties ) |
Build a feature from a GPKG table row.
Schema-agnostic: reads only the geometry from row and wraps the given id and properties in the appropriate geojson::*Feature subclass. The id is taken from id alone – nothing here reads it back out of properties – so resolving which column an id came from, and publishing any derived property, is the caller's business, before or after. properties must not contain the geometry column.
| [in] | row | SQLite iterator at the row to build a feature from |
| [in] | id | Resolved feature id; stored on the returned Feature |
| [in] | geom_col | Name of geometry column containing GPKG WKB |
| [in] | properties | Pre-built property map for the feature |
References build_geometry(), geojson::GeometryCollection, geojson::LineString, geojson::MultiLineString, geojson::MultiPoint, geojson::MultiPolygon, geojson::Point, and geojson::Polygon.
Referenced by ngen::geopackage::GeoPackageReader::read().
| 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 ngen::geopackage::GeoPackageReader::read().
|
static |
Reject table names that are unsafe to interpolate into a query.
Layer names reach the query text directly (SQLite cannot bind an identifier), so anything but a plain table name is refused up front.
| [in] | table | Table name to validate |
| std::runtime_error | if the name is a SQLite internal table or contains characters outside the allowed set |
Referenced by ngen::geopackage::GeoPackageReader::read().
| GeoPackageReader ngen::geopackage::make_reader | ( | const std::string & | gpkg_path | ) |
Open gpkg_path for generic reading.
| [in] | gpkg_path | Path to the GeoPackage file to read |
| ngen::sqlite::sqlite_error | if the file cannot be opened |
Referenced by ngen::hydrofabric::anonymous_namespace{HydrofabricReaderFactory.cpp}::identify().
| void ngen::geopackage::throw_if_not_type | ( | uint32_t | given, |
| wkb_geom_t | expected ) |