New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace osmborder with imposm/SQL #1213
Conversation
4a4f877
to
bd28b8b
Compare
bd28b8b
to
87a37da
Compare
edc30a0
to
167d4ab
Compare
Results evaluating commit 438a822 (merged with base 88389f2 as 6640494). See run details. PostgreSQL DB size in MB: 2793 ⇒ 2793 (0.0% change)
expand for details...
|
Currently i have generated a borders line.csv file of the planet and import them into my openmaptiles where I have only the osm data for germany. With your change this not longer working. It will need for every generation the planet.osm.pbf which took much longer or i can't see all borders. But with this changes i think it is possible to get the borders out of the Database where multiple .pbf files are inserted. Which was not possible before, because only one .pbf file can pe passed to import-borders. Maybe the borders of the countries can be pre added to openmaptiles-tools and imported. For local boundaries, the one of the osm data are used and added to the country one. |
That is a curious use case, where you want to see global boundaries but map data only for one country. It seems like this could be accomplished with an overpass query to download all boundaries, and then compress that to a pbf file. Or, you could download the planet file and use osmosis to extract only boundary data from it. In any case, osmborder is no longer maintained, so there is a desire to move away from it in the project. On a side note, there are also some more advanced things with boundaries that OpenMapTiles can't do today, such as name labels on boundaries below the national level that I'm not sure we can do without having the processing logic live in the SQL. |
My goal is that I have no blank tiles on the lower zoom levels, which I had managed by adding https://github.com/lukasmartinelli/naturalearthtiles and additionally I want to show the borders of countries so it has more structure. Maybe you are right and I have done this on a other way. I will check this when I'm home. |
Ok my posts where bullshit 😄 I thought that the borders until z4 are generated from
I will create a PR to add this to the Readme. Now I can appriciate this PR and this workflow because it makes it possible to get the boundary from multiple imported osm files. This was the other reason why I had imported the full planet borders. |
40cc555
to
20920bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i really like this effort, thanks for working on it! For simplicity, lets keep just the needed changes here (i.e. keep tabs as tabs, etc). What else is needed here to change the status from draft to a PR?
I still need to properly test left/right national boundary labels and disputed boundary tagging. This PR Is a pain to test because I need to render multinational areas to prove that I haven't broken anything. I've been using Italy as my example because it has enclave countries, and I also tried to use the Europe extract but I ended up with a full disk. Each of these big renders takes a long time, basically overnight if a download is involved, so there's a longer than usual lag time here :) My latest overnight test (disputed boundary tagging is still not right): |
@Falke-Design I was able to run Is it possible we're running into the same issue as gravitystorm/openstreetmap-carto#4461 ? |
@Falke-Design also, you will need to run |
The problem was, that I forgot to run For testing the layers it would maybe easier |
This is a good idea - though Natural Earth data is used in a number of layers, not just boundary, so this would need to be in multiple places. I've documented this in #1220. |
I have generated all borders of the planet: Download It looks good. The only thing that I saw is that the borders around the continents are not loaded on the low zoom levels. I think that are the marine / sea borders. |
Converting to draft to investigate the issue with low-zoom maritime/country borders. |
Thank you @Falke-Design for the test render! I've run the mbtiles you provided and reviewed the before and after code, and I believe it's actually exhibiting the correct behavior. Here is a client render from the "bright" style: https://openmaptiles.github.io/osm-bright-gl-style/#3/25.89/-12.71 Maritime borders do not start until zoom 4, which is the same as the test mbtiles. Maritime borders are ocean boundaries that are a distance away from each country's actual coastline (typically, 12 miles). Thus, only the land parts of a country's border are rendered at low zooms (0-3), with the water layer used to "outline" the continents. While coastline itself is rendered using the During this review, I identified that I was unnecessarily mapping This PR is now ready for review. |
Awesome work! It looks great! Thank you very much! |
Thank you @ZeLonewolf for resolving an issue that was open more than a year! |
Fixes #1156
Fixes #810
Fixes #1228
This PR replaces
osmborder
, which is no longer maintained, withimposm
mappings and SQL code to generate borders. Key features that were moved into the imposm/SQL layer:osm_id
and aggregating by lowestadmin_level
value so that there's only one copy of ways that are members of multiple relations.admin_centre
andlabel
roles).This will increase the database size slightly because of the limits of what imposm can do, as some of the filtering is done in the SQL layer after importing, rather than being done in
osmborder
.Rendering Samples
Rendering sample from a disputed alpine boundary along the Italy/France border:
San Marino enclave boundary:
Italy maritime boundary: