J2ME: Point inside zone (irregular polygon)

S

Simon Brooke

I've got a little method to implement tomorrow which would go an awful lot
quicker if I had someone else's solution to crib.

I have fisheries zones, which are defined for me as lists of
latitude/longitude locations which form a clockwise walk around the zone.
Fishing is legal if the current location is inside a zone, else illegal.
Zones are probably not going to intersect, although I can't absolutely
guarantee that - the legislation doesn't specify. At the scale we're
working, we don't need great circle interpolations - we can assume
straight lines on a mercator projection.

So what this boils down to is
java.awt.Polygon.contains(java.awt.geom.Point2D)

Easy, isn't it? Except I need to do this in MIDP 2.0, which doesn't have
points or polygons. Can anyone suggest where I can find a quick statement
of the java.awt.Polygon.contains algorithm (or, better still, source
code)?


--
(e-mail address removed) (Simon Brooke) http://www.jasmine.org.uk/~simon/
There's nae Gods, an there's precious few heroes
but there's plenty on the dole in th Land o th Leal;
And it's time now, tae sweep the future clear o
th lies o a past that we know wis never real.
 

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top