Use ST_buffer, as below:

create table mline (gid serial primary key, name varchar(10));
select addgeometrycolumn('','mline','geom',4326,'MULTILINE',2);
insert into mline (name,geom ) values 
('one',setsrid(geometryfromtext((174 -45,175 -44),(174 -44,175 -45)),4326));
insert into mline (name,geom ) values ('two',
setsrid(geomfromtext('MULTILINESTRING((176 -45,176 -44),(173 -44,173 
-45))'),4326));
update mline set buff=multi(buffer(geom,0.05));

The result is as in the attached image. It will generate the combined buffer of 
all the constituent lines in the multiline, NOT the individual buffer zones 
around each line. If you need all the constituent polygons for each line 
individually, you'll need to separate them out into separate line features 
instead of a multiline.

Note that buffering by a distance may require the buffer to be generated in a 
suitable projection - you can't do it in lat/long), so you may need to 
transform your multiline to this projection, generate the buffer, & transform 
it back again

ie: buff=transform(buffer(transform(mline,nnnn)),4326)

HTH,

  Brent Wood
--- On Sat, 6/4/11, Jaime Lop <jaime...@gmail.com> wrote:

From: Jaime Lop <jaime...@gmail.com>
Subject: [postgis-users] multiline with with to polygon
To: "PostGIS Users Discussion" <postgis-users@postgis.refractions.net>
Date: Saturday, June 4, 2011, 1:49 AM

Hello everyone,

Is there an easy way to convert multi lines with a width to polygons?

For example, I have a corridor defined as 100 kms around a given line.

Thanks,
Jaime


-----Inline Attachment Follows-----

_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

<<attachment: multi.png>>

_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to