SQL Server Developer Center >
SQL Server Forums
>
SQL Server Spatial
>
Problem of extra lines appearing when apply a buffer to a polygon with 2 points very close to each other
Problem of extra lines appearing when apply a buffer to a polygon with 2 points very close to each other
- Hello,When a apply a buffer (STBuffer or BufferWithTolerance) to a polygon which has 2 points very close to each other, there a thin extra line appearing in the resulting shape. Here is a simple example :
SELECT geography::Parse('POLYGON ((0.148179995191816 47.6541796714871, 0.147984451614527 47.6541745060093, 0.147964192853032 47.6541716952762, 0.147946096891203 47.6541648763069, 0.147931743821736 47.6541544837423, 0.147923079560787 47.6541417689002, 0.147920863563632 47.6541276908329, 0.147924624338343 47.654113995209, 0.147934722145717 47.6541016335643, 0.147950297425504 47.6540920743301, 0.147969315287163 47.6540862239523, 0.147989757526645 47.654084584297, 0.14818090965349 47.6540896671125, 0.148379543085387 47.6540780198092, 0.148792888566824 47.6540523274557, 0.148796486858373 47.6540522602022, 0.149078805922644 47.6540456955336, 0.149079210673302 47.6540455681842, 0.14941422307804 47.6540399941278, 0.149427379759305 47.6540406465296, 0.149672703597952 47.6540690151693, 0.149692490982198 47.6540735712802, 0.149709322879961 47.6540819857756, 0.149721231111283 47.6540935468119, 0.149727472854001 47.65410689077, 0.149726889420521 47.6541210511025, 0.149720351426794 47.6541342896428, 0.1497079033212 47.6541455275075, 0.149690787134495 47.6541537083386, 0.149671037731293 47.6541579256563, 0.149650274115975 47.6541576700538, 0.149411309184178 47.6541300958256, 0.149083093611218 47.654135527838, 0.14880317478795 47.6541420027277, 0.148391430946737 47.6541675903095, 0.148391031753409 47.6541675827962, 0.148188394934308 47.6541794246997, 0.148179995191816 47.6541796714871))') .STBuffer(5)
The line length and the number of lines appearing in the buffered shape seems to depends on the distance of the points and the size of the buffer.If I remove one of the 2 very close points, there are no problem anymore.If I change the buffer size to 10, no problem too.Any suggestion to solve this problem ?Thanks in advance for your answers,BR,Michaël BerthoixItelios do Brasil - São Paulohttp://www.itelios.com.br- Edited byMichael Berthoix Tuesday, November 03, 2009 5:54 PMbad formatting
Answers
- Hi Michael,
This is a bug indeed, but how is this issue causing you a problem? For example, STIntersects should work even though buffered result is not perfect.
You could try using Reduce with some very small tolerance to remove one of 2 close points.- Marked As Answer byMichael Berthoix Wednesday, November 04, 2009 1:34 PM
All Replies
- Hi Michael,
This is a bug indeed, but how is this issue causing you a problem? For example, STIntersects should work even though buffered result is not perfect.
You could try using Reduce with some very small tolerance to remove one of 2 close points.- Marked As Answer byMichael Berthoix Wednesday, November 04, 2009 1:34 PM
- Hi Desinderlase,Thanks for your answer. I just saw that the Reduce function is available for the geography type, I though it was only for geometry !In fact, the problem is that I use this buffered shape as a kind of template, to help users to draw within it respecting some constraints.In this case, the extra line in the middle introduce an unexpected constraint in the system.I'll check if the problem can be easily solved with the Reduce function.Thanks again,Michaël BerthoixItelios do Brasil - São Paulohttp://www.itelios.com.br
- Hi Michael,
I checked with the SQL Server Spatial team and this is indeed a bug. It was found and fixed already, however the fix will not be available until the next major version of SQL Server. - Hi Ivor,Great news, thanks :)For the moment, I used the reduce function as suggested by Desinderlase, and this workaround was perfect in my case for the moment.Michaël BerthoixItelios do Brasil - São Paulohttp://www.itelios.com.br


