Skip to content
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

[FEATURE] Customization of OpenMapTiles #105

Closed
wipfli opened this issue Mar 2, 2022 · 5 comments
Closed

[FEATURE] Customization of OpenMapTiles #105

wipfli opened this issue Mar 2, 2022 · 5 comments

Comments

@wipfli
Copy link
Contributor

wipfli commented Mar 2, 2022

Is your feature request related to a problem? Please describe.
Problem 1: License. The license of OpenMapTiles is confusing me. I am never sure if I can use OpenMapTiles for a commercial project. I don't know if I have to give attribution to OpenMapTiles if I use for example only a single layer from OpenMapTiles like --only_layers=transportation.

Problem 2: Customization. OpenMapTiles is a great start to make a map. But I don't need all the information it provides (e.g. landcover farmland). And other information is missing (e.g. powerlines). I don't know what is the best way to do this. Fork and edit the base profile?

Describe the solution you'd like
I would like to make a map from ground up where I say I would like to have roads, houses, residential area, forest, water, place names. The building blocks could still use the logic that is already implemented in the base profile.

Describe alternatives you've considered
My current approach would be to comment out all the things I do not need in the base profile and add new layers with my custom information.

Additional context
Discussion #81 is probably related to this issue.

Since the resulting tiles are not compliant with the OpenMapTiles schema, I would like to remove the attribution altogether. I don't know if this is unfair? It just feels wrong to keep linking to OpenMapTiles if the technology used for the map tiles is a different one...

@msbarry
Copy link
Contributor

msbarry commented Mar 2, 2022

I think the only caveat of using a schema based on OpenMapTiles is that you need to carry along the visible "© OpenMapTiles" copyright that links to https://openmaptiles.org/. Any schema that uses any part of openmaptiles (or the basemap profile) needs to carry that along.

For customizing openmaptiles, my thought was:

  • allow more fine-grained control over what gets emitted within layers (like excluding/including only certain tags within layers, or features with certain tag values).
  • adding command-line flags to control logic within openmaptiles schema so you can opt into extra stuff that diverges from the base openmaptiles schema (like opting out of the z13 building merge or different logic for how names are generated)
  • adding a directory to planetiler with "community add-on layers" that you could choose from to add to openmaptiles or use on their own (these would be apache 2.0 licensed, without the attribution requirement unless they are used together with openmaptiles layers

A lot of people are coming from OpenMapTiles, so I think it makes sense to maintain a profile that's compatible with it, but I agree that it would be nice to have a clean-sheet schema built from the ground up with no attribution requirements (similar to osm carto). To collaborate on that I think we want a stable API for configurable schema definitions so that more people can collaborate on that than are interested in writing Java code. Baremaps is also working on something similar, a common config format between the two projects would let us use that with planetiler as well.

@boldtrn
Copy link
Contributor

boldtrn commented Mar 2, 2022

OpenMapTiles is great compatibility wise, there is already a large community and a lot of tools, styles, etc. that support it. So having it as one possible schema would be good.

IMHO: OSM is already providing tags. While they might make writing map styles more complicated, I think it would good to use these tags for a schema. In the long run, this could also enable a similar style to carto-osm and even a style that is equal to carto-osm based on vector tiles. So I think this is something worth considering.

OMT simplifies many tags which makes writing styles easier, but loses many details during that transformation.

@klokan
Copy link

klokan commented Mar 4, 2022

Let me react to the mentioned problems:

Problem 1: License. The license of OpenMapTiles is confusing me. I am never sure if I can use OpenMapTiles for a commercial project. I don't know if I have to give attribution to OpenMapTiles if I use for example only a single layer from OpenMapTiles like --only_layers=transportation.

Yes, you can use OpenMapTiles for your commercial project! The licence is BSD-3 + CC-BY. You can modify, reimplement, use it whole or a part, including commercially - with the condition that you display attribution - exactly as @msbarry mentioned. There are a lot of commercial players using OpenMapTiles, tools, styles, alternative implementations, etc.

Problem 2: Customization. OpenMapTiles is a great start to make a map. But I don't need all the information it provides (e.g. landcover farmland). And other information is missing (e.g. powerlines). I don't know what is the best way to do this. Fork and edit the base profile?

The best practice currently is to modify the config of the schema.

Remove layers you don't want by commenting them out in top YAML - same for unwanted properties in the layer YAML.
Modify the zooms or generalization in the code.
Add your own tags from OSM database which are missing (and if you see value for community, make a pull request 😉 ).

People starting with OpenMapTIles can check the video recording from State Of the Map conference - showing how custom layers are configured: https://youtu.be/bdOjVghEx3E?t=962 and how data are generated.
This is how you can easily add any missing information into the tiles or generate just the data you want/

Planetiler partly uses the OpenMapTiles YAML files already - and discussion started how to adopt the config driven schema - the way that it is easy to understand for people how to modify.

There were discussion on preparing "presets" for the layers.

BTW There are approaches how to shrink the tiles after they are generated to have optimal size for your style.
Performance tests show that if you don't render the features in tiles, the map displays almost equally fast - as unused features in MVT are skipped efficiently. Optimization are typically download time, size of the storage, amount of network traffic.

Very happy to discuss further...

@wipfli
Copy link
Contributor Author

wipfli commented Mar 4, 2022

I played a little bit around with making my own transportation layer and quickly found out that this is really a challenging task. I was able to extract lines from OSM, but then you still have to do motorway line merges, handle tunnels and bridges, and decide on what zoom level to show which feature. So I am really thankful that OpenMapTiles does all this work for me and am happy to show the attribution on the map. I will update the title of this issue...

Thanks for the license clarification @klokan.

Regarding customization, for me a nice way seems to fork planetiler, edit the basemap (add tags and layers as needed), and rebuild planetiler. Like that I can profit from OpenMapTiles updates. For easier git merges after customization of the base map, I think flattening out Tables.java as proposed in #109 is useful.

@wipfli wipfli changed the title [FEATURE] Departure from OpenMapTiles [FEATURE] Customization of OpenMapTiles Mar 4, 2022
@msbarry msbarry added ux and removed ux labels Mar 8, 2022
@wipfli
Copy link
Contributor Author

wipfli commented Mar 15, 2022

Add a custom tag to OpenMapTiles: https://gist.github.com/wipfli/02ba9081b26c3a0cfae054e5c5402fe7

Add a custom layer to OpenMapTiles: https://gist.github.com/wipfli/036aceb4a8008a10253b34ac1ded728f

@wipfli wipfli closed this as completed Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants