OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
GeoPackageSchema.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2//
3// Copyright 2026 Caleb Buahin
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
26
27#ifndef OPENSWMM_GEOPACKAGE_SCHEMA_HPP
28#define OPENSWMM_GEOPACKAGE_SCHEMA_HPP
29
30#include <sqlite3.h>
31#include <string>
32
33namespace openswmm::gpkg {
34
56void create_schema(sqlite3* db);
57
68void register_crs(sqlite3* db, int srs_id, const std::string& org,
69 int org_id, const std::string& srs_name, const std::string& wkt);
70
82void register_feature_table(sqlite3* db, const std::string& table_name,
83 const std::string& geom_type, int srs_id,
84 const std::string& identifier, const std::string& description,
85 double min_x, double min_y, double max_x, double max_y);
86
91void populate_default_variables(sqlite3* db);
92
93} // namespace openswmm::gpkg
94
95#endif // OPENSWMM_GEOPACKAGE_SCHEMA_HPP
Definition ExternalContentReader.cpp:49
void create_schema(sqlite3 *db)
Create all GeoPackage metadata tables and OpenSWMM application tables.
Definition GeoPackageSchema.cpp:1370
void register_feature_table(sqlite3 *db, const std::string &table_name, const std::string &geom_type, int srs_id, const std::string &identifier, const std::string &description, double min_x, double min_y, double max_x, double max_y)
Register a feature table in gpkg_contents and gpkg_geometry_columns.
Definition GeoPackageSchema.cpp:1401
void populate_default_variables(sqlite3 *db)
Pre-populate the variables catalog with known SWMM output variables.
Definition GeoPackageSchema.cpp:1431
void register_crs(sqlite3 *db, int srs_id, const std::string &org, int org_id, const std::string &srs_name, const std::string &wkt)
Register a CRS in gpkg_spatial_ref_sys (if not already present).
Definition GeoPackageSchema.cpp:1387