Skip to content

Commit

Permalink
Output long version of osm_type
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobMiksch authored Dec 25, 2024
1 parent 40356a3 commit 8f89a30
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions data/query_function.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8f89a30

Please sign in to comment.