Re: [OpenMap Users] int/float -> double?

From: Don Dietrick <dietrick_at_bbn.com>
Date: Wed, 9 Jul 2008 17:31:09 -0400

OK, OK, OK.

I've uploaded an OpenMap 5 beta package to:

http://openmap.bbn.com/src/openmap_5.0b_20080603.zip

or

ftp://openmap.bbn.com/pub/customer-redirect/openmap/openmap_5.0b_20080603.zip

The OMGraphics don't have double precision yet, so they don't make use
of the double precision capabilities of the projection classes.

This beta version of OpenMap is not backward compatible with older
versions, and will require Java 5. That's going to be the requirement
for OpenMap 5, too.

There are several changes that should be noted:

- It's not backward compatible is that the Proj classes return
Point2D objects instead of LatLonPoints.
- The com.bbn.openmap.LatLonPoint extends from the new
com.bbn.openmap.proj.coords.LatLonPoint. The new LatLonPoint has
Float and Double inner classes. The outer LatLonPoint class is
abstract. This follows the Point2D model. In fact,
com.bbn.openmap.proj.coords.LatLonPoint extends from Point2D. That's
how some projections return the new LatLonPoint and still adhere to
returning Point2D objects. getX() returns longitudes, getY() returns
latitudes.

- This change requires layer changes, usually using the inverse method
that will result in the return being safely casted:

LatLonPoint llp = (LatLonPoint) projection.inverse(Point2D, new
LatLonPoint.Double());

There is a new GeoProj abstract class that is the superclass for all
of the older projections, it extends Proj. The Cartesian Projection
class also extends Proj. The difference is that GeoProj classes will
create LatLonPoints to return for inversion operations, or kind of
assume that the Point2D objects passed in for inverse operations will
be considered LatLonPoints when they are used later.

OMGraphic modifications are coming, to allow them to take advantage of
the double precision methods on the Projection classes if desired.
Float precision is still (and will be) supported if your data is only
accurate to that level and you want to save memory.

Also, expect that the Debug class is going away, replaced by the java
logging mechanism (since it's there).

Feedback welcome, I'm going to get this version into the CVS
repository on openmap.bbn.com when I get the OMGraphic modifications
in place sometime in July.

- Don


On Jul 7, 2008, at 5:19 PM, Tore Halset wrote:

> Hello.
>
> I am doing some projection/coordinate type of work in OpenMap, and
> would like to extend precision.
>
> 1) LatLonPoint internals from float to double.
> The performance gain of using float is minimal and some users need
> the extra precision. Searching the list, this request has been made
> from time to time at least back to 2003 when I subscribed.
>
> 2) switch out java.awt.Point (int) with java.awt.geom.Point2D
> (double) in Proj.
> At first, it seems logical to use a int x,y point to represent a
> point on the screen or in a generated map image. However, in various
> situations, this is to limited.
> * We use OpenMap projection for other things than to draw on a map.
> In such situations, we loose a precision by the use of int. We have
> worked around this by using our own modified versions of some of the
> projection code.
> * These days, most graphics systems support antialiasing, to the
> extra precision can be used to improve the image.
> * Some users may want to draw to graphical vector formats like pdf
> (itext) or svg (batik) and let users zoom in.
>
> From various mails on this list, I have got the impression that this
> will be partly/completely done in OpenMap 5 that already exist in
> some way in BBNs internal CVS that is a different CVS than the one
> the rest of us have access to.
>
> If it would help, I could step in and do some work on this. The
> problem is that I think (memory based on messages on this list) that
> some of this has already been done by BBN for their internal CVS
> with OpenMap 5.
>
> Regards,
> - Tore.
>
> --
> [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"]

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



--
[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 Wed Jul 09 2008 - 17:31:50 EDT

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