OSM SQLite Experiment - Todos and misc stuff

Duplicate addresses are not desirable, at least not in Switzerland.

Rename the table stat_count_keys to stat_frequency_key.

QA: Find non-capital nodes with admin_level

Apparently, swissNAMES3D, with over 400'000 geo-referenced entries the most comprehensive collection of Swiss geographic names, may be added (not imported!) freely to OSM.
See also this osm-wiki page.

Should the Althttpd webserver be used to access the underlying SQLite Database?
The latest source code seems to be here and/or here.
These notes describe how Althttpd was set up on a Ubuntu VPS (Linode) along with Let's Encrypt and Systemd
Update 2024-05-26: It seems that althttpd is not the best web server as it is polling for requests!

fimxe should be fixme.

tag values related to with swisstopo should of course link to the swisstopo page.

Rename the table stat_count_keys to stat_frequency_key.

Another project worth checking out is HEALpix (See this nice webpage of the cosmic microwave background (especially this JavaScript source file) and this webpage (with the HEALPixMesh.js source file (for which I unfortunately don't know the license).
Then, of course, there is also a healpixviewer written in C++ (which requires GLFW, GLM, CHealpix and CFitsio).
There is even a alchemy extension for HEALpix.

The creation of stat_frequency_key_1_tag takes too long, imho.

Search for tag keys or values that contain vertical bars as they're likely to be wrongly imported from a «CSV» file.

Numerical values (such as ele=) should, of course, be stored as number so that they can be naturally compared and sorted.
This goal is somewhat problematic bacause some mappers like to write values such as 1902 m or 413 M. ü M. etc.

Link to most frequent key values (notes://development/OpenStreetMap/tags) does not seem to work anymore.

Find elements that hit the OSM DB limits: ways with 2000 nodes and relations with 32000 members.

How is it possible that there are no less than 38 addresses with the coordinates lat=57.4379550 and lat=10.5327840 (view data when executing the query) and only the addr;housenumber value changes?

When should a relation be used to bind related objects together, and when should the marked as belonging together with tags?

It should be possible to search for shops nearby that are currently open and offer sandwiches or emergeny facilities in the neighborhood.

Take a look at the Nominatim database layout. BTW, Nominatim has a conversion to SQLite function.

Taginfo apparently parses the OSM Wiki (See for example the source file sources/wiki/get_page_list.rb in the github taginfo/taginfo repository).

Way 50157051 and way 50157053 refer to the same object. Is it somehow possible to identifiy such objects?

Use the NOTO font so that all data is displayed correctly.

Jochen Topf: Evolution of the OSM Data Model

In June 2024, the maximum Node Id is ca. 11.9B where are are approx 9.2B visible nodes. I.e 2.7 B node ids are currently invisible or non-existant.
Thus, rather than using a B-Tree index for the node ids, it might be space wise benefitial to index nodes in flat manner (with gaps).

Compare

Data Model

In OSM, not only is everyone invited to participate, they're even invited to invent new tags!
This freedom is heavily used. For example, there is the tag new_donald which I learned is a peak in the New Donald mountain over 2000 feet high and a prominence of at least 30 m.
There is even a OSM wiki page for this key. Surprisingly (or maybe not so much, given that tags can be invented), there are only three nodes with this tag (of which two have the value no).

So, almost everything is fine and tags can be invented at will but there is one thing that's not allowed: mechanical edits. In other words, polluting is ok, cleaning up not so much.

Finding problematic and anomalic data

osmium-surplus features some commands to find problematic and anomalies in OSM data.

Pain points

Some insights of Towards an improved data model for OpenStreetMap include

See also The future of areas
Apparently, Jochen Topf addressed some ideas relating to these pain points in two SotM talks: 2013 - Towards an Area Datatype for OSM and 2018 - Modding the OSM Data Model.

Tags

Types

Tags should probably have a more rigid type system:
Example tagsNotes
BooleansonewayValues are usually yes, sometimes no (but there are also values like yes @ (06:00-17:00))
Numbers ele, width
Enumhighwayresidential, service, track
Textname
Listopening_hoursValues are separated by semicolons

wetland

What is wetland=dry_lake? and wetland=forest?

NHD

How should NHD (National Hydrography Dataset) tags be handled?

The the tags NHD:ComID, NHD:FCode and NHD:ReachCode were wayws with the ranks 95, 91 and 96 in the frequency analysis of June 2024.

See also the NHDPlus Stream Segment (Reach) Attributes

Visualization

OpenGlobus is a TypeScript/JavaScript library for visualising high-precision virtual globes and various geospatial data using WebGL? It’s open source and available on GitHub. (see this (sandbox) example).
The github repository is here

Tiling the sphere

Tiling the sphere
When moving on a map, all movements should be on a geodesic, thus the map does not necessarily point to north. Maybe, such a feature can be achieved using an algorithm as lined out by Volodymyr Agafonkin's Fast Icosphere Mesh.
I should also look at Sandro Maglione's infinite html canvas into Hexasphere.js and Drag-rotate projection in D3 v4
A nice hexagon tiled example is this Grid of OSM GPS Points.

Octrees are subdivisions of the 3d space: each bounding volume is divided into 8 smaller bounding volumes.
This documment describes the specification for 3D Tiles which is an open standard for streaming massive heterogeneous 3D geospatial datasets.
Cesium can stream open standards such as 3D Tiles or WMTS.
glTF 2.0 (an open specification designed for the efficient transmission and loading of 3D content) is the primary tile format for 3D Tiles.
glTF may be used for See also this twitter thread (keywords: Octree/Quadtree, Dynamic BVH, Spatial Hashing, Sweep and Prune).
The current OpenStreetMap database uses Quad Tiles to spatially index coordinates.

Digital Earth

Is it possible to create a digital rendering of OSM data similar to that in the Digital Earth?

Formulas

I am looking for the formulas (or even better an existing javascript library) where I can simulate "viewing onto the earth". The screen then acts like the window and the mouse controls how far the viewer is from the window and in what direction the window looks. Depending on the direction, I can see different parts of the Earth. The formulas (or libraries) calculate the range (coordinates, preferrably in HEALpix or H3) on the earth that are visible.

:-)