To address this specifically in shape files, I think I would extend the
com.bbn.openmap.dataAccess.shape.EsriPolygonList to create an
EsriMultiPolygonList. You could make this class smart enough to check
for which polygons intersect each other on the first generate method
call, and then remember that so you don't have to do the checking -
only creating the Areas and doing the intersections on the EsriPolys
that matter.
You'd then have to modify the
com.bbn.openmap.dataAccess.shape.input.ShpInputStream to use the
EsriMultiPolygonList for multi-part polygons, instead of using another
EsriPolygonList.
- Don
On Wednesday, April 30, 2003, at 02:05 AM, 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?
>
>
> 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"]
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- [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 09:13:37 2003
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:35 EDT