That sounds about right.  I guess the EdgeRing code needs looking at 
then.  It ends up creating and storing a RingImpl, when we should 
probably be storing just an ArrayList of points like you suggest.

I'll take a deeper look at this, but the problem now may be if we need 
to split up this list of points into 3 seperate EdgeRings (in the 
example problem we have a polygon with 2 holes in it, but at this point 
in the code we just have one long list of points).  An EdgeRing seems to 
store information such as a list of holes within it and if it is a hole 
itself, so maybe we don't need to split it up.  I'll have a better idea 
once I get into it more and start trying to make this change.

Graham.


Jody Garnett wrote:

> I just talked to Martin - he recognized the code here as a fork from a 
> JTS original and was able to spot the mistake.
>
> Apparently the construct we are building is not supposed to be a 
> "proper" ring yet. So if we may need a different data structure to 
> carry the information around in .... one that allows duplicate points 
> (maybe even a simple List).
>
> Apparently later in the method the duplicate points are removed, and 
> then (and only then) should we make a real ring out of it. Martin 
> talked a bit about performance, and how we should put off the 
> duplicate point checks until much later.
>
> Long and short of it ... we need two implementations for "ring":
> - one may be invalid and is just used to throw information around 
> internally
> - one is always valid, enforced on creation time, and is used by 
> client code
>
> What do you guys think?
> Jody
>
>> Fair enough I am pretty sure the poor ring builder just starts 
>> walking around the two "holes" (in order to have a longer path) and 
>> thus gets confused.
>>
>> Interesting problem (finding the largest ring to act as the outer 
>> edge), I was thinking you could make the choice based on length.... 
>> But you could have a very complicated start in the middle of a circle 
>> and the start would be longer in length.
>>
>> Hopefully Sanjay or Mr Roehrig has a suggestion.
>>
>> Cheers,
>> Jody
>>  
>>
>>> That's correct Jody, the resulting geometry looks pretty much like 
>>> the ascii art in your email.  The top point of the "bow tie" that 
>>> crosses the edge is the point that causes the ring consistency check 
>>> to fail.
>>>
>>> Graham.
>>>     
>>
>


-- 
Graham Davis
Refractions Research Inc.
[EMAIL PROTECTED]


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to