[postgis-users] Buffer Performance

Martin Davis mbdavis at VividSolutions.com
Tue Mar 16 09:45:07 PST 2004


Alex:
 
>From your original post, it sounds like you are buffering fairly
"twisty" linestrings (e.g. rivers of Europe).  The way buffering works
is this (roughly):  The offset curve is computed as a series of offsets
from the line segments of the linestring together with rounded "fillets"
for the sharp corners.  If the linestring winds about a bit, the offset
curve starts self-intersecting (and the wider the buffer width, the more
self-intersections occur).  The complex part of buffering is handling
these self-intersections, by discarding the pieces of the offset curve
that lie inside the buffer.  This code runs more or less proportionally
to the number of self-intersections.  
 
It's more complex than that in reality, but basically the "windier" the
buffer the longer it will take to compute.
 
Martin
 
 
Martin Davis, Senior Technical Architect
Vivid Solutions Inc.
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046

	-----Original Message-----
	From: Alexander Pucher [mailto:pucher at atlas.gis.univie.ac.at] 
	Sent: March 16, 2004 5:17 AM
	To: PostGIS Users Discussion
	Subject: Re: [postgis-users] Buffer Performance
	
	
	Hi all,
	
	Martin, sounds clear to me, but what's the deal with the
intersection? >From my experience, when I buffer 50 line segments, I get
50 buffers (i.e 50 "rows"). So no intersection is made between the
several buffers, as far as I can see. Please correct me if I'm wrong.
	
	reagrds,
	alex.
	
	Martin Davis wrote: 

		The performance difference is probably due to the
difference in the buffer widths.  In general, larger buffer widths
require longer to compute than smaller ones.  This is due to the greater
interaction (intersections) between the offset curves computed to build
the buffer curve.
		 
		 
		Martin Davis, Senior Technical Architect
		Vivid Solutions Inc.
		Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
		Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046

			-----Original Message-----
			From: Alexander Pucher
[mailto:pucher at atlas.gis.univie.ac.at] 
			Sent: Friday, March 12, 2004 3:39 AM
			To: PostGIS Users Discussion
			Subject: [postgis-users] Buffer Performance
			
			
			Hi,
			
			did some buffer performance testing with a table
that holds about 2100 multilinestrings (river network of europe).
			
			'select buffer(the_geom,5) from river;'
			
			takes about 7 seconds to execute, whereas
			
			'select buffer(the_geom,15000) from river' 
			
			takes a couple of minutes...
			
			The 'river' table is not indexed, if this might
be of importance ?!?
			
			'explain select....' 
			
			shows similar output for both queries:
			
			QUERY PLAN
	
-----------------------------------------------------------
			 Seq Scan on river  (cost=0.00..139.51 rows=2051
width=32)
			(1 row)
			
			
			What's the reason for the difference in
execution time, depending on the buffer size?
			Is there a way to speed up execution time of
such queries??
			
			Best regards,
			alex.
			
			

		
  _____  


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20040316/3f71a428/attachment.html>


More information about the postgis-users mailing list