Better HN
topnewbestaskshowjobs
Log inSign up

hyperknot

1,249 karma · joined Aug 14, 2015 (11y ago) · 220 submissions

founder of MapHub: https://maphub.net/

personal website: https://hyperknot.com/

email: zsolt@maphub.net

Submissions

comment 2y ago · link · parent

What you need is a bike specific style for OpenMapTiles schema. Maybe you can find it on GitHub. Once you have the style, you can use Maputnik to tune it to your liking like on this link: https://maputnik.github.io/editor/#0.84/0/0

comment 2y ago · link · parent

Thank you so much for your donation, it's appreciated!

comment 2y ago · link · parent

They are providing the building blocks for making a self-hosted vector tiles server, they don't actually host the tiles.

comment 2y ago · link · parent

Yes, you need a dedicated server with 128 GB RAM to generate the tiles. For hosting the tiles, you can use anything with 300 GB disk space, CPU is not important.

comment 2y ago · link · parent

Yes, exactly, it's to save space. For example there is one such tile for "ocean", which covers 70% of earth.

In total, there are 271 million hard links. So out of 300 million files 271 are hard links!

The file system limit is 64k hard-links for the same file, so I have to handle the case when it's reached and then start a new file for the next 64k.

comment 2y ago · link · parent

Thanks, I've thought about it and rewritten the whole donations / sponsorships / support plan section. What do you think?

comment 2y ago · link · parent

That's great to know! I know of one story where someone got terminated on Hetzner because of the bandwidth but it turned out he was also running a Tor node.

comment 2y ago · link · parent

Someone making a Docker image from this. Instead of using Fabric's commands like c.sudo('git clone ...') it'd use the RUN commands.

I think it would be quite a straightforward task to transform it into a Docker file. I'd be happy to link to it on GitHub.

comment 2y ago · link · parent

This is totally customizable and the house numbers are already present in the original data, it's just not displayed in the default styles. You can customize the style by using the Maputnik editor, house numbers are visible in the "Inspector" view. https://maputnik.github.io/editor?style=https://tiles.openfr...

comment 2y ago · link · parent

Thank you very much, and also thank you for your donation!

comment 2y ago · link · parent

Yes, I was thinking about that, it might actually be a good idea. Provide a premium service with SLAs, while providing the SLA-less service for free, with two pool of servers.

comment 2y ago · link · parent

So Protomaps is a really full stack map platform, they are competing with kind of like 3-4 projects at once:

- There is the Protomaps schema. It's competing with OpenMapTiles and Shortbread (https://shortbread-tiles.org/)

- There is the Protomaps file format. It's competing with MBTiles and say Btrfs images in OpenFreeMap.

- There is the Protomaps styles. It's competing with OSM Liberty and OSM Bright styles (https://github.com/maputnik/osm-liberty)

- There is the way to host the tiles, on CloudFlare workers, range requests, etc. It's competing with MBTiles servers or OpenFreeMap's nginx servers.

About getting abuse, how do you imagine it gets abuse? It's a static file showing OpenStreetMap data.

I mean traffic is the only thing what can be a problem, but I think Hetzner should be good till 30-100 TB per server.

comment 2y ago · link · parent

PMTiles could come up with a version in the future where instead of one 90 GB file, they have 9 thousand 10 MB files. That would work well I believe.

comment 2y ago · link · parent

Do you think it'd be more clear to only accept donations on GitHub Sponsors and only offer actual support plans on the website? I mean actual email support, helping companies migrate their existing map stack to OpenFreeMap.

comment 2y ago · link · parent

I definitely not want to charge for requests, that's the founding principle of this project.

And the risk of this project is largely mitigated by offering the full repo as open-source, so you can always self host this if needed.

comment 2y ago · link · parent

Thanks a lot for the offer, I'll definitely reach out!

comment 2y ago · link · parent

So a full planet OSM extract is about 300 million binary files, in total about 90 GB. The most popular ways to store it:

- MBTiles - an SQLite file, each file is a row in a table, you need a server to serve it.

