Re: [OpenMap Users] OMPoly getShape() method [SEC=UNCLASSIFIED]

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Tue, 3 May 2011 01:20:10 -0400

Hi Joyce

I think I need to update the documentation. For polygons and other
OMGraphics that are rendered on both sides of the map, both parts are
combined into the Shape object that gets drawn. The Projection object
does create two sets of points for both sides, but the Shape object
lets you define it with separate parts.

When you iterate over a Shape object using a PathIterator, you get a
int type returned every time you grab the next segment. You get a
SEG_MOVETO, SEG_LINETO, or SEG_CLOSE. The MOVETO indicates the start
of the section., If you get one after the first segment and you know
the data is a closed polygon, you can assume that it has two pieces on
both sides of the map. Look at BasicGeometry.describeShapeDetail(...)
for an example of iterating over the Shape. The javadocs for
PathIterator also go over the meaning of the types.

The number of waypoints depend on a number of factors, like number of
points in the poly, but if you use GREAT_CIRCLE lines between the
points, you'll end up with many points even if you only have a couple
of waypoints defined. So you can't really go by that.

Hope this helps,

Don

On Mon, May 2, 2011 at 11:17 PM, Gong, Joyce (Contractor)
<Joyce.Gong_at_dsto.defence.gov.au> wrote:
> UNCLASSIFIED
>
> Hi,
>
> I'm new to geospatial space and OpenMap so bear with me.
>
> The API documentation for OMPoly getShape()  says:
>
> Get the array of java.awt.Shape objects that represent the projected
> graphic. The array will contain more than one Shape object of the object
> wraps around the earth and needs to show up in more than one place on the
> map.
>
> I've got an OMPoly with some points on it (representing a route with
> waypoints).  What I'm actually trying to find out is whether the OMPoly has
> wrapped around the earth to other edge of the screen.
> I am iterating through the General Path returned by getShape() and am
> getting the following results:
> (1) a route with no waypoints returns a count of 2
> (2) a route with no waypoints that's wrapped returns a count of 4
> (3) a route with 1 waypoint that's not wrapped returns a count of 3
> (4) a route with 1 waypoint that's wrapped returns a count of 6
>
> Does this mean each line is represented by 2 point shapes? But why does (4)
> return a count of 6?
>
> Just trying to get a handle on this to get expected number of objects back.
>
> Thanks,
> Joyce
>
> IMPORTANT: This email remains the property of the Department of Defence and
> is subject to the jurisdiction of section 70 of the Crimes Act 1914. If you
> have received this email in error, you are requested to contact the sender
> and delete the email.
>

--
[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 Tue May 03 2011 - 01:22:10 EDT

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