[geos-devel] truncated buffer result

Stephen Woodbridge woodbri at swoodbridge.com
Thu Mar 9 08:51:27 EST 2006


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




More information about the geos-devel mailing list