[geos-devel] Union problem

Martin Davis mbdavis at refractions.net
Fri Apr 4 19:52:22 EDT 2008


Martin,

I'm guessing that the polygon ring is in fact closed, it's just that one 
of the points is getting zeroed out for some reason.

It's hard to know what to say about where to start.  But you could look 
for convenient points where you could check whether the first/last point 
of a ring is (0,0), and maybe that will turn something up.  There is a 
point in GeometryGraph where rings are extracted from the graph of edges 
- that would be the first place to look.

Happy hunting... 


mchapman at texelinc.com wrote:
> Martin,
>
> Thank you for confirming that.  I will look at my code and validate that I am not screwing up the points after the geos operation. If not, I will try my best to debug through the geos source and look for the problem.
>
> By chance do you have a recommendation on where I should start looking in the union operation source code for this issue? Could I put a linearRing.isClosed() method call somewhere in the union code to trap the violating ring? 
>
> Thanks again for all your help!
>
> Best regards,
> Martin.  
>
>
>
>
>
> .
> Sent via BlackBerry by AT&T
>
> -----Original Message-----
> From: Martin Davis <mbdavis at refractions.net>
>
> Date: Fri, 04 Apr 2008 12:17:41 
> To:GEOS Development List <geos-devel at lists.osgeo.org>
> Subject: Re: [geos-devel] Union problem
>
>
> This works fine in JTS.
>
> Unfortunately I don't have GEOS running, so can't test it there.  
> Possibly we could look into that during some future work.
>
> It is a bit suspicious that it looks like the offending point is the 
> terminating point of the last ring in the US MultiPolygon.
>
> M
>
>
>
> Martin Chapman wrote:
>   
>> Martin,
>>
>> Here you go.  It occurs when you union the US and Mexico. Thanks for your
>> help!
>>
>> Best regards,
>> Martin
>>
>>
>> -----Original Message-----
>> From: geos-devel-bounces at lists.osgeo.org
>> [mailto:geos-devel-bounces at lists.osgeo.org] On Behalf Of Martin Davis
>> Sent: Thursday, April 03, 2008 12:32 PM
>> To: GEOS Development List
>> Subject: Re: [geos-devel] Union problem
>>
>> Send me the shapefile and I'll try it out in JTS.
>>
>> M
>>
>> Martin Chapman wrote:
>>   
>>     
>>> Unfortunately, I do not have JTS but I will try to step through the code
>>>     
>>>       
>> and
>>   
>>     
>>> see if I can learn more about the problem.  Perhaps a careful inspection
>>>     
>>>       
>> of
>>   
>>     
>>> the input and output point sets will yield some clues because the problem
>>>     
>>>       
>> is
>>   
>>     
>>> predictable.
>>>
>>> Best regards,
>>> Martin
>>>
>>> -----Original Message-----
>>> From: geos-devel-bounces at lists.osgeo.org
>>> [mailto:geos-devel-bounces at lists.osgeo.org] On Behalf Of Paul Ramsey
>>> Sent: Thursday, April 03, 2008 11:50 AM
>>> To: GEOS Development List
>>> Subject: Re: [geos-devel] Union problem
>>>
>>> Most probably a bug... any chance you could run this same test case
>>> under JTS so we can confirm if it's a problem at the algorithm level
>>> or the port level?
>>>
>>> Thanks,
>>>
>>> P
>>>
>>> On Thu, Apr 3, 2008 at 10:47 AM, Martin Chapman <mchapman at texelinc.com>
>>> wrote:
>>>
>>>   
>>>     
>>>       
>>>> All,
>>>>
>>>> When I union the two features USA and Mexico I end up with a geometry
>>>>       
>>>>         
>> that
>>   
>>     
>>>> has one point where the y or lat value for one point is zero.  See the
>>>> attachment for what I mean.  Does anyone think this is a bug in GEOS or
>>>>       
>>>>         
>> am
>>   
>>     
>>>>     
>>>>       
>>>>         
>>> I
>>>   
>>>     
>>>       
>>>> not doing something correctly?  Most other geometric unions create good
>>>> geometries.  If you want I can send the original shape file.
>>>>
>>>>
>>>>
>>>> Thanks for any help.
>>>>
>>>>
>>>>
>>>> Best regards,
>>>>
>>>> Martin
>>>>
>>>>
>>>> _______________________________________________
>>>>  geos-devel mailing list
>>>>  geos-devel at lists.osgeo.org
>>>>  http://lists.osgeo.org/mailman/listinfo/geos-devel
>>>>
>>>>     
>>>>       
>>>>         
>>> _______________________________________________
>>> geos-devel mailing list
>>> geos-devel at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/geos-devel
>>>
>>> _______________________________________________
>>> geos-devel mailing list
>>> geos-devel at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/geos-devel
>>>
>>>   
>>>     
>>>       
>>   
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> geos-devel mailing list
>> geos-devel at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/geos-devel
>>     
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022



More information about the geos-devel mailing list