Hi Michaël,

Thanks for the advice.  I may end up doing the DE-9IM matrix, but I'd like
to start with a review and critique of what I'm currently doing.  To
reiterate:

The problem that I'm trying to fix is:  support for polygon shells with CW
holes in PolygonHandler because ESRI allows this.  Without the fix, JUMP
imports these as overlapping shells which is a topology error.

I attempted to limit the scope of the change by testing for
(shells.size()>1)  && (holes.size() == 0).  This triggers for the case I am
trying to fix, but unfortunately my shellsOverlap() method assumes that the
first polygon found that contains another is the shell and that the rest are
holes.

This is a serious flaw that you caught.  There may be multiple shells with
holes (or not) in each.  If I am going to eliminate this case, an additional
test is needed to determine if the linear ring found by shellsOverlap() does
indeed contain all of the rest.  Of course, if it turns out that it does
not, I'll have to deal with the case somehow;  perhaps by just allowing the
bad geometry to be build as it is now.

I very much want to maintain the current speed of the shapefile reader.  I'm
not sure how much this fix will help others, but it seems to handle the data
that I have found so far.  Any comments?

regards,
Larry

On Thu, Apr 17, 2008 at 4:12 PM, Michaël Michaud <[EMAIL PROTECTED]>
wrote:

> Hi Larry,
>
> I get a case somewhat similar with a parser I wrote for GeoConcept format.
> In this format, multi-polygon come as a set of linear rings with no
> special order and eventually some overlaps or other bad topology I
> wanted to catch.
> I decided to compute the DE-9IM matrix in a double loop
> Something like
> List<Polygon> input = ... // the list of polygons issued from my linear
> rings
> List<Polygon> result = ... // an empty list of polygons
> for (Polygon pi : input)
>    for (Polygon pr : result)
>        IntersectionMatrix im = pi.relate(pr)
>            // then decide if pi is a new polygon, a hole in an existing
> polygon (result), an overlapping polygon...
>
> I must admit this approach may have an unecessary performance penalty
> for a format like shapefile (in my case, correctness was more important
> than performance)
>
> Michaël
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
>
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>



-- 
http://amusingprogrammer.blogspot.com/
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to