[Mapbender-commits] r9688 - trunk/mapbender/resources/db/pgsql/UTF-8/update
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Feb 17 03:25:28 PST 2017
Author: armin11
Date: 2017-02-17 03:25:28 -0800 (Fri, 17 Feb 2017)
New Revision: 9688
Modified:
trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
Log:
Bugfix for searching wfs_conf and WFS 2.0 stored queries
Modified: trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
===================================================================
--- trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql 2017-02-16 16:54:17 UTC (rev 9687)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql 2017-02-17 11:25:28 UTC (rev 9688)
@@ -1602,3 +1602,29 @@
ALTER TABLE wfs_featuretype ADD COLUMN featuretype_schema text;
ALTER TABLE wfs_featuretype ADD COLUMN featuretype_schema_problem boolean;
+
+-- solve multiple results for wfs_conf - fixing bug!
+-- View: search_wfs_view
+
+-- DROP VIEW search_wfs_view;
+
+CREATE OR REPLACE VIEW search_wfs_view AS
+ SELECT wfs_without_geom.wfs_id, wfs_without_geom.wfs_title, wfs_without_geom.wfs_abstract, wfs_without_geom.administrativearea, wfs_without_geom.country, wfs_without_geom.accessconstraints, wfs_without_geom.termsofuse, wfs_without_geom.isopen, wfs_without_geom.wfs_owner, wfs_without_geom.featuretype_id, wfs_without_geom.featuretype_srs, wfs_without_geom.featuretype_title, wfs_without_geom.featuretype_abstract, wfs_without_geom.searchtext, wfs_without_geom.element_type, wfs_without_geom.wfs_conf_id, wfs_without_geom.wfs_conf_abstract, wfs_without_geom.wfs_conf_description, wfs_without_geom.modultype, wfs_without_geom.wfs_timestamp, wfs_without_geom.department, wfs_without_geom.mb_group_name, wfs_without_geom.mb_group_logo_path, wfs_without_geom.wfs_network_access, wfs_without_geom.wfs_pricevolume, wfs_without_geom.wfs_proxylog, wfs_without_geom.featuretype_latlon_bbox, wfs_without_geom.featuretype_latlon_array, geometryfromtext(((((((((((((((((((('POLYGON(('::text || wfs_without_geo
m.featuretype_latlon_array[1]) || ' '::text) || wfs_without_geom.featuretype_latlon_array[2]) || ','::text) || wfs_without_geom.featuretype_latlon_array[1]) || ' '::text) || wfs_without_geom.featuretype_latlon_array[4]) || ','::text) || wfs_without_geom.featuretype_latlon_array[3]) || ' '::text) || wfs_without_geom.featuretype_latlon_array[4]) || ','::text) || wfs_without_geom.featuretype_latlon_array[3]) || ' '::text) || wfs_without_geom.featuretype_latlon_array[2]) || ','::text) || wfs_without_geom.featuretype_latlon_array[1]) || ' '::text) || wfs_without_geom.featuretype_latlon_array[2]) || '))'::text, 4326) AS the_geom, (((((wfs_without_geom.featuretype_latlon_array[1] || ','::text) || wfs_without_geom.featuretype_latlon_array[2]) || ','::text) || wfs_without_geom.featuretype_latlon_array[3]) || ','::text) || wfs_without_geom.featuretype_latlon_array[4] AS bbox
+ FROM ( SELECT DISTINCT wfs_featuretype.featuretype_id, wfs_dep.wfs_id, wfs_dep.wfs_title, wfs_dep.wfs_abstract, wfs_dep.administrativearea, wfs_dep.country, wfs_dep.accessconstraints, wfs_dep.termsofuse, wfs_dep.isopen, wfs_dep.wfs_owner, wfs_featuretype.featuretype_srs, wfs_featuretype.featuretype_title, wfs_featuretype.featuretype_abstract, f_collect_searchtext_wfs(wfs_dep.wfs_id, wfs_featuretype.featuretype_id) AS searchtext, wfs_element.element_type, wfs_conf.wfs_conf_id, wfs_conf.wfs_conf_abstract, wfs_conf.wfs_conf_description, f_getwfsmodultype(wfs_conf.wfs_conf_id) AS modultype, wfs_dep.wfs_timestamp, wfs_dep.department, wfs_dep.mb_group_name, wfs_dep.mb_group_logo_path, wfs_dep.wfs_network_access, wfs_dep.wfs_pricevolume, wfs_dep.wfs_proxylog, wfs_featuretype.featuretype_latlon_bbox,
+ CASE
+ WHEN wfs_featuretype.featuretype_latlon_bbox::text = ''::text THEN string_to_array('-180,-90,180,90'::text, ','::text)
+ WHEN wfs_featuretype.featuretype_latlon_bbox IS NULL THEN string_to_array('-180,-90,180,90'::text, ','::text)
+ ELSE string_to_array(wfs_featuretype.featuretype_latlon_bbox::text, ','::text)
+ END AS featuretype_latlon_array
+ FROM ( SELECT wfs.wfs_id, wfs.wfs_title, wfs.wfs_abstract, wfs.administrativearea, wfs.country, wfs.accessconstraints, f_getwfs_tou(wfs.wfs_id) AS termsofuse, f_tou_isopen(f_getwfs_tou(wfs.wfs_id)) AS isopen, wfs.wfs_timestamp, wfs.wfs_owner, wfs.wfs_proxylog, wfs.wfs_network_access, wfs.wfs_pricevolume, user_dep.mb_group_id AS department, user_dep.mb_group_name, user_dep.mb_group_logo_path
+ FROM ( SELECT registrating_groups.fkey_mb_user_id AS mb_user_id, mb_group.mb_group_id, mb_group.mb_group_name, mb_group.mb_group_logo_path
+ FROM registrating_groups, mb_group
+ WHERE registrating_groups.fkey_mb_group_id = mb_group.mb_group_id) user_dep, wfs
+ WHERE user_dep.mb_user_id = wfs.wfs_owner) wfs_dep, wfs_featuretype, wfs_element, wfs_conf
+ WHERE wfs_featuretype.fkey_wfs_id = wfs_dep.wfs_id AND wfs_featuretype.featuretype_searchable = 1 AND wfs_element.element_type::text ~~ '%Type'::text AND wfs_featuretype.featuretype_id = wfs_element.fkey_featuretype_id AND wfs_featuretype.featuretype_id = wfs_conf.fkey_featuretype_id
+ ORDER BY wfs_featuretype.featuretype_id) wfs_without_geom;
+
+ALTER TABLE search_wfs_view
+ OWNER TO postgres;
+
+
More information about the Mapbender_commits
mailing list