Author Topic: Automation API?  (Read 5745 times)

alizhan

  • Full Member
  • ***
  • Posts: 30
    • View Profile
Automation API?
« on: August 30, 2004, 07:54:33 PM »
Does TF have any sort of automation API? OLE Automation, custom COM, whatever?

  -- Mark

Krein

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 1203
  • TopoFusion Author
    • View Profile
    • http://www.topofusion.com/diary
Automation API?
« Reply #1 on: August 30, 2004, 08:00:21 PM »
No, sorry, nothing like that.  What is it that you want TF to do?

alizhan

  • Full Member
  • ***
  • Posts: 30
    • View Profile
Automation API?
« Reply #2 on: August 31, 2004, 04:53:22 PM »
Several things, though the foremost desire involved some nutty ideas I have about how better to edit track information. While it is certainly possible to edit tracks with the current interface, it is not terribly efficient, and can be quite hard to control. Example: I was trying to use TF to make the map of the new race course for the Socorro Fat Tire Fiesta. I am not a strong enough rider to ride the whole thing at once, so I did it in pieces. I then tried to use TF's Make Network feature to join them all up.

That didn't work out so well.

I had three basic problems: First, while you can split a track segment into two segments (I think), there doesn't appear to be any way to join two segments into one, or combine segments from different tracks.

Second, there is no control over which segments TF tries to average, or how it averages them (yes, there are the global controls, but those do not give the level of control necessary for accurate maps). This leads to duplicate segments in some locations, while other segments get averaged to an incorrect location (when compared to the aerial photos, e.g.). This isn't a bug per se (TF didn't misbehave), it just didn't know what the "right" answer was, and I couldn't tell it.

Finally, and more fundamentally, track segment networks are not tracks. If the track is manifold (a simple loop), then they are equivalent. Any sort of complicated route, though, involves jumping between segments, and/or duplicated sections of the trail (often in different directions). Tracks imply  a certain sequentiality; this is not present in networks. No GPS is going to be able to handle a complicated network "track" properly, as it doesn't match the GPS' expectations of what tracks are. Try "backtracking" a network to see what I mean.

Put another way (because I really do think that this is an important point): You can't ride a network. You CAN ride a track involving pieces of the network strung together in a certain order. But, AFAICT, there is no way to create a track from a network under TF. So networks look great when rendered, but that's about all you can do with them; the length, elevation profile, and even direction of travel are all suspect, because the sequentiality is broken.

So, what does this have to do with automation? Simple: I was going to write a track network editor, which would drive TF for display. Kind of a testbed to see what works and what doesn't when editing tracks. Once I had something that worked, I was going to present it to you, to see if you would include something similar in TF.

I can give you a better write-up of my ideas as they stand, if you want. You're more likely to get them in a finished form than I am. '<img'>

  -- Mark

Krein

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 1203
  • TopoFusion Author
    • View Profile
    • http://www.topofusion.com/diary
Automation API?
« Reply #3 on: August 31, 2004, 06:40:51 PM »
Mark,

There is a way to create "virtual tracks" using a network.  Just use the profile/merge tool.  Select each segment of the network in order, and be sure to reverse any (using the "v" key or right clicking) that match up backwards.  Right click when you are done and do "save as.." to a GPX file.

As to your comments about editing networks, you are right on.  I do hope to add some sort of tools for handling how the network code works on a local level.

However, I have used the network code for a dozen different projects (some mtb race courses) with great success.  It does take some tweaking and certainly helps to understand the algorithm.  You could try reading our paper (available at http://www.topofusion.com/network.php).  Or, you can send me your data--I would be happy to take a look at the resulting networks and could probably point out what's keeping you from getting the results you're looking for.

As it stands, the network feature takes both quite a bit of knowledge and patience.  I hope to remedy this in the future.




alizhan

  • Full Member
  • ***
  • Posts: 30
    • View Profile
Automation API?
« Reply #4 on: September 01, 2004, 04:18:58 PM »
Quote (Krein @ Aug. 31 2004,7:40)
There is a way to create "virtual tracks" using a network.  Just use the profile/merge tool.  Select each segment of the network in order, and be sure to reverse any (using the "v" key or right clicking) that match up backwards.  Right click when you are done and do "save as.." to a GPX file.

Sure enough, it works as you describe.

This is getting embarassing. I very obviously need to reread the manual. '<img'>

Quote (Krein @ Aug. 31 2004,7:40)
However, I have used the network code for a dozen different projects (some mtb race courses) with great success.  It does take some tweaking and certainly helps to understand the algorithm.

I had a sneaking suspicion that I was missing something--after all, I couldn't be the first person wanting to do this. I'll give it another whack. I think that it's pretty obvious that most of the tools were there; I just didn't know it. I will send you some data, though, so you can see what I've been working with. I'll also send along my final result, so you can see the mess I made. '<img'>

Let me see if I have it straight, now. I load up my data, and run a moderate-contraction, low-reduction network construction on it to find the major pieces. Where the network construction fails to average what I want averaged, break and save the appropriate segments to new tracks (selection of input for network construction is only at the track level, right?). For each set of tracks to be averaged, select only those tracks, and run a network construction on them with whatever contraction is necessary to get a clean merge; discard the waypoints. Finally, select all the tracks, and merge them into a single network, with lowest contraction and reduction. Am I way off base?

Quote (Krein @ Aug. 31 2004,7:40)
As it stands, the network feature takes both quite a bit of knowledge and patience.  I hope to remedy this in the future.

Considering the tools that are available, not much more basic functionality is needed--the ergonomics just need to be addressed. For example, splitting and combining tracks could be made easier (it looks like one currently has to go through the profile dialog to do combining, which was not a place I thought to look for it). Also, it would also be nice to have a way to get at the pieces of the network construction algorithm without having to run the whole thing (e.g., average these tracks, simplify this track, split these tracks where they intersect, combine these tracks into a network, etc.). The rest is just (somehow) making it more obvious that the functionality is available, to users who don't remember what they read in the manual.

  -- Mark

Krein

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 1203
  • TopoFusion Author
    • View Profile
    • http://www.topofusion.com/diary
Automation API?
« Reply #5 on: September 02, 2004, 08:09:26 AM »
Well, the network works on all tracks that are currently loaded (enabled in the active file list).

It's definitely possible to do multiple network constructions to get the desired results, but typically I just try to get it to work all in one shot.

Remember that reduction strength controls how close tracks need to be in order to average them.  Unless you have some unique trails that are very close to each other there isn't much harm in cranking this slider up high.

Contraction, on the other hand, deletes spurs that sometimes result in the network as a result of turning around, standing still while collecting points or going off trail for whatever reason.

Unless you've got some very difficult data I'd recommend trying to get what you're looking for in a single run.  I'd still be glad to take a look at your data.