# HG changeset patch # User Tom Gottfried # Date 1580736138 -3600 # Node ID 7878a1cde0247008e44f62784a6bf252ddba2e60 # Parent e89c1140f0a83c1d99da4107ac22aa1d6caf232a# Parent 566e9ee70d458737cc86136fb8b4c9ee9368286e Merge diff -r e89c1140f0a8 -r 7878a1cde024 docker/Dockerfile.db --- a/docker/Dockerfile.db Mon Feb 03 14:00:26 2020 +0100 +++ b/docker/Dockerfile.db Mon Feb 03 14:22:18 2020 +0100 @@ -34,10 +34,10 @@ # Expose the PostgreSQL port EXPOSE 5432 -# Create GEMMA role and database +# Create GEMMA roles and database WORKDIR /opt/gemma -COPY schema/*.sql schema/*.sh ./ -COPY schema/demo-data ./demo-data/ +COPY --chown=postgres schema/*.sql schema/*.sh ./ +COPY --chown=postgres schema/demo-data ./demo-data/ RUN $PGBIN/pg_ctl start -wo "--config_file=$PGCONF" && \ ./install-db.sh --demo --metapw "geo2Serv" && \ $PGBIN/pg_ctl stop -m smart diff -r e89c1140f0a8 -r 7878a1cde024 pkg/imports/bn.go --- a/pkg/imports/bn.go Mon Feb 03 14:00:26 2020 +0100 +++ b/pkg/imports/bn.go Mon Feb 03 14:22:18 2020 +0100 @@ -492,6 +492,7 @@ // Additional Information, only of interest when we change something, so // it can be used for debugging if something goes wrong... feedback.Info("Range: from %s to %s", bn.From_ISRS, bn.To_ISRS) + feedback.Info("Reference gauge: %s", bn.Fk_g_fid) // Check if the new bottleneck intersects with the validity of existing // for the same bottleneck_id we consider this an update and mark the diff -r e89c1140f0a8 -r 7878a1cde024 pkg/imports/wa.go --- a/pkg/imports/wa.go Mon Feb 03 14:00:26 2020 +0100 +++ b/pkg/imports/wa.go Mon Feb 03 14:22:18 2020 +0100 @@ -137,7 +137,7 @@ return nil, fmt.Errorf("unknown feature type '%s'", wa.FeatureType) } - feedback.Info("Found feature type '%s", wa.FeatureType) + feedback.Info("Found feature type '%s'", wa.FeatureType) epsg, err := wfs.CRSToEPSG(ft.DefaultCRS) if err != nil { diff -r e89c1140f0a8 -r 7878a1cde024 pkg/imports/wp.go --- a/pkg/imports/wp.go Mon Feb 03 14:00:26 2020 +0100 +++ b/pkg/imports/wp.go Mon Feb 03 14:22:18 2020 +0100 @@ -219,7 +219,7 @@ return fmt.Errorf("unknown feature type '%s'", wp.FeatureType) } - feedback.Info("Found feature type '%s", wp.FeatureType) + feedback.Info("Found feature type '%s'", wp.FeatureType) epsg, err := wfs.CRSToEPSG(ft.DefaultCRS) if err != nil { diff -r e89c1140f0a8 -r 7878a1cde024 pkg/imports/wx.go --- a/pkg/imports/wx.go Mon Feb 03 14:00:26 2020 +0100 +++ b/pkg/imports/wx.go Mon Feb 03 14:22:18 2020 +0100 @@ -138,7 +138,7 @@ return nil, fmt.Errorf("unknown feature type '%s'", wx.FeatureType) } - feedback.Info("Found feature type '%s", wx.FeatureType) + feedback.Info("Found feature type '%s'", wx.FeatureType) epsg, err := wfs.CRSToEPSG(ft.DefaultCRS) if err != nil { diff -r e89c1140f0a8 -r 7878a1cde024 pkg/wfs/download.go --- a/pkg/wfs/download.go Mon Feb 03 14:00:26 2020 +0100 +++ b/pkg/wfs/download.go Mon Feb 03 14:22:18 2020 +0100 @@ -181,7 +181,8 @@ // Only use first namespace ns := feature.Namespaces[0] if wfs2 { - v.Set("NAMESPACES", fmt.Sprintf("(%s,%s)", ns.Space, ns.Local)) + v.Set( + "NAMESPACES", fmt.Sprintf("xmlns(%s,%s)", ns.Space, ns.Local)) } else { v.Set("NAMESPACE", fmt.Sprintf("(%s:%s)", ns.Space, ns.Local)) } diff -r e89c1140f0a8 -r 7878a1cde024 schema/gemma.sql --- a/schema/gemma.sql Mon Feb 03 14:00:26 2020 +0100 +++ b/schema/gemma.sql Mon Feb 03 14:22:18 2020 +0100 @@ -27,7 +27,6 @@ -- -- Check if a given string can be used as a FROM item in an SQL statement --- All objects in stmt should be schema qualified if not in the public schema CREATE OR REPLACE FUNCTION is_valid_from_item(stmt text) RETURNS boolean AS $$ BEGIN @@ -39,7 +38,6 @@ RETURN false; END $$ - SET search_path TO 'public' LANGUAGE plpgsql STRICT; @@ -231,7 +229,7 @@ LANGUAGE plpgsql AS $$ BEGIN - IF NOT public.ST_Intersects((SELECT area + IF NOT st_intersects((SELECT area FROM waterway.bottlenecks WHERE bottleneck_id = NEW.bottleneck_id AND validity @> NEW.date_info::timestamptz),