georeference.org
Subscribe to this thread
Home - General / All posts - Map rotates according to GPS direction
trohrer29 post(s)
#02-Jul-08 10:37

I used to use Delorme StreetAtlas for GPS navigation before I found Manifold. There was one feature that was very useful that I would like to see in Manifold (and I haven't been able to find it, if it's already there). That is for the map to rotate so that "up" on the screen is constantly updating to be the same as the direction you are heading, so as you switch between the windshield and the compter screen, the general view is the same. I expect there is some default in Delorme that is set at some number of degrees of deflection so that it doesn't reset every time you wobble a degree. This feature, and the amount of deflection would, of course, be user selectable.

Does anyone else use Manifold for this purpose? I am amazed at how great it works on a quite limited computer!

tjhb

2,384 post(s)
#02-Jul-08 19:23

This is just possible I think. Manifold's not well set up for rotating a map, but you can do it with a custom projection. (I like using Oblique Mercator; John Mechelas does it by "swinging" a conic projection.)

Making maps where north is not "up"

Rotating the Map view

Creating Non - N-S/E-W Grids

Map Rotation

Getting the thing to update the azimuth of the projection automatically would, I think, require an active column (since we can't create a non-modal thread to run in the background, as far as I know) that reprojected the drawing periodically, based on the bearing fed in by the GPS. How are you getting access to that bearing (if you already are)?

trohrer29 post(s)
#03-Jul-08 08:40

Thanks, I'll dig in to these. I haven't tried it yet, but in the GPS console you can select "Track Columns." Among the choices are [GPS Bearing], which I was assuming was a Manifold calculation based on previous GPS readings. I'll see if I can't find that for sure

tjhb

2,384 post(s)
#03-Jul-08 14:22

I see yes. But I'm not sure it's exposed in the object model. If not, it may well be retrievable using UI scripting (pane: GPS Console, control: LabelBearing). This really would be a fry-up. Using an active column to run a script driving the UI in a separate thread to reproject the drawing (or map) every few seconds. Bound to crash???

tjhb

2,384 post(s)
#03-Jul-08 14:32

Oh, not possible that way. Manual says:

User interface scripting is available for regular scripts and forms, but is unavailable for active columns, where it would be impractical for performance reasons...

Might only be possible if (1) the GPS bearing is exposed in the object model (I don't see it) or (2) you went to the trouble of reading the GPS sentences directly from the unit.

tjhb

2,384 post(s)
#03-Jul-08 15:38

What would happen though if an active column script called a free-standing script? If the second script used UI scripting, would it be allowed? Has anyone tried this?

adamw


4,662 post(s)
#04-Jul-08 03:51

Yes, this is allowed, but not recommended. Recomputing a value in the active column would launch the UI script and proceed further without waiting until the UI script finishes. The reason this is not recommended is that you might want to launch the script for the active column in the context of a third-party application or in the context of a web site, where UI scripting is unavailable.

tjhb

2,384 post(s)
#04-Jul-08 05:21

Thank you Adam. So the active column script might want to wait on a completion flag set by the last call to the free-standing script, before calling it afresh. We could store this flag in something as basic as a Comments component. This all seems very seat-of-pants, but it might just work. I've got to try now.

0 msec Copyright (C) 2007-2008 Manifold.net. All rights reserved.