Created
January 5, 2018 13:25
-
-
Save gannebamm/0a5f9bd9da8c522ed6ee685c94600a59 to your computer and use it in GitHub Desktop.
ST_MakeLine with creating a 3DIM enabled table works for 3d features
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE samplelines | |
( | |
id serial, | |
name character varying(50) COLLATE pg_catalog."default", | |
CONSTRAINT samplelines_pkey PRIMARY KEY (id) | |
) | |
-- add 3dims enabled geometry column | |
SELECT AddGeometryColumn('public', 'samplelines', 'geom', 25832, 'LINESTRING', 3); | |
-- pick the samplepoints and create lines | |
INSERT INTO samplelines (name, geom) | |
SELECT | |
's1' AS name, | |
ST_MAKELINE( | |
(SELECT geom | |
FROM samplepoints_xyz | |
WHERE name = 'al_01'), | |
(SELECT geom | |
FROM samplepoints_xyz | |
WHERE name = 'sound_01')) AS geom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment