Re: AW: [OpenMap Users] Areas with holes

From: George Uecker <george.uecker@dot21rts.com>
Date: Wed Apr 30 2003 - 11:19:33 EDT

Hi Ruediger,

Gubler, Rüdiger wrote:

>Hi George,
>
>thank you this is what i need. My holes are also different areas, so first i must
>calculate the shape and the holes. Do you know a tricky solution?
>
I'm not sure I understand your question - can you elaborate a little
about your data and how you expect to see it displayed in your layer?

In my layer, I'm displaying contour isolines that have been calculated
from a radar clutter cell matrix using a customized version of CONREC.
  <http://astronomy.swin.edu.au/%7Epbourke/projection/conrec/> I simply
create OMPolys from the generated points and go from there according to
the steps outlined in my previous post.

Note that holes are only a problem if you are color- or pattern-filling
your areas. If you only draw the outline of the areas, there is no issue.

Regards,

George

>
>
>Yours Ruediger
>
>
>
>-----Ursprüngliche Nachricht-----
>Von: George Uecker [mailto:george.uecker@dot21rts.com]
>Gesendet: Montag, 28. April 2003 17:26
>An: Gubler, Rüdiger
>Cc: Openmap-Users (E-Mail)
>Betreff: Re: [OpenMap Users] Areas with holes
>
>
>Hi Rudiger,
>
>Here is what I did in my custom layer to display holes within OMPolys:
>
>Note: In my case, a "hole" is defined just like other areas, except that
>it happens to lie completely within the bounds of another area.
>
>Step 1: Create an OMPoly for each area. As each poly is created, you
>may have to call setDoShapes(true) on the OMPoly , depending on the
>version of OpenMap that you're using.
>
>Step 2: Generate the OMPolys for the current projection.
>
>Step 3: Call getShape() on each OMPoly. This method returns a
> java.awt.geom.GeneralPath object.
>
>Step 4: Create a new java.awt.geom.Area object from each GeneralPath object.
>
>Step 5: Use the Area.exclusiveOr() method to create a single compound
>Area that is the union of all Areas minus any intersection. Holes are
>the intersection of two Areas. Be aware that the exclusiveOr() is an
>expensive operation - you may want to do some pre-processing of each
>Area using bounding boxes to determine when it's actually necessary.
>
>Step 6: Use the Graphics2D.fill(Shape) method to render the resulting
>compound Area. Arbitrarily complex background layers will show through
>the holes as expected.
>
>Note that there are other ways to deal with holes - this way happens to
>be relatively easy to code, but it can be slow depending on the number
>of areas you have.
>
>Hope this helps,
>
>George
>
>Gubler, Rüdiger wrote:
>
>>Hi all,
>>
>>in which way can I handle areas with holes?
>>Does OpenMap can handle it in feature versions ?
>>
>>
>>Yours
>>Ruediger Gubler
>>--
>>[To unsubscribe to this list send an email to "majdart@bbn.com"
>>with the following text in the BODY of the message "unsubscribe openmap-users"]
>>
>>.
>>
>
>

-- 
George Uecker				george.uecker@dot21rts.com
Software Engineer                       (410) 480-7236
Dot21 Real-Time Systems Inc.            (410) 313-7515 fax
--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Apr 30 11:24:52 2003

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:35 EDT