Deleting Layers from DMIS - PIN-Cambodia/DMIS GitHub Wiki
A layer can be overwritten using QGIS / GeoServer, so it is not necessary to delete a layer from the PostGIS Database unless it truly needs to be removed. The following commands will help achieve this.
- Connect to PostGIS DMIS Database, ideally using pgAdmin.
- Perform the below select, and identify the
layer_id
for the layer you wish to remove.
SELECT layer_id, layer_name, map_category, layer_source, layer_type, layer_style, layer_geometry_type
FROM dmis.dmis_layers
You need to perform two delete operations, in the correct order as to not throw a foreign key error.
-
1
DELETE FROM dmis.dmis_layer_info WHERE layer_id = <IDHERE>
-
2
DELETE FROM dmis.dmis_layer WHERE layer_id = <IDHERE>
Log in to GeoServer and select the layer, and the delete command. Be careful, there is no undo. Go to the Styles page and remove any styles associated with that layer also.
-- End --