Complete overhaul of country grid generation algorithm #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extended the SQL, so that most of the simplification necessary to get to a country table of a managable size can be done with some simple SQL. This makes use of the new ST_CoverageSimplify function from PostGIS. IT allows to simplify boundaries between countries without loosing coverage. Needs PostGIS 3.4, which is available in Ubuntu 24.04.
The data file on nominatim.org already has a new country grid generated with this algorithm. With the simplification the file size has shrunk from 41MB to 15MB, and the table size from 49MB to 27MB. All this despite the fact that accuracy of boundaries has improved quite a lot in the last 5 years in OSM.
For more information see also the README.