Local nominatim openstreemap with Speed limits - openstreetmap

I'm currently running a local copy of the nominatim maps of openstreetmap on PostGIS.
Is there a way i can get the speed limits into this database so i can return that information as well.
I've found that this data is available when querying openstreetmap but require this to be returned locally
(I'm running our own local copy so i don't exceed there daily limits)
Thanks
John

Probably yes, if you modify Nominatim accordingly. That is, importing speedlimit information (the maxspeed tag) into your database and adding it to query results. But there is no trivial way for just activating this feature.
Note that Nominatim is a geocoder and not made for querying all kinds of information from a OpenStreetMap database. For this tasks there are better solutions like Overpass API.

Related

Why Does Open Street Maps (OSM) use PostgreSQL databases?

Over the last few months, I've been using the openstreetmap-tile-server on GitHub (link here) to render OSM tiles from a Docker container. The tile server uses a PostgreSQL database to store its data. From doing more research into creating my own OSM tiles and my own tile server, a lot of tutorials mention using a PostgreSQL database.
Why is this? Why not use an SQL database such as MySQL instead? What can be gained / is gained from using PostgreSQL rather than a different SQL database for a dataset such as the openstreetmap data?
EDIT: Edited question, to indicate that I'm comparing Postgres to other SQL databases.
Originally MySQL was actually used for the main internal OSM database that stores actual OSM data and is queried and modified via the OSM API. For tile rendering and other purposes the internal raw format is never used though, instead OSM data exported as compressed XML or in more compact binary PBF format is imported into a database schema more suitable for further processing.
Typically this is done with either the "imposm" or the "osm2pgsql" tool, with the PostgreSQL/PostGIS combination as the RDBMS of choice, as it provides the most powerful GIS feature set, at least in the free & open source world.
The main OSM database is an exception as any queries on it are always retrieving data for a rectangular area only, and so GIS extensions are actually not needed, having the coordinates stored as simple numeric data is sufficient in this case. Eventually it was decided to switch that to PostgreSQL, too, to reduce the number of different components to maintain in the openstreetmap.org site setup.
In theory you could also use other RDBMS with GIS support, too, e.g. the SpatiaLite variant of SQLite, or MariaDB/MySQL, but compared to PostgreSQL/PostGIS setup they have their disadvantages:
E.g. SpatiaLite is only good as long as there's only one thread accessing the data, with concurrent access it doesn't scale well at all.
And MariaDB and MySQL only really implement more or less the bare minimum of the OpenGIS SQL specs, end even that only really materialized over the last years. Feature wise both are still more than a decade behind PostGIS at least.
Disclaimer: even I, although working for MariaDB Corp, and having worked for MySQL AB before, in total for over a decade, have always recommended to use PostGIS over MariaDB or MySQL for GIS applications unless someone was bound to MariaDB or MySQL for other reasons already.

Can Nominatim use OpenMapTile's database?

If we're using OpenMapTiles, can we point Nominatim to OMT's database, or are the schemas different?
It is taking us quite a long time to processes the global OSM dataset for Nominatim, but we could save ourselves some time/storage/etc. if both products can share the same Postgres database.
The geocoder Nominatim uses a different database scheme than a tile server. Geocoders and tile servers need slightly different data. Furthermore, for maximum performance, the data has to be pre-processed in different ways. That's why you can't use the same database for both.

How to find a route between two geometries in PostGIS?

I have imported some osm map data into my PostGIS database using osm2pgsql.
These are my tables:
What is the best way to find a route between 2 points in my PostGIS tables?
Thanks
To do route-finding in postGIS you need to download, install, and enable the pgrouting extension.
Once you have a pgrouting enabled extension, then you need to create your graph topology using the pgr_createTopology function, after which you can use route finding algorithms like pgr_bdDijkstra.
See this pgrouting Getting Started guide, as well as the Routing Topology page for a bit more context.

Nominatim reverse geocoding directly over postgresql tables

As I advanced in the title, I would like to make queries directly against my database, instead of using the URL get service provided by Nominatim.
I have my own Nominatim instance running in a Debian machine, and is supposed I'm working over up-to-date versions.
The thing is that I would like to test multiple nodes at the same time in order to get common information or relations between them. As I gave hundreds of tables in my Nominatim db, and doesn't look like querying them is trivial at all, I'm asking for some ideas.
At the end, I will probably just use the tool over way's nodes, so maybe there is a trick or some specific tables where I can match them.

Does PostgreSQL implement Geospatial relationship queries?

My company is looking at different database providers, and how they implement Geospatial queries to get distances from a Lat/Long for a number of records.
We are going to investigate PostgreSQL as a potential database platform.
I've heard that PostGRE implements Geospatial queries. Is this correct?
Is there a good reference somewhere that gives info on the implementation?
It's PostGIS. For reference you have manual, wiki and more...
If you want to spatially enable a PostgreSQL database you can do so with PostGIS, it's compliant with the Open Geospatial Consortium's Simple Features Interface Standard for SQL too.