[postgis-users] Buffer on linestring

Eric FRANCOIS ericfrancois at hotmail.com
Fri Jan 5 02:23:28 PST 2007


Hello,

I 've strange results with using buffer on linestring.

When I tried to extract streets segments contains in the buffer, I've these
results:

select  * FROM streets_db_edges_big_3    where
the_geom && buffer(setsrid(makeline('POINT(-1.68445 48.10753)','POINT(4.8291
45.75936)'),4326),0.1,1)

126599 records


If I did the thame thing with a Box3D with 0.1 degree more around my
reference points:

select  * FROM streets_db_edges_big_3    where
setsrid('BOX3D(-1.78448 45.65923,4.92955 48.20667)'::BOX3D,4326)  &&
the_geom

127449 records

I don't understand why the difference between the 2 results is so short. The
first query should return something like a corridor with less result. The
area of selection  should be more restrict than for the BoxD.

If I look at the polygon extract with astext:

select  astext(buffer(setsrid(makeline('POINT(-1.68445
48.10753)','POINT(4.8291 45.75936)'),4326),0.1,1))

result:
"POLYGON((4.86301403403245 45.8534335791583,4.92317357915826
45.7254459659676,4.79518596596755 45.6652864208417,-1.71836403403245
48.0134564208417,-1.71836403403245 48.0134564208417,-1.77852357915826
48.1414440340324,-1.65053596596755 48.2016035791583,4.86301403403245
45.8534335791583))"


area =1.4

for the Box3D:
select astext(setsrid('BOX3D(-1.78448 45.65923,4.92955
48.20667)'::BOX3D,4326))

result:
"POLYGON((-1.78448 45.65923,-1.78448 48.20667,4.92955 48.20667,4.92955
45.65923,-1.78448 45.65923))"

area=17.1



On the image , the yellow flags are the Box3D and the reds for the buffer.
They are placed with each point of the polygons.


Thanks for help

ERIC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: box3D_buffer.png
Type: image/png
Size: 77320 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070105/1b4056b2/attachment.png>


More information about the postgis-users mailing list