[Qgis-user] Conversion - multipolygon to multilinestring

Piotr Kania p.kania at op.pl
Wed Sep 23 02:20:01 PDT 2015


Hi!

I'm completely newbie as it comes to postgis, so forgive me:) - I sent 
that question also to postgis mailing list, but here people are faster 
in response.

I try to convert my multipolygon layer to multilinestring - here: 
http://postgis.refractions.net/docs/ST_ExteriorRing.html
I found example:
"(...)--If you have a table of MULTIPOLYGONs
--and want to return a MULTILINESTRING composed of the exterior rings of 
each polygon
SELECT gid, ST_Collect(ST_ExteriorRing(the_geom)) AS erings
     FROM (SELECT gid, (ST_Dump(the_geom)).geom As the_geom
             FROM sometable) As foo
GROUP BY gid;
(...)"

My postgresql connection calls -"database", schema-"public", default 
primary key field - "gid", default geometry field  -"geom", my 
multipolygon layer- "poly_layer". How will look sql code above, with my 
data- if I'd like to convert "poly_layer" into new multilinestring layer 
"line_layer"?

Thanks for response

Regarding

Piotr Kania




More information about the Qgis-user mailing list