RE: [OpenMap Users] Shapefile - Polygons with holes

From: Zacker, Jeremy <Jeremy.Zacker_at_ngc.com>
Date: Fri, 29 Oct 2004 16:58:42 -0400

Yes, this fixed 'Polygon with holes' but broke polylines. The Polylines were sometimes being closed off to make the polyline a polygon. After a bit of digging, I have modified the author's modification.

Basically, we should use an OMAreaList when the shape type is SHAPE_TYPE_POLYGON. Otherwise use an OMGraphicList.

In ESRIPolyRecord.java, int the 'addOMGraphics' method, I replaced:

///////////////OLD////////////////////////////

OMAreaList sublist = null; //as: was OMGraphicList sublist = null;

if (nPolys > 1) {
   sublist = new OMAreaList(10); //as: was OMGraphicList(10);
   drawingAttributes.setTo(sublist); //as: new line
}

/////////////////END OLD//////////////////


with:

/////////////////NEW////////////////////////

OMGraphicList sublist = null;

if (nPolys > 1) {
   sublist = (shapeType == SpatialIndex.SHAPE_TYPE_ARC) ? new OMGraphicList() : new OMAreaList(10);
   drawingAttributes.setTo(sublist);
}

/////////////////END NEW/////////////////////


I kept the corrections to BasicGeometry.java in the previous posting. This seemed to work well with both lines and areas from shapefiles.

--------------------------------
Jeremy Zacker
Northrop Grumman
(732) 530-5063
jeremy.zacker_at_ngc.com


-----Original Message-----
From: Don Dietrick [mailto:dietrick_at_bbn.com]
Sent: Friday, October 22, 2004 10:29 AM
To: Zacker, Jeremy
Cc: openmap-users_at_bbn.com
Subject: Re: [OpenMap Users] Shapefile - Polygons with holes


It's not a bug, it's an unsupported feature.

There was a posting earlier to the mailing list on how to make a
modification to the code to support it, I haven't had a chance to test
it yet.

http://openmap.bbn.com/mailArchives/openmap-users/2004-06/3034.html

- Don

On Oct 22, 2004, at 9:58 AM, Zacker, Jeremy wrote:

> I've got some shapefiles of the New York area. When I display them
> with an ESRI products (in this case, Java Map Objects), many of the
> polygon drawn have 'holes' in them. For example, when drawing the
> polygons for the land areas, there are holes where the lakes should
> be.
>
> But when I use ShapeLayer to draw the same files, there are no holes.
> Is this a bug, or is there some flag that needs to be set? I think
> the ShapeLayer and related files may parsing some of the ESRI records
> as a single polyline and not as 'parts'.
>
> --------------------------------
> Jeremy Zacker
> Northrop Grumman
> (732) 530-5063
> jeremy.zacker_at_ngc.com
> --
> [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"]
>
>


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 Oct 29 2004 - 17:01:57 EDT

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