[geos-devel] truncated buffer result

Martin Davis mbdavis at VividSolutions.com
Thu Mar 9 17:38:42 EST 2006


The odd buffer result is because the input polygon is invalid
(self-intersection at (663194.0947744681, 1796327.0446638297) - see
attached image).

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046


> -----Original Message-----
> From: geos-devel-bounces at geos.refractions.net 
> [mailto:geos-devel-bounces at geos.refractions.net] On Behalf Of 
> Pierre GIRAUD
> Sent: March 9, 2006 6:39 AM
> To: GEOS Development List
> Subject: Re: [geos-devel] truncated buffer result
> 
> 
> Sorry there was a typo :
> 
> SELECT  astext(buffer(geometryfromtext('POLYGON((663194 
> 1796327,663281 1796368,663226 1796300,663194 1796327.1,663194 
> 1796327))'), 50));
> 
> The error was the first point didn't match the first one : 
> missing "1" ( 796327 -> 1796327).
> 
> I also just tested in an upgraded postgis : POSTGIS="1.1.1" 
> GEOS="2.2.1" PROJ="Rel. 4.4.9, 29 Oct 2004" USE_STATS
> 
> Here is the response :
> 
> POLYGON((663193.969722321 1796327.06424776,663172.685114959 
> 1796372.22914631,663259.685114959 
> 1796413.22914631,663268.718916272 
> 1796416.46828842,663278.205160608 
> 1796417.92182762,663287.794368624 
> 1796417.53621458,663297.133267731 
> 1796415.32565554,663305.877806879 
> 1796411.37158891,663313.705831622 
> 1796405.81968506,663320.328952494 
> 1796398.87447968,663325.503169464 
> 1796390.79183862,663329.037861049 
> 1796381.86953156,663330.802806939 
> 1796372.43626205,663330.732985393 
> 1796362.83955778,663328.830968681 
> 1796353.43296753,663325.166828321 
> 1796344.56303612,663319.875553601 
> 1796336.55653753,663264.875553601 
> 1796268.55653753,663257.885682593 
> 1796261.48632391,663249.635099941 
> 1796255.93888278,663240.4500212 
> 1796252.13355155,663230.693610484 
> 1796250.22078726,663220.751621512 
> 1796250.27621773,663211.017145485 
> 1796252.29765131,663201.875068854 
> 1796256.20516358,663193.686855497 
> 1796261.84425741,663161.686855497 1796288.94425741,663193.969722321
> 1796327.06424776))
> 
> I'll fill a bug.
> 
> On 3/9/06, Stephen Woodbridge <woodbri at swoodbridge.com> wrote:
> > I just tried this on "POSTGIS="1.1.1" GEOS="2.2.1-CAPI-1.0.1" 
> > USE_STATS"
> >
> > and got "ERROR:  geometry contains non-closed rings"
> >
> > SELECT
> > astext(buffer(geometryfromtext('POLYGON((663194 796327,663281 
> > 1796368,663226 1796300,663194 1796327.1,663194 1796327))'), 50));
> >                                                 ^^^^^^^
> >
> > Notice the Y value of the last point has an extra leading "1", if I 
> > remove that I get:
> >
> > POLYGON((663144 796327,663144 1796327.1,663144.894659621 
> > 1796336.51623843,663147.54662185 1796345.59550374,663151.860982546 
> > 1796354.01288182,663157.683346337 1796361.46714516,663164.805351871 
> > 1796367.69153262,663172.972128319 1796372.46329587,663181.891416275 
> > 1796375.61167076,663191.244026668 1796377.02398833,663200.695263383 
> > 1796376.64970684,663209.906900826 1796374.50222048,663218.549287795 
> > 1796370.65838001,663218.736835661 1796370.52787101,663242.124446399 
> > 1796399.44346247,663248.737676265 1796406.19872337,663256.504198503 
> > 1796411.58848138,663265.146380576 1796415.42006697,663274.355287429 
> > 1796417.55651112,663283.801725107 1796417.92144165,663293.148008554 
> > 1796416.50181325,663302.060032965 1796413.34837386,663310.219217141 
> > 1796408.57385057,663317.333891921 1796402.34891989,663323.14972658 
> > 1796394.89610658,663327.45882048 1796386.4818289,663330.10713496 
> > 1796377.40687494,663330.999999811 1796367.99565018,663243.999999811 
> > 796326.995650178,663243.038468287 796317.241484331,663240.192519963 
> > 796307.862312066,663235.571516999 796299.218549815,663229.353032144 
> > 796291.642354176,663221.776025092 796285.424858027,663213.131659899 
> > 796280.804983066,663203.752116332 796277.960258697,663193.997825094 
> > 796277.000000047,663184.243617431 796277.96110728,663174.86432138 
> > 796280.806647624,663166.220358132 796285.427274594,663158.643892007 
> > 796291.645429891,663152.426066276 796299.222166486,663147.805815305 
> > 796307.866330715,663144.960682944 796317.245750531,663144 
> > 796326.999999991,663144 796327))
> >
> > Sorry no, pretty graphic, but the start and end points do match and 
> > they appear to be 50 units west of the start of the orginal 
> polyline.
> >
> > Hope this helps,
> >    -Steve
> >
> >
> >
> > Pierre GIRAUD wrote:
> > > Hello,
> > >
> > > I probably found a tiny issue in the buffer computation 
> on a POYGON 
> > > shape.
> > >
> > > Using Mapserver geos implementation, I fell on a curious 
> behaviour 
> > > of the buffer compuation (see attached image). To 
> reproduce the bug, 
> > > I tried a similar request in PostGIS, and obtained the 
> same result. 
> > > So I suppose this is a GEOS library issue.
> > >
> > > psql -d database -c "SELECT 
> > > astext(buffer(geometryfromtext('POLYGON((663194 796327,663281 
> > > 1796368,663226 1796300,663194 1796327.1,663194 1796327))'), 50));"
> > >
> > > Do I have to fill in a bug ?
> > >
> > > Regards
> > >
> > > Pierre GIRAUD
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > ----
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > ----
> > >
> > > _______________________________________________
> > > geos-devel mailing list
> > > geos-devel at geos.refractions.net 
> > > http://geos.refractions.net/mailman/listinfo/geos-devel
> >
> > _______________________________________________
> > geos-devel mailing list
> > geos-devel at geos.refractions.net 
> > http://geos.refractions.net/mailman/listinfo/geos-devel
> >
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net 
> http://geos.refractions.net/mailman/listinfo/geos-devel
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: badBuffer.png
Type: image/png
Size: 17262 bytes
Desc: badBuffer.png
Url : http://lists.osgeo.org/pipermail/geos-devel/attachments/20060309/196432dd/badBuffer.png


More information about the geos-devel mailing list