Last active
November 23, 2019 20:02
-
-
Save pigreco/a4f60db10373013bc9738e4f6b835619 to your computer and use it in GitHub Desktop.
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
-- Creo tabella | |
CREATE TABLE "tmp_lineMerge" AS | |
SELECT ROW_NUMBER() OVER(ORDER BY pk) AS RowNum, | |
ST_LineMerge(ST_Union(geom)) AS geom, | |
tipo, | |
count(*) as nro, | |
group_concat (pk) as pk_old -- occhio!!! | |
FROM "linee" | |
GROUP BY tipo | |
order by 3; | |
-- Ricovero la geometria | |
SELECT RecoverGeometryColumn('tmp_lineMerge','geom',3004,'Linestring','XY'); | |
-- Dump geometria | |
SELECT ElementaryGeometries( 'tmp_lineMerge' , | |
'geom' , 'lines_merge_tipo' ,'out_pk' , 'out_multi_id', 1 ) as num, 'lines' as label; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment