views:

32

answers:

1

I have a typical database with millions of polygons as land parcels and i want to split these polygons onto lines and then remove the lines that overlap eachother. These lines will be used purely for rendering in mapnik/and or geoserver as at the moment every parcel boundary gets rendered twice.

i propose to split the parcel polygons into a new table ("boundary_lines") and then search and remove overlapping lines. how would i go about removing these overlapping lines in postgis?

A: 

Use ST_Equals:
http://postgis.refractions.net/docs/ST_Equals.html

Your SQL statement will probably look something like this:

SELECT y.id, z.id 
FROM mytable y, mytable z
WHERE ST_Equals(y.the_geom,z.the_geom)

The query will take forever to run, but hopefully you only have to do it once. After running it, take the results and carefully delete duplicate id's.

Note that this won't get rid of boundaries that don't overlap exactly.

Summer