You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: backends/postgres_osmosis.sql
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
CREATE OR REPLACE TEMP VIEW node AS
2
-
SELECT id, version, tstamp AS created, tags, NULL::bigint[] AS nodes, NULL::jsonb AS members, geom, 'n'AS osm_type FROM nodes;
2
+
SELECT id, version, tstamp::timestamp with time zoneAS created, tags, NULL::bigint[] AS nodes, NULL::jsonb AS members, geom, 'n'AS osm_type FROM nodes;
3
3
4
4
CREATE OR REPLACE TEMP VIEW way AS
5
-
SELECT id, version, tstamp AS created, tags, nodes, NULL::jsonb AS members, linestring AS geom, 'w'AS osm_type FROM ways;
5
+
SELECT id, version, tstamp::timestamp with time zoneAS created, tags, nodes, NULL::jsonb AS members, linestring AS geom, 'w'AS osm_type FROM ways;
6
6
7
7
CREATE OR REPLACE TEMP VIEW relation AS
8
8
SELECT
9
9
id,
10
10
version,
11
-
tstamp AS created,
11
+
tstamp::timestamp with time zoneAS created,
12
12
tags,
13
13
NULL::bigint[] AS nodes,
14
14
jsonb_agg(jsonb_build_object(
@@ -35,3 +35,9 @@ SELECT * FROM way
35
35
UNION ALL
36
36
SELECT*FROM relation
37
37
;
38
+
39
+
CREATE OR REPLACE TEMP VIEW area AS
40
+
SELECT id, NULL::integerAS version, NULL::timestamp with time zoneAS created, tags, NULL::bigint[] AS nodes, NULL::jsonb AS members, poly AS geom, 'a'AS osm_type FROM multipolygons WHERE id >3600000000
41
+
UNION ALL
42
+
SELECT id, version, tstamp::timestamp with time zoneAS created, tags, nodes AS nodes, NULL::jsonb AS members, ST_MakePolygon(linestring)::geometry(Geometry,4326) AS geom, 'w'AS osm_type FROM ways WHERE id <3600000000AND ST_IsClosed(linestring) AND ST_Dimension(ST_MakePolygon(linestring)) =2
0 commit comments