[FOSSGIS-Talk] VIEW bzw. TABLE in geopackage
Claas Leiner
claas.leiner at gkg-kassel.de
Do Dez 10 11:12:56 CET 2020
Hallo Angelica,
die Tabellen müssen angemeldet werden:
In den gpkg_contents anmelden:
Gemeotrielose Tabelle:
insert into gpkg_contents (table_name, data_type, identifier, srs_id)
values ('tabellen_name', 'attributes', 'tabellennamen', 0)
;
---------------------------------------------
Mit Geometrie ist es aufwändiger:
insert into gpkg_contents (table_name, data_type, identifier, srs_id)
values ('tabellen_name', 'features', 'tabellen_name', 25832)
;
und:
insert into gpkg_geometry_columns (table_name, column_name,
geometry_type_name, srs_id, z, m)
values ('tabellen_name','geom','GEOMETRIETYP',25832,0,0)
;
GEOMETRIEIYP: z.B: MULTIPOLYGON
Und:
insert into gpkg_ogr_contents
(table_name, feature_count)
values('tabellen_name', (select count(fid) from tabellen_name))
;
SOWIE die 2 Triggerr:
:
CREATE TRIGGER "trigger_delete_feature_count_tabellen_name"
AFTER DELETE ON "tabellen_name"
BEGIN UPDATE gpkg_ogr_contents SET feature_count = feature_count - 1
WHERE lower(table_name) = lower('tabellen_name');
END
;
CREATE TRIGGER
"trigger_insert_feature_count_tabellen_name"
AFTER INSERT ON "tabellen_name" BEGIN UPDATE gpkg_ogr_contents SET
feature_count = feature_count + 1
WHERE lower(table_name) = lower('tabellen_name');
END
;
--
-----------------------------------------
GKG-Kassel - Dr.-Ing. Claas Leiner
QGIS-Support und mehr
Geodatenservice, Kartenwerkstatt &
GIS-Schule Kassel
Wilhelmshöher Allee 304 E
34131 Kassel
Tel. 0561/56013445
claas.leiner at gkg-kassel.de
----------------------------------------
http://www.gkg-kassel.de
----------------------------------------
Unterstützen Sie QGIS
QGIS-DE e.V. | http://qgis.de
QGIS Projekt | http://qgis.org/de/site/
Mehr Informationen über die Mailingliste FOSSGIS-Talk-Liste