On Monday, August 25, 2003, at 03:40 PM, Catania, Luke A ERDC-TEC-VA
wrote:
> First let me say, that, I presume zooming to a box represented exactly
> by two corner points is not possible due to the fact that we are not
> dealing with a flat world with distance from latitude to latitude and
> longitude to longitude not being the same.
I think it depends more on the projection type you are zooming in over,
and how the dimensions of the viewable area compare to the
coordianates. Cylindrical projections let you specify lat/lon
boundaries, but the width/height of the viewable area might have these
points be set in a little from the corners.
> I have implemented two new Coordinate panels for the CoordDialog
> class. As in the existing panels, where there is the ability to enter
> a point in either decimal degrees or in DMS depending upon the tab you
> select, my additions allow a user to specify an AOI by entering in
> lower left and upper right coordinates either in decimal degrees or
> DMS. I calculate the center by averaging the coordinates. And I
> calculate the new scale using the corner coordinates and the getScale
> method. My code to center and scale is:
>
> Proj projection = (Proj)map.getProjection();
> float newScale =
> com.bbn.openmap.proj.ProjMath.getScale(llLatLonPoint,
> urLatLonPoint,
> projection);
> projection.setScale(newScale);
> projection.setCenter(lat, lon);
I'd set the center of the projection first, before I calculated the new
scale.
- Don
> map.setProjection(projection);
>
>
> When I enter the AOI coordinates and apply, my map is centered
> properly, but not necessarily zoomed to show all of the AOI.
>
> For example, if my AOI is:
> UrLat 43.0
> UrLon 23.0
> LlLat: 40.0
> LlLon: 20.0
>
> the map shows all of 20 –23 in longitude plus more outside that range,
> but is just inside the 40-43 range. Not that big of a deal, but in the
> case of:
>
> UrLat 44.0
> UrLon 23.0
> LlLat: 38.0
> LlLon: 20.0
>
> My map zooms to cover just inside 18-25 Lon and 39.5 – 42.5 Lat, so I
> do not get an AOI that includes all 38 – 43 in Lat. Is that that all
> caused by the projection. I am using CADRG, if I tried LLXY, which
> then includes the AOI I entered from lower lat to upper lat, but goes
> from 16-26 in long.
>
> I do not know much about projections, but I presume this again is all
> due to the fact that we are not dealing with a flat world with
> distance from latitude to latitude and longitude to longitude not
> being the same. So how does new scale work.
>
> I just want to make sure it is not a bug I have introduced in my code
> and I at least want all of the AOI included even if it includes more
> outside my AOI.
With the CADRG projection, you also have to deal with the
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- [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 Aug 26 11:52:06 2003
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:36 EDT