[JT] Jochen Topf's Blog
Wed 2026-06-03 17:14

Spyglass Improvements

Whenever I have some time, I keep improving OSM Spyglass. A very useful addition is that Spyglass now shows suggestions for the key and value filter fields. Spyglass gets possible keys/values from the data currently loaded and will show all keys/values matching what you have typed so far.

There are many other small improvements in the UI, one is a new menu option in the location control: Switch lat/lon. Very useful when you have a system that shows the coordinates the other way around from what OSM Spyglass expects (for instance QGIS). Just copy and paste the coordinates, Spyglass will jump to the wrong location, but one click later you are at the right spot.

There are many internal changes also. There is support now for storing OSM object attributes (version, changeset, timestamp) with the data. (No support for user ids or user names so far.) Attributes are currently not enabled on the version running on spyglass.jochentopf.com to save some disk space and import time, and they are not shown in the UI anyways. More work for the future…

There are also plenty of changes with the database tables, how I am organizing the data internally. I am trying out various formats to minimize storage and make queries more efficient and/or easy to use. The biggest change is that I switched from using JSONB for the tags to that old classic, the hstore format. JSONB and hstore are quite similar for what we are doing here, but there is one big difference: It is possible to create a GIST index that combines geometry and tags when using hstore making queries with key/value filter somewhat faster.

Another area I have been experimenting with is how to detect and display “unusual data”. Unusual data in this case are things like ways that contain only a single node, or ways having duplicate nodes in them, relations without type tag or without members and so on. So we are talking about some low-level errors in the data, that I want to detect and show to the user in a useful way, so that they can figure out why some object is not showing up properly in the map. Single-node ways, for instance, would usually not be visible, because you can’t have a line with only one point in it. So this case is detected and the way shown as black point with an orange center. When selected, the way is shown with a message “Way contains only a single point!”.

Some other “unusual” cases are currently detected and the information is in the database but now shown yet.

Tags: openstreetmap · spyglass