protomaps / basemaps Goto Github PK
View Code? Open in Web Editor NEWBasemap PMTiles generation and cartographic styles for OpenStreetMap data and more
Home Page: https://maps.protomaps.com/
License: Other
Basemap PMTiles generation and cartographic styles for OpenStreetMap data and more
Home Page: https://maps.protomaps.com/
License: Other
starting point: #47 (comment)
When trying to execute this command:" mvn clean package "
I get this error:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project protomaps-basemap: Fatal error compiling: error: invalid target release: 16
I solved this after upgrading to Java 17.
Now works as expected.
https://www.openstreetmap.org/way/87991871 is a way which is tagged as shop=supermarket
. The protomaps basemap includes nodes with this tag in the POI layer, but ways seem to be missing, at least the above supermarket does not show up in the basemap (https://protomaps.github.io/PMTiles/?url=https%3A%2F%2Fr2-public.protomaps.com%2Fprotomaps-sample-datasets%2Fprotomaps-basemap-opensource-20230408.pmtiles#map=17.43/47.546268/7.952184)
@nvkelso do you plan to fix this in #47?
Thanks for all your work @bdon and @nvkelso. Will be an awesome basemap!
it seems that https://protomaps.github.io/protomaps-themes/base/dist/index.js
is missing (and other errors cascade from that)
Hi,
I try to download the Basemap Layers (Free datasets), but the link points to http://localhost:3000/docs/frontends/basemap-layers,
so I can't download them.
https://protomaps.com/blog/serverless-maps-now-open-source
Would it be possible to add natural:beach to the map?
examples: NE version, git SHA of basemaps repo
In the v3 schema we introduce many more business listing POIs at zoom 15+ (earlier in the data, later in the style). Right now they are text only labels, but soon they could also include artwork icons.
We could consider a config option to:
This would reduce the visual noise at this zoom – which is now more comparable to Apple Maps or Google Maps while before it was more for a pure data viz use case.
At z15, buildings that do not touch should not be merged. However, they are in some places.
Example in Monaco:
Good:
https://www.openstreetmap.org/#map=19/43.74036/7.42210
Bad:
http://[::]:8080/data/basemap/#19/43.7403607/7.4220951
java -cp target/*-with-deps.jar com.protomaps.basemap.Basemap --input data/sources/monaco.osm.pbf --output data/basemap.mbtiles --download
docker run --rm -it -v "$(pwd)/data":/data -p 8080:8080 maptiler/tileserver-gl -p 8080
Right now we only consider the height if tagged with meters, we should do something reasonable with levels as well.
example in Bellevue, WA: https://www.openstreetmap.org/way/91367308
Feedback: The one thing that really jumps out at me is all cities disappearing and reappearing as you go from z5 to z6. My guess is this is something like transitioning from Natural Earth to OSM gives slightly different coordinates? (which is enough to trigger the flash because MapLibre treats it as a new label if the coordinates aren’t very close between zoom levels)
I see 2 different solutions:
Tile size is implicated because the NE places at low zooms now include only ~ 25 name localizations, versus the hundreds in OSM.
So with option 1 you'd need to introduce an allowlist of name localization (at all or just low zooms).
With option 2 the join already works between OSM to NE, so we'd also add it the other direction in the NE function.
There are an unknown number of places in NE that aren't in OSM or aren't part of the data join, probably in the order of 2%.
Generally I lean towards option 1 because it simplifies the Places layer logic, but the OSMNames logic would need to grow more complex (which should happen anyhow).
Protomaps is great. The idea of compiling all the map data, at any zoom, into one file is awesome. Being able to switch map styles by loading different sources and different themes is compelling. The chief issue is standardizing the layer structure.
Right now, the easiest way to build pmtiles from OSM data, is to download a .pbf, convert it to a .mbtiles file with tilemaker and the default layer, schema, and then use go-pmtils to convert that to a .pmtiles. Unfortunately, this approach is not compatible with protomaps-themes.
The following schema, config-openmaptiles.json,
process-openmaptiles.lua with tilemaker builds mbtiles from osm.pbf that can be converted to pmtiles.
tilemaker --input osm.pbf \
--output osm.mbtiles \
--config config-openmaptiles.json \
--process process-openmaptiles.lua
pmtiles convert osm.mbtiles osm.pmtiles
Bases on this comment here, it seems that protomaps-themes layer structure is not compatible with openmaptiles layer structere.
This raises the question: If the goal is standardization, why not embrace the OpenMapTiles?
If this schema functionality doesn't meet the functional requirements of Protomaps, what are those requirements?
And more importantly, what are the build instructions for created protomap-theme compatible pmtiles?
Instead of all global (OSM Water, NE) features appearing at 0,0,0, every tile in a non-planet build should be intersected with a passed AOI. The AOI can be passed on the command line via GeoJSON.
I believe this is possible using only the public Planetiler APIs like postProcess
, but it will require some tricks to make it efficient.
Hello! Thanks for making this project, it seems awesome! I recently saw this article and I'm trying to reproduce it.
I'm trying to set up a project using protomaps and MapLibre GL.
I've generated a .pmtiles
file through OpenMapTiles
and go-pmtiles convert
, and the file seems to contain the correct content according to the inspector tool:
However, when I switch out the MapLibre GL style to use my .pmtiles
file, the map doesn't render anything in the region:
I didn't see any examples in the doc of using both the pmtiles
extension and protomaps-themes-base
, but are they expected to work together?
My full repo can be found here, and the
code in question is here
Thanks in advance!
Right now all road casings are rendered just before the road type they belong to. This leads to some weird effects at intersections between different road types (minor-medium/medium-major ...), where it appears that the higher class road passes above the lower class road, instead of being just a regular intersection.
I'm not a cartography expert, but I think road casings should all be rendered before (below) any of the roads. I will propose a PR later today, if that's ok.
In the closed PR, @tyrauber noted that the sports
, craft
, and historic
tags could be exported in raw form as well, and added to the coalesce of values in the exported pmaps:kind
property.
There's another interesting idea here which is to always pass thru the raw values of the tags in a new pmaps:tag
property – since the pmaps:kind
property is an gated allowlist of properties (else "other" when not in the allowlist). Adding this would facilitate data-driven icon lookups based on single property instead of a list of properties.
From the original PR comment:
Hi @nvkelso, it looks @bdon has already addressed my suggestions on main!
stars
: point_feature.setAttr("stars", sf.getString("stars"));
pmap:tag
is not necessary because tag values can be accessed by key name: .setAttr("amenity", sf.getString("amenity"))
.setAttr("shop", sf.getString("shop"))
.setAttr("railway", sf.getString("railway"))
.setAttr("cuisine", sf.getString("cuisine"))
.setAttr("religion", sf.getString("religion"))
.setAttr("tourism", sf.getString("tourism"))
.setAttr("iata", sf.getString("iata"))
It's missing the sports
, craft
and historic
tag. Sports and craft are probably unnecessary, but for tourism implementations, I'd probably add historic.
All in all the implementation on main is more flexible than the approach I came up with. 👍 Closing.
Originally posted by @tyrauber in #32 (comment)
To get consistent min_zoom values between NE and OSM data we do a live data join. But that data join is always reading in NE data instead of just once.
The current config doesn't seem to noticeably affect build time so it's probably OK as is?
But it's better architecture to only load it once on project init. We can file a followup issue for that?
Originally posted by @nvkelso in #93 (comment)
Hi, I love pmtiles as it works fast and easy. I need a map of Germany and on photomaps.com you can only download a world map (which is way to big in file size) or smaller local maps.
Whats's the best way to get a map of a country like Germany. I just need the normal basemap with street names with out POIs. Thanks!
Would it possible to mark railaway tunnels as tunnels or underground structures? Possibly by setting pmap:level like it is done for road tunnels.
Currently in OSM they have "layer" set to -1 and "tunnel" to "yes".
The earlier (and smaller value) zooms from Natural Earth from zooms 0-6 are lost on zoom in.
For New Delhi in India this means the locality which had a pmap:min_zoom
of 2.0
reset to 8.0
, which compares unfavorably to Delhi the region
that has a pmap:min_zoom
of 4.6.
As a result the New Delhi locality
is collided in error by the Delhi region
label for several zooms from 7 until room opens up.
A solution is to do a data join in the places layer for locality
features between NE and OSM, and prefer the NE min_zoom
values.
Hi,
I am trying to create pmtiles from a osm.pbf file (from Geofabrik).
I tried two ways:
tippecanoe -o output.mbtiles -zg --drop-densest-as-needed --extend-zooms-if-still-dropping input.osm.pbf
pmtiles convert input.mbtiles output.pmtiles
osmium export data.osm.pbf --format geojsonseq > data.geojson
tippecanoe -zg -o data.mbtiles -f data.geojson
pmtiles convert data.mbtiles data.pmtiles
Here is the html code.I am using a protomaps basemaps style (the 'light" one) for MapLibre GL JS.
albania.txt
Using the same html code,when I use pmtiles downloaded from protomaps web site,everything works fine.
What am I missing?Is this something I should do when convertin from one file type to another?
Thanks
currently always 1 if >0
Hi and thanks a lot for your work on Protomaps. What an exciting project!
I was wondering about the self hosted deployment of .pmtiles you describe here
The steps worked very well. Thanks to the great documentation, I was able to set up world wide vector tiles with CDN in a couple of hours, which is just amazing.
Now I'm able to consume my own vector tiles in Maplibre GL, with the styles provided by 'protomaps-themes-base'. However, following the examples I still see a dependency to the fonts to https://cdn.protomaps.com/fonts/pbf/{fontstack}/{range}.pbf.
I guess if I would want to be completely independent, it would make sense to host those fonts on my own too, right? If so, it would be great to have that step documented too, which I'd be happy to help with.
Also I was wondering why you define the used font as NotoSans-Regular
instead of Noto Sans Regular
which seems to be the default in the vector tile spec.
Thanks!
motorway_links and primary_links are present on OSM maps but missing when a freshly generated map is viewed using PMTiles viewer.
In protomaps-basemap-opensource-20230408.pmtiles primary_links are present but motorway_links are not.
The screenshots are from the freshly generated map viewed using PMTiles viewer.
https://www.openstreetmap.org/way/454442266#map=18/-38.08778/145.32274
https://www.openstreetmap.org/way/454442266#map=15/-37.6831/144.9850
Sorry to bother again guys, this is just something that might benefit others.
The landuse_pedestrian needs the following added in the layout, currently it only checks for a "footway".
Also needs to be moved below the "water" in the layout so that footbridges would stay afloat.
[
"==",
"highway",
"pedestrian"
],
[
"==",
"pmap:kind",
"pedestrian"
]
https://github.com/rapideditor/country-coder provides a complete, fast and purely geometric dataset we can use in-memory for java to determine locale for cartographic logic.
Tilezen's roads
and buildings
layers are "intercut" with landuse: the landsuse tag is transferred to buildings and roads on top, to enable styling those features with better contrast.
Though the tilezen spec lists out general design, there are some abstract issues to solve and some implementation details:
kind
values) participate in intercutting? Is there a priority of kinds
? What happens if a road passes through an area with multiple overlapping landuses? We can only assign one landuse_kind
to each segment.parks
and parking
but I choose not to visualize parking
polygons in my style, A road that passes through an overlapping section will have landuse_kind=parking
instead of landuse_kind=park
Implementation issues:
Hi,on this blogpost I can read:
"A global vector tile dataset based on OpenStreetMap data. The organization of layers and tags is described at Basemap Layers, and open source styles are provided for Leaflet as well as MapLibre GL vector rendering."
https://protomaps.com/blog/serverless-maps-now-open-source
So,this repository contains both for Leaflet and Maplibre GL styles,since in the front page is says only styles for MapLibre GL?
Any explanation would be helpful,thanks
This needs to be done in a general way i.e. without regards to localization, as the names may be different lengths in different languages. Think about a slimmed down version of the https://github.com/migurski/Dymo approach.
For example, Montana at zoom 6 from Natural Earth shows up fine. But zooming into 7 and OSM the feature isn't included in the boundaries
layer in error.
Zoom 6:
Zoom 7:
Instead of testing the network value for contains("I ")
, it should be startsWith("I ")
, else it catches networks like HI XXXX
in error. My bad as a newbie to Java but easy to fix.
For example:
if (shieldText.contains("US ")) {
shieldText = shieldText.replaceAll("US ", "");
networkVal = "US:US";
} else if (shieldText.contains("I ")) {
shieldText = shieldText.replaceAll("I ", "");
networkVal = "US:I";
} else {
// This should be replaced by walking the way's relations (which reliably set network)
networkVal = "other";
}
In order to make correct casing ordering on complex overpasses, we may need to change Tilezen - Tangram relied on sort_rank
with casings to overlay an arbitrary number of layers. For MapLibre GL we have sort_key
in the style but that only works per-layer: casings needs to be drawn as separate layers.
In my experience the only solution is to have a fixed set of layers each with their own filter e.g. layers -2, -1, 0, 1, 2. @nvkelso
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.