Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Tilemaker – DIY vector tiles from OpenStreetMap data (tilemaker.org)
112 points by Doctor_Fegg on July 10, 2021 | hide | past | favorite | 27 comments



This is fantastic! I always strive to host everything on my own domain, or at least proxy things through it, but maps was one of those things that I always had to rely on cross-domain requests for.

And guess what? My next project is map related! I'm certainly going to take this for a test drive. Thanks for sharing.


Map tiles are actually one thing you can still justify bare-metal for, imo. I don't do things with maps professionally but when I did some non-profit stuff involving maps in the last couple of years it didn't take long to figure out that RAM costs made cloud hosting/serving of maps prohibitively expensive, whereas doing it on bare metal with NVME disk arrays was a whole lot more feasible.


You don't need RAM to serve map tiles: Tilemaker and similar can produce the tiles to be served as static files. You can also find pre-made tile sets you can serve.


Are the lua scripts where you'd customise what gets filtered and kept? The demo map on the website shows 'City of Westminster' where I'd expect London, 'Salford' in Manchester, and 'Wolverhampton' in Birmingham.


Yes, exactly. In this case, the script sees that the OSM place tag for all these places is "city", and writes out an object to the vector tile accordingly. So what you could do is adapt the script to look at other OSM tags too (e.g. population or capital status), and write out a different object depending on what it finds.

tilemaker's default Lua script has had lots of great incremental improvements from contributors over the last few years, but half of the point, of course, is that you can write your own script which puts exactly what you want in the vector tiles.


I'm a mapping noob, but I've got a half-planned project which will need web based maps, and tilemaker looks great.

The GitHub readme lists "You want the entire planet" as a reason not to use tilemaker. Why is that? Presumably it's excessive RAM/CPU usage during pbf conversion, or when serving tiles from the mbtiles sqlite file.

But how excessive are we talking? How big a machine would be needed to process a planet file? What tools work better with huge input files?


It might be doable with 256GB. I've tried with my 144GB machine and it's too slow to be feasible. But ultimately I think 128GB will be achievable... I've got a few ideas that could potentially reduce memory usage.

For whole-planet scale, the traditional approach is to load the OSM data into a Postgres database, and then serve vector tiles from there.


The submitter of this issue [1] reported that 64GB of RAM was insufficient to load an 18GB PBF. Considering the planet PBF is 58GB, you're going to need a lot of RAM (and time).

I tried the example tilemaker config (4 layers, zoom 11-14) on the 519MB Australia PBF. My 24 thread PC took a little under 20 minutes to finish generating 773,576 tiles, using about 10GB of RAM.

1. https://github.com/systemed/tilemaker/issues/238


This looks interesting, and might help me resurrect an abandoned project. I think you need to test the home page more on mobile. It's very hard to scroll past the map demo, and if you make the mistake of stopping scrolling with the demo filling the screen, you're stuck! Making the demo smaller on small screens would probably fix it, as would leaving a margin on the sides.


I've been using Tilemaker for a few months, it's been really great. The process script being Lua makes it easy and fast to make updates -- I was able to identify a problem and get the fixed tileset deployed in a matter of minutes. Before, something like that would have taken days. Thank you so much for your work!


Really glad you like it!


- Could the tile format be easily modified to a custom one that I'd develop for my embedded project? (Protobuf is too much overhead on the lowest end).

- How would it compare to converting relevant layers to GeoJSON and then generating with tippecanoe? It seems to have very advanced options for tile size reduction.


tilemaker really is fantastic. I make regular use of it (and tippecanoe) to slice and dice tilesets and it works well and is fast. it feels like it's right on the cusp of being an easyish way of generating vector tiles for the whole planet at a cost below $100. I can't wait for it to get there!


What is a use case example of needing to generate vector tiles on your own server?


I've found that for about any situation where I need to display more than a couple hundred features on a map, vector tiles are superior to geojson/polyline parsing/geobuf: they're parsed very fast and tippecanoe has compression, simplification, feature removal (for low zooms), and tile size limiting features

In my case I use it to display roads that a person has walked/biked, so you can easily accumulate thousands of items to display.


I would like to use map tiles as part of an art project which I'd like to sell at the end. Does anybody know if that's possible with the Open Street Map licence?


Should be.

> You can charge any amount of money you want for any service or data you provide. However, since the data (or service) that is derived from OSM data must be licensed as above, other people may then redistribute this without payment.

The work would be copyrighted "You And OSM Contributors" or something.

See also how to accurately attribute printed materials on the same link.

[0] https://wiki.osmfoundation.org/wiki/Licence/Licence_and_Lega...


Note that it's talking about the data, not the map/art. It's a bit more subtle than most open source licenses. The ODbL distinguishes between the data and other things made with it. From that page:

"What exactly do I need to share?

ODbL draws a distinction between data, (geodata), and works produced from the data, (maps). You are probably distributing data if you are involved in searching, routing, geocoding. You are probably distributing maps if you print paper maps, have a website with map tiles, or are displaying a map as part of a larger work such as a television show, film, advertisement or book.

[...]

- If you correct or extend our data, you need to share your new data.

- If you make a map from our data, you may publish the map itself under any license you like, including commercial. You DO however, have to share the underlying data [...]"


I would add that from my experience, the OSM community is very good at calmly pointing out your mistake and asking you to correct it. I have not seen anyone head for the lawyers immediately.


Art you can mostly do as you want with (you are free to sell it and do what ever) as long as you just use the OSM data, it's only if you are trying to add commericial data to the mix that you can get in trouble.

I do not think there should be any problems.


Definitely! It is one of uses for which OSM data is intended and well fitting.

If you make something I would be quite interested in what you created :)

In case of selling some produced artwork there will be no problem.


What are the pros and cons compared to openmaptiles?


Pros: you don't need to load/maintain/tune a database; the Lua scripting makes it easy to pull features out of OSM tagging; free with no non-commercial restriction (OMT charges $2000 for a one-time commercial-use download of Europe, for example).

Cons: generating large areas require a lot of RAM; you can't just top it up with OSM diffs for the latest data; OMT has more corporate support; you don't get all the wizardry of PostGIS for geometry manipulation.


A little off topic, how do you add houses to OSM on the go?


Vespucci ( https://github.com/MarcusWolschon/osmeditor4android ), Go Map!! ( https://github.com/bryceco/GoMap ).

But sometimes making note with StreetComplete and editing with JOSM at home is more efficient.


Are there any good example UIs for drawing some thing that is almost always square vector graphics on mobile? I have not found a good way to do that, I usually add houses at home with a desktop, it's soo much faster and precise with a mouse for me. Then I add more data with the Streetcomplete app when I'm on the go.


Vespucci (and likely also Go Map!!) has "square angles in this geometry" function that helps.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: