Re: [OpenMap Users] rendering problem still remains

From: Don Dietrick <dietrick_at_bbn.com>
Date: Tue, 5 Oct 2004 14:47:09 -0400

Hi Piotr,

On Oct 5, 2004, at 1:18 PM, Piotr Kami¨˝ski wrote:

> Hi,
>
> Don, I remeber that you wrote some time ago about changing float to
> double in OpenMap.

I hopefully wrote about adding the option for using doubles in addition
to floats.

> Have you made any progress in that area? The problems Ruben has
> described are just the same as

Some, but none to check into the code base for 4.6.1. I've done some
work adapting OpenMap components to use meters (a strait cartesian
coordinate system), and it's really helped in bringing out the
architectural/API adjustments needed to bring in double precision as
well as for using pre-projected data.

I'm not enthusiastic about totally replacing all floats in the source
code with doubles. In addition to creaming backward-compatibility, it
adds a significant memory cost for those who may not want to accept the
tradeoff of precision versus size.

> I have using small scales (1:100, 1:50). I think that increasing
> precision of calculations is
> really needed. I could participate in that work. I wonder if
> refactoring tool
> (like RefactgorIt that we use in our company) could help in those big
> changes.

Thanks for the offer, I'll start bouncing ideas off the list for the
transition.

Here's where I think the changes need to start:

The Projection interface and implementing classes need to be updated to
use java.awt.geom.Point2D objects instead of LatLonPoints.

A new abstract class, com.bbn.openmap.proj.coords.LatLonPoint is added,
extending Point2D. This LatLonPoint has two subclasses, Float and
Double, just like Point2D.

The com.bbn.openmap.LatLonPoint then extends
com.bbn.openmap.proj.coords.LatLonPoint.Float.

By moving to Point2D, the projection classes become more generic with
their meaning of what the coordinates are. A Cartesian projection, for
instance, can be set in the MapBean with the assumption that the
coordinates are meters/ft/whatever the application needs.

These changes lead to the obvious conclusion that the OMGraphics would
have to change, too. I'm not sure which way to go with them. There
are parts of them that aren't very object-oriented, and I'd like to
make them more so, focusing more on objectifying them by render type
and eliminating unused fields for different render types. That would
also suggest that their geometry definitions should also be more
objectified, allowing for different coordinate definitions with varying
precision that allowed them to flow with the Projection API.

All things for the release after the one I'm working on now, which
wrapping up the final touches - CHANGELOG, AUTHORS, last minute bug
reports/contributions, not to mention your OMGraphic-XML contribution
(I haven't forgotten!).

- Don


>
>
>
> -----Original Message-----
> From: owner-openmap-users_at_bbn.com [mailto:owner-openmap-users_at_bbn.com]
> On Behalf Of Hudson Brian R Contr AFRL/IFSF
> Sent: Tuesday, October 05, 2004 4:44 PM
> To: Rub¨Śn Ruiz; Openmap Mailling-list
> Subject: RE: [OpenMap Users] rendering problem still remains
>
>
>
> Hey,
>
>
>
> Don gives some suggestions here on how to modify OpenMap to use
> doubles.
>
>
>
> http://openmap.bbn.com/mailArchives/openmap-users/2003-12/2104.html
>
>
>
> Many people seem interested in this, but I haven't heard of anyone
> doing it successfully. Don indicates that is a large job.
>
>
>
> I'm not sure that rendering in XY will help. When you are at that
> scale OpenMap attempts to determine the XY location of things based on
> its lat/lon. At that scale the lat/lon per pixel is so small that
> rounding errors (and precision) can really mess up the drawing (as you
> can see by using the drawing tool). You could attempt to use XY
> rendering but in order to get the XY points won't you have to use the
> projection classes to turn your lat lon points into XY coords? Doing
> this will cause you to suffer the rounding/precision problems that
> OpenMaps lat lon render type is having at the at scale.
>
>
>
> You could possibly write your own lat/lon to xy function that would
> take the scale and top left/bottom right lat lon points, then using
> doubles calculate the delta per pixel, then using that information to
> calculate the XY coords of your rendering in order to get a bit more
> precision.
>
>
>
> Brian Hudson
>
> -----Original Message-----
> From: owner-openmap-users_at_bbn.com [mailto:owner-openmap-users_at_bbn.com]
> On Behalf Of Rub¨Śn Ruiz
> Sent: Tuesday, October 05, 2004 9:22 AM
> To: Openmap Mailling-list
> Subject: [OpenMap Users] rendering problem still remains
>
> Hi all,
>
>
>
> Fitst of all i would like to thank to Brian Hudson for his
> ideas...thanks brian.
>
>
>
> When I use XY / XY-Offset Rendering type I can draw perfectly,
> but...my problem is not just when I'm drawing, I've a set of maps
> coming from autocad, I've managed to translate them into shapefiles in
> Lat/Lon. The problem comes with many lines/polygons using a high scale
> (1:62) projection. The normal polygons are more or less "visible", but
> all my circles are not. I don't know if I can change the rendering
> type for all my lines/polys when I load them or anything similar. Also
> when I draw a nice circle with XYOffset and I save it in a SHP, it
> really stores a rectangle, and if I load that shp again I can see a
> perfect rectangle...I cannot store nothing rendered with any XY render
> type.
>
>
>
> At this point I've been thinking in varius exits to this problem:
>
>
>
> - if its possible to render XY all my graphics I think it'll
> be solved, but I've tried with no success...
>
> - if it would solve this problem...could I change all float
> members to double or is there any restriction that makes it
> impossible? Do you know where can I begin to change and what portion
> of openmap do I've to change? I think the main problem resides in the
> projection classes but I need some "light" from you, I've not been
> working with openmap too much, and every day I find new fancy things.
>
>
>
> I hope someone can help me...
>
>
>
> Thanks in advance,
>
> Rub¨Śn.
>


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 Tue Oct 05 2004 - 14:48:16 EDT

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