try com.bbn.openmap.geo.Geo
You can create 2 Geo's, a and b from your lat/lons and then average them:
center = a.add(b).normalize()
k
At 03:35 PM 4/2/2004 -0500, Don Dietrick wrote:
>It depends on the projection type. You can calculate the center point exactly for CADRG/LLXY (their pixel/degree ratios are constant), but there aren't methods for the other projection classes to do this directly.
>
>You might find some ideas in the ProjMath.getScale() methods, seems like they would be related.
>
>- Don
>
>
>On Apr 2, 2004, at 3:00 PM, Keith Alphonso wrote:
>
>>I can get the centerpoint of the current projection, but I need the
>>centerpoint of a pair of LLPoints to create a new projection.
>>
>>-----Original Message-----
>>From: Don Dietrick [mailto:dietrick@bbn.com]
>>Sent: Friday, April 02, 2004 1:29 PM
>>To: Keith Alphonso
>>Cc: openmap-users@bbn.com
>>Subject: Re: [OpenMap Users] How to convert extents into centerpoint/scale
>>
>>
>>
>>On Apr 2, 2004, at 2:23 PM, Keith Alphonso wrote:
>>
>>>I am working with a UI and the users want to use extents for setting
>>>the
>>>area. They understand that the extents that they specify may not be
>>>exactly what shows on the map (based on width/height), but the problem
>>>I'm
>>>having is this:
>>>
>>>If they use the exact same extents as retrieved from
>>>Projection.getUpperLeft
>>>and Projection.getLowerRight and pass those values to my routine to
>>>recalculate extents, the same map doesn't come up, its off slightly.
>>>This
>>>is kind of a problem because those extents are automatically displayed
>>>on
>>>the UI for them to change. Submitting the same values causes a change
>>>and
>>>it shouldn't.
>>
>>It might, depends on the projection type.
>>
>>>The big problem I'm having is calculating the centerpoint of a pair of
>>>latlonpoints. Using strictly cartesian math, it does not take
>>>projection into account. Is there any way to calculate centerpoint
>>>from two bounding
>>>latLonPoints and the current projection?
>>
>>Can't you ask the current projection for the center point?
>>
>>- Don
>
>--
>[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 Fri Apr 2 15:53:22 2004
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:38 EDT