Published by breki on 05 Jan 2010 at 10:59 pm
Kosmos: Querying Data
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:
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:
- Download data from the GPS unit
- Keep only the data from today
- Simplify tracks
- Save this to a GPX file
- Upload the GPS trace to OSM
…could be fully automated.



igorbrejc.net » Maperitive: First Release on 12 Mar 2010 at 17:47 #
[...] Querying: you can now use the same query “language” used in rendering rules to look for stuff on the maps. [...]