[Xastir] Re: Interesting APRSdos map!
Henk de Groot
henk.de.groot at hetnet.nl
Sat Mar 6 16:34:28 EST 2004
Hello Curt,
At 14:17 4-3-2004 -0800, Curt, WE7U wrote:
>I'd like eventually to allow the user to determine where the middle
>of the map is, but right now I think it'd take quite a bit of work
>to get there. We should also convert coordinates that are
>above 180 so that they get drawn correctly, but that's a tricky
>operation if lines/polygons go across the boundary, as I'm sure
>you've surmised.
Yes, I guess it could be done in two steps, first draw in memory on an
extended -360/+360 +90/-90 grid and then display the final bitmap centered
as the user would like it. The -180 to -360 area should then be
superimposed on the 180 to 0 memory area (bitwise OR) and +180 to + 360 on
the -180 to 0 memory area; that's easy enough with a bitmap.
To show it centered where the user wants it would be just cutting the
memory of final bitmap image at the points were the new left and right
border should be and "glue" the +180 to the -180 edges. I don't know the
performance pealty for this, but I guess that would bearable when all
drawing takes place in memory and only the final image is superimposed and
displayed.
All the other code can just go ahead using vectors and polygons on the
fixed positioned memory image and would not be burdened by what is finally
displayed. The only complication is that you only want to render what is in
view to save memory and performance. Since with an area from -360 to +360
you always have two separated areas to draw (which happen to overlap in the
end) and when centered on the -180/+180 longitude that would mean four
separated areas in the memory image should be rendered.
Okay, this is just thinking out loud. I did not give it a lot of thought,
so maybe it is a dumb idea afterall. I still have a gut feeling that map
rendering and display logic should be two separate things and that
rendering should not be burdened by how it is finally presented to the
user. Different projections are of course also an issue for which this
solution will not work, you don't want a flat bitmap to make a polar view
map for example...
Kind regards,
Henk.
More information about the Xastir
mailing list