[geos-devel] Snapping bug ?

Martin Davis mtnclimb at telus.net
Fri Dec 3 17:09:38 EST 2010


Ok, I've tried this in JTS, and I get the same results as you posted for 
GEOS.

POLYGON ((0.5 0, 0.5 0, 1 1, 0 1, 0.5 0))

So yes, duplicate points are not being removed correctly.

This isn't a problem in the context in which this code is being used in 
JTS (polygon overlay), since duplicate vertices are supported under the 
JTS geometry model.

Might be nice to improve this behaviour, though. 


strk wrote:
> On Fri, Dec 03, 2010 at 11:02:35AM +0100, strk wrote:
>
>   
>> GEOS/JTS in sync
>> (I checked and synched, only additional snapToSelf was missing).
>>     
>
> So, Martin. 
> After a closer look I found that indeed GEOS wasn't checking
> for duplicates as JTS was. BUT: reading the code JTS seems to
> be only checking for duplicates when snapping segments, not vertices.
> So this specific case still yelds the duplicated point after porting
> that part of the code.
>
> Did you try with JTS ?
>
>   
>> =# select st_asewkt(st_snap(
>>  'POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))',
>>  'POINT(0.5 0)',
>>  0.6
>> ));
>>     
>
> --strk;
>
>   ()   Free GIS & Flash consultant/developer
>   /\   http://strk.keybit.net/services.html
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1170 / Virus Database: 426/3294 - Release Date: 12/03/10
>
>
>   


More information about the geos-devel mailing list