In the previous post I mentioned my work on the command-line interface for the new Kosmos v3 GUI. I’m more and more excited with the possibilities this feature opens. A lot of things which can be tedious to code because of the required GUI widgets can now be provided fairly quickly through the command line (this doesn’t mean there won’t be any GUI, but certain functions are better served through a textual interface).

I managed to implement some basic parsing for what I call spatial specifications which will be used in the new rendering rules system. An example of a spatial specification would be something like…

way[highway=footway].[barrier=gate]

…would select gates on footways.

I wanted to test this parser and so I implemented a simple find command for querying OSM data:

KosmosQuery

It’s just a prototype – I plan to add some kind of browsing of query results (both on the map and in the log window) – but it shows the possibilities of this interface. The querying could extend to GPS data, too. It could also be used to filter out GPX data (based on the date, for example). These commands could be written in a script file and reused every time you want to process your GPS logs, for example:

  1. Download data from the GPS unit
  2. Keep only the data from today
  3. Simplify tracks
  4. Save this to a GPX file
  5. Upload the GPS trace to OSM

…could be fully automated.