Hi Martin,
The forward method gives you a window pixel location for the lat/lon
coordinate. The algorithm simply tests whether that point is in the
window space. The projection.forward() algorithm will take care of the
dateline, etc.
- Don
On Mar 2, 2004, at 3:23 PM, Chapman, Martin wrote:
> Don,
>
> You can fix that though if you test for when that occurs and then
> forward project the negative x (lon) values by adding 360 to each x
> value. Then the alogorithm works.
>
> Martin
>
> -----Original Message-----
> From: Don Dietrick [mailto:dietrick@bbn.com]
> Sent: Tuesday, March 02, 2004 12:57 PM
> To: Sperlongano Brian M NPRI
> Cc: openmap-users@bbn.com
> Subject: Re: [OpenMap Users] Lat/Lon Visibility ?
>
>
> Hi Brian,
>
> You can do something like
>
> boolean isVisible(Projection proj, float lat, float lon) {
>
> Point p = proj.forward(lat, lon);
> return
> p.getX() >=0 &&
> p.getX() < proj.getWidth() &&
> p.getY() >= 0 &&
> p.getY() < proj.getHeight();
> }
>
> - Don
>
>
>
> On Mar 2, 2004, at 2:33 PM, Sperlongano Brian M NPRI wrote:
>
>>
>> This is probably a really simple question, but is there a way to
>> determine if a particular Lat/Lon is visible on a MapBean or
>> Projection?
>>
>> Thanks,
>> Brian
>> --
>> [To unsubscribe to this list send an email to "majdart@bbn.com" with
>> the following text in the BODY of the message "unsubscribe
>> openmap-users"]
>>
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com" with
> the
> following text in the BODY of the message "unsubscribe openmap-users"]
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Tue Mar 2 15:31:47 2004
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:38 EDT