Re: [OpenMap Users] Polygons with holes in 4.6.2

From: Don Dietrick <dietrick_at_bbn.com>
Date: Fri, 18 Feb 2005 13:24:22 -0500

Hi Alexander,

On Feb 18, 2005, at 8:20 AM, Alexander Sokolov wrote:

>
> I am not sure I understood you right. Let me explain my "model" of the
> problem. If I am not mistaken, an ESRI shape
> record can contain a list of polygons and polygons with ClockWise
> order of
> vertices are "real" polygons which should be added to the layer, while
> polygons with CounterClockWise order of vertices are "holes" and
> should be
> somehow "extracted" from the layer. It seems the OMGraphicList does not
> take into account order of vertices, creates OMGraphics, paints them
> and
> add to the list. But in case of OMAreaList OMGeometry-s are added to
> the
> GenaralPath which takes care about order of vertices and correctly
> creates
> holes. So, we don't need to worry about fill color for these holes.
>
> Sorry for this rough simplification.

That's my understanding of the coordinate layout in the shape polygon,
too, I was more worried about what the OMAreaList was doing with your
data. I didn't understand that the Java 2D rendering code handles the
holes automatically with the coordinates laid out in this manner, too.
I was trying to create a complex polygon that handled the hole, and
that's not necessary.

I'm still having a problem with enabling this code, though (removing
the false in the if statement in ESRIPolygonRecord), because OMAreaList
doesn't handle the case when a shape is on both sides of the window, it
draws lines across the window connecting the two. You really see it
for world view political boundaries.

Thanks for the main fix, though, and the data file to test it with.

- Don

>
> Does this change handle the fill color properly? How does it change
> the appearance of the shape?
>
> I don't have a good data sample to test this on.
>
> - Don
>
>
> On Feb 17, 2005, at 5:58 PM, Alexander Sokolov wrote:
>
>>
>>
>>
>> Hi Don,
>>
>> It seems the code to handle polygons with holes in the
>> ESRIPolygonRecord
>> conflicts with the new default behaviour of the BasicGeometry and we
>> need to call
>> ((OMAreaList)sublist).setConnectParts(false);
>>
>> in the ESRIPolygonRecord.
>>
>> // if (false && ispolyg) {
>> if (ispolyg) {
>> // There's a problem here with OMPolys that wrap
>> // around the earth, putting them in OMAreaLists makes
>> // them draw lines through the map. Need to sort that
>> // out before enabling this code by removing 'false'
>> // in if statement.
>> sublist = new OMAreaList();
>>
>> ((OMAreaList)sublist).setConnectParts(false);
>>
>> Please find modified file in the attachment
>>
>> Regards
>> Alexander
>>
>>
>>> OpenMap 4.6.2 has been released and is available on at
>>> http://openmap.bbn.com. The main new features of this release are:
>>> Other changes:
>>
>>> * Modified the ESRIPolygonRecord to include the donated code to
>>> handle
>>> polygon holes using OMAreaList. This code is disabled, however,
>>> because OMAreaList doesn't really handle shapes that go around the
>>> earth yet, and having this modification breaks world-level shapefile
>>> display. OMAreaList needs to be fixed before this code is enabled
>>> full-time.
>>>
>>> * Updated BasicGeometry to have the option of connecting shapes that
>>> are appended, instead of automatically not doing that. Updated
>>> OMAreaList to make that BasicGeometry append call with the connect
>>> parameter.
>>
>> <ESRIPolygonRecord.java>
>
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Don Dietrick, dietrick_at_bbn.com
> BBN Technologies, Cambridge, MA
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> <euroSeas.csv><euroSeas.shp><euroSeas.ssx>


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Feb 18 2005 - 13:35:45 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:06 EDT