Diskussion:EOSMDBOne
Aus Geoinformation HSR
Inhaltsverzeichnis
ToDos
Siehe auch Diskussion:PostGIS-Terminal.
- Nightly-Update-Skript wieder aktivieren.
- Attribut osm_version beim Import in Tabelle osm_poi hinzufügen.
- Werte von osm_version in Tabellen osm_all und osm_poi kontrollieren (bei osm_all sind alle leer).
- Tabelle osm_roads => löschen/streichen aus default-style?
- Ev. doch Indexe auf osm_all und osm_poi zu erstellen versuchen.
- Dokumentation (vgl. unten) kontrollieren und ggf. ergänzen.
Feature Requests
tbd.
Documentation
Allgemeines
- Nightly Update: Einrichten eines Cron-Jobs, der einmal pro Nacht die Schweiz neu einspielt. -- realisiert
Security Features
Siehe auch die Security Features auf Diskussion:PostGIS_Terminal.
GRANTS: Rechte entziehen, damit User Tables und Views nicht erzeugen oder löschen können!
Schema nicht PUBLIC? Test: create table customer (id serial, name text); drop table customer; !!! Konfigurieren PostgreSQL Server (postgresql.conf parameters): Disabling autovacuum daemon, fsync=off etc.
Data Features
- Ev. Zusätzliche Views, Tabellen und Indexes anlegen.
- Prüfen was schneller ist: DROP osm_node und all das CREATE... oder TRUNCATE TABLE osm_node und INSERT...
- Associative Array: hstore (-h Parameter bei osm2pgsql) -- realisiert
Zusätzliche Tables, Views und Indexes:
---------- -- osm_all CREATE OR REPLACE VIEW osm_all_v (id, name, tags, gtype, osm_version, way) AS SELECT osm_id, name, tags, 'pt', osm_version, way FROM osm_point UNION SELECT osm_id, name, tags, 'ln', osm_version, way FROM osm_line UNION SELECT osm_id, name, tags, 'po', osm_version, way FROM osm_polygon CREATE OR REPLACE TABLE osm_all AS (SELECT * FROM osm_all_v); CREATE INDEX osm_all_name_idx ON osm_all(name) WITH (FILLFACTOR=100); CREATE INDEX osm_all_tags_idx ON osm_point USING gist(tags) WITH (FILLFACTOR=100); -- Kann "FEHLER: invalid hstore value found" ergeben! -- CLUSTER osm_poi USING ; --? ---------- -- osm_poi CREATE OR REPLACE VIEW osm_poi_v (id, name, tags, gtype, osm_version, way) AS SELECT osm_id, name, tags, 'pt', osm_version, way FROM osm_point UNION SELECT osm_id, name, tags, 'po', osm_version, ST_Centroid(way) FROM osm_polygon CREATE OR REPLACE TABLE osm_poi AS (SELECT * FROM osm_poi_v); CREATE INDEX osm_poi_name_idx ON osm_poi(name) WITH (FILLFACTOR=100); CREATE INDEX osm_poi_tags_idx ON osm_poi USING gist(tags) WITH (FILLFACTOR=100); -- Kann "FEHLER: invalid hstore value found" ergeben! -- CLUSTER osm_poi USING ; --?
---------------- -- Cleanup DB... VACUUM FREEZE ANALYZE; -- das kann dauern...
Funktion, die möglichst effizient schaut, ob Daten in der einer Tabelle sind (z.B. als Basis für einen RESTful-Aufruf eines externen Monitors):
CREATE OR REPLACE FUNCTION osm_point_not_empty() RETURNS boolean AS ' SELECT EXISTS (SELECT osm_id FROM osm_point LIMIT 1 OFFSET 100000); ' LANGUAGE SQL; -- Undo: DROP FUNCTION osm_point_not_empty(); -- Test: SELECT osm_point_not_empty();