Fwd: Re: [OpenMap Users] Polygons with holes in 4.6.2

From: Alexander Sokolov <sokolov_at_system.ecology.su.se>
Date: Fri, 18 Feb 2005 14:20:22 +0100

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.

There is a shapefile of seas with islands (holes) in the attachment

Alexander




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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=





--
[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 - 08:39:13 EST

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