- PMTiles - a single file, optimised for serverless usage.

- Extract them into a directory, which in practice should be on a partition image. This is the approach I choose.

I tested ext4 and Btrfs and I choose Btrfs. The reason is how ext4 and Btrfs handles inodes. Btrfs handles inodes so much better compared to ext4, it doesn't allocate them at start and also allows putting tiny files right with the metadata.

Because here the average tile size is only 405 bytes, most of the tiles can actually stored with the Btrfs metadata block. From the latest run:

Btrfs data is 51.57GiB

Btrfs metadata is 84.37GiB

comment 2y ago · link · parent

I explained a bit about PMTiles in this comment: https://news.ycombinator.com/item?id=41636376

In summary, on a cold start (so now when it's on HN it might be totally meaningless), the following page loads in like 8-10 sec for me: https://pmtiles.io/?url=https%3A%2F%2Fdata.source.coop%2Fpro...

Technically why it's slow is entirely on CloudFlare, so I can only guess. But probably they are not mirroring files of this size across their datacenters / servers. I don't know how their public buckets hosting is done, but it's definitely very slow.

OpenFreeMap on the other hand seems almost instant for me.

comment 2y ago · link · parent

Thanks! I don't know where you'd be able to get property boundaries, I guess it's usually not open-source / public data? Probably depends on the country / city.

comment 2y ago · link · parent

Round Robin DNS. The browser selects the best server, based on ping or some other internal metric.

Also thanks for the donation!

comment 2y ago · link · parent

Bunny is also $10-$60/TB/month.

I believe Hetzner should not have any problem with using 100 mbps out of the 1 Gbps on their servers. That's 30 TB/month for free, per server. It'd be $300-$1800 per month on Bunny.

comment 2y ago · link · parent

I'll write a detailed blog post for that, definitely.

Basically Protomaps / PMTiles allows you to do this serverless, but it has it's downsides.

There are two ways to use PMTiles with Cloudflare:

- Putting the file in a public bucket and use HTTP range requests.

- Deploy a worker to access it.

For the range request version, you can test PMTiles here: https://pmtiles.io/?url=https%3A%2F%2Fdata.source.coop%2Fpro....

It loads in 8-10 sec for me on a cold start. Of course it gets faster if many of us try to request it at the same time, but if you check it once per day for example, it'll be really slow, up to 10 sec.

Compare that with OpenFreeMap here: https://openfreemap.org/quick_start

It's near instant for me. (I know it's not full screen but you can make the app and then see how it's in full screen).

For the Cloudflare Workers version, I didn't find any publicly available full planet test, so I don't know the performance, but Workers are not free. It might not matter for a small project, but the $0.30/million requests per month can easily add up if your project gets popular.

In terms of OpenFreeMap, hosting it on a Cloudflare Worker would be prohibitively expensive.

comment 2y ago · link · parent

Satellite images are definitely expensive, they are by far the biggest cost for MapHub. I spend more on satellite images per month than on servers. I couldn't find a high quality satellite images from free sources.

comment 2y ago · link · parent

At Hetzner, the bandwidth is unlimited in theory. In practice, there are stories of terminating accounts of those who used too much.

I don't think this project will ever make $2k per month. TBH, I'd be happy it it ever reaches $200 per month. I have to be very careful about what hosting providers to use and CDNs are out of the question.

comment 2y ago · link · parent

Thanks a lot for your words! I'm also curious whether the donations will be able to cover the bandwidth costs. Currently I'm paying for 3 dedicated servers at Hetzner and getting a total of $11 per month from donations.

comment 2y ago · link · parent

Currently I'm paying for 3 dedicated servers at Hetzner and getting total donations of $11 USD per month.

Making this automatic might not be easy, but I might do it one day, it might help with the donations.

comment 2y ago · link · parent

CloudFlare buckets don't support indexing / directory listing, so you need to get the exact URL. To help with this, here is a file listing the content of the bucket: https://btrfs.openfreemap.com/files.txt
12345
8