From 8f89a3044ef5becfea9ee2d3087a4edbabb73a29 Mon Sep 17 00:00:00 2001 From: Jakob Miksch Date: Wed, 25 Dec 2024 16:24:09 +0100 Subject: [PATCH] Output long version of osm_type --- data/query_function.sql | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/data/query_function.sql b/data/query_function.sql index 10b4819..e78b596 100644 --- a/data/query_function.sql +++ b/data/query_function.sql @@ -3,7 +3,12 @@ CREATE SCHEMA IF NOT EXISTS postgisftw; CREATE OR REPLACE VIEW view_objects AS SELECT - g.osm_type, + CASE + WHEN g.osm_type = 'N' then 'node' + WHEN g.osm_type = 'W' then 'way' + WHEN g.osm_type = 'R' then 'relation' + ELSE NULL + END as osm_type, g.osm_id, CASE WHEN g.osm_type = 'N' then n.tags @@ -33,7 +38,7 @@ OR REPLACE FUNCTION postgisftw.osm_website_objects_around ( max_lat float, max_lon float ) RETURNS TABLE ( - osm_type char, + osm_type text, osm_id bigint, tags jsonb, geom geometry @@ -64,7 +69,7 @@ OR REPLACE FUNCTION postgisftw.osm_website_objects_enclosing ( max_lat float, max_lon float ) RETURNS TABLE ( - osm_type char, + osm_type text, osm_id bigint, tags jsonb, geom geometry @@ -96,7 +101,7 @@ OR REPLACE FUNCTION postgisftw.osm_website_combi ( max_lat float, max_lon float ) RETURNS TABLE ( - osm_type char, + osm_type text, osm_id bigint, query_type text, tags jsonb,