[postgis-users] segmented road data to svg

Christo Du Preez christo at mecola.com
Thu Aug 4 03:09:40 PDT 2005


Hi,

I have road data imported using shp2pgsql. The database table is made up 
of 'MULTILINESTRING's.

Unfortunately the data is very segmented, making live very difficult 
trying to Simplify the data and using the intersection function and also 
results in a big svg result.

I've tried to use collect, GeomUnion and also polygonize_garray but I 
cant get it right. What is the best procedure to build my roads up from 
all the segments parts so I can run a query similar to the example on 
the resulting data/table:

SELECT province AS name, 
AsSVG(intersection(Simplify(the_geom,0.016),GeometryFromText('POLYGON((17 
-35,25 -35,25 -29,17 -29,17 -35))',-1)),0,6) AS svg_geom
FROM province
WHERE the_geom && setSRID('BOX3D(17 -35, 25 -29)'::box3d,-1) ORDER BY 
province ASC

Thanx in advance.



More information about the postgis-users mailing list