[postgis-users] How to extract common linestring of polyon and linestring

Stephen Woodbridge woodbri at swoodbridge.com
Wed Mar 11 10:08:24 PDT 2009

akrherz at iastate.edu wrote:
> Greetings,
> Firstly, PostGIS continues to rock!  Thanks so much for this software...
> My question is that I have a rivers linestring table and a political 
> boundaries table (US counties) polygon.  I am wishing to extract the 
> portion of the river geometry that lies along a county border.  Of 
> course, these two layers don't have the same individual point precision, 
> so I suspect some buffering, simplification is necessary.  I am not 
> seeking anything exact, but something like if the river and a county 
> border are within a few hundred meters of each other for some distance 
> along the river and county border.
> I can't seem to figure out which functions could accomplish this task, 
> or if it is possible. Currently, I have no issue finding points of 
> intersection, so perhaps that is part of the solution that is staring me 
> in the face :)

You might try something like:

How about buffering the country polygon by your tolerance and then get 
the results of the buffered country and the river.


More information about the postgis-users mailing list