Live data from Hacker News

Protomaps – A free and open source map of the world

protomaps.com

11–20 of 169 posts

Re: Protomaps – A free and open source map of the world

#11

For me the most interesting part is “PMTiles”: > PMTiles is a single-file archive format for pyramids of tiled data. A PMTiles archive can be hosted on a storage platform like S3, and enables low-cost, zero-maintenance map applications. > PMTiles is a general format for tiled data addressed by Z/X/Y coordinates. This can be cartographic basemap vector tiles, remote sensing observations, JPEG images, or more. > PMTile…

Pmtiles are the vector counterpart to Cloud Optimized GEOTIFF (COG), allowing for efficient usage of mapping info from clients when the server supports a http range request.

Previous iterations of this on the vector side have either been a ton of small files(pbf) or a large file that needed a front end to serve the individual tiles (mbtiles).

At this point, you can take an OSM dump and convert it to a country level basemap in minutes on a stout machine, or hours for a continent, which you can then self host on a plain old web server with a custom style sheet.

Re: Protomaps – A free and open source map of the world

#12

For a while I've wanted an SVG map with a JS API where you can input latitude and longitude and show the point on it. I hope this will do that! The reason I want that is, almost all humans have a GPS device in their pocket. You could easily get your approximate location from this, even without cell service. Implementation could be a PWA.

Your best bet for this is something like OsmAnd or organic maps, which download countries worth of osm data and make it available offline.

The amount of map data for any reasonable area is going to be too large for a PWA, though it would technically be possible to do with existing map viewers and this format. (Eg maplibre or leaflet)

Re: Protomaps – A free and open source map of the world

#13

For a while I've wanted an SVG map with a JS API where you can input latitude and longitude and show the point on it. I hope this will do that! The reason I want that is, almost all humans have a GPS device in their pocket. You could easily get your approximate location from this, even without cell service. Implementation could be a PWA.

But protomaps is still getting the map data from a CDN, do you mean that the map data would be cached on the device?

Yes. With the tradeoff that it would be radically simplified.

Re: Protomaps – A free and open source map of the world

#14

For a while I've wanted an SVG map with a JS API where you can input latitude and longitude and show the point on it. I hope this will do that! The reason I want that is, almost all humans have a GPS device in their pocket. You could easily get your approximate location from this, even without cell service. Implementation could be a PWA.

Your best bet for this is something like OsmAnd or organic maps, which download countries worth of osm data and make it available offline. The amount of map data for any reasonable area is going to be too large for a PWA, though it would technically be possible to do with existing map viewers and this format. (Eg maplibre or leaflet)

Thanks. I'm OK with a single layer just showing the outlines of coastlines and regions, including the names of regions. I think a suitable simplified world map could fit all this in SVG.

edit: Initially underestimated so did some calculations below

Key Data Points for Estimate of SVG Size

  - Radius of Earth: 6371 km  
  - Surface Area of Earth: 510e6 km^2  
  - Approximate Number of Countries: 250  
  - Land Area of Earth: 29% of Surface Area = 150e6 km^2
Corrections and Estimations Based on Average Country Size

  - Average Land Area per Country: 150e6 km^2 / 250 = 6e5 km^2  
  - Country Closest to Average Size: Ukraine, with 603550 km^2, or roughly 6e5 km^2  
  - World Resources Institute Measure of Ukraine Coastline: 4953 km, or around 5e3 km
Assumptions for SVG Complexity

  1. Only coastlines matter for the paths.  
  2. Resolution set at 10 meters.
SVG Data Calculations and Estimates

  - Coastline Points for Average Country:  
    - 5e3 km = 5e6 m  
    - Equals 5e5 X,Y points (at 10m resolution)
  - Total Points for All Countries:  
    - 250 countries * 5e5 points = 1.25e8 X,Y points
  - Storage Requirement for Each Point:  
    - 6 figures per coordinate + delimiters = roughly 15 bytes  
    - Total Storage = 1.25e8 points * 15 bytes = ~1.875e9 bytes or about 1.875 GB
Even with a simplified approach, we're looking at an SVG that'd be almost 2 GB, just for coastlines at a 10m resolution. Definitely some hefty complexities in play here.

What about 1000m resolution? 20 megabytes. Much more achievable.

Re: Protomaps – A free and open source map of the world

#15
post #3

Usually .com domains were used by commercial entities, and protomaps.com seems like it might have cost some money. I don't fully understand LLC except that they protect owners from company liability. Just trying to figure out what the goal for this company is.

> Usually .com domains were used by commercial entities

I must disagree. Even in the early days, even though that was the intended use of the .com TLD, it has always actually been used as the default TLD instead of the .net TLD.

I really hate it, but whenever I see a .com I have never, and will never assume it has some sort of commercial angle.

Re: Protomaps – A free and open source map of the world

#16
post #10

If anyone else was curious, their sample OSM derived PMTile file (protomaps-basemap-opensource-20230408.pmtiles) is 103GB. https://docs.protomaps.com/basemaps/downloads

It's 107 GB now.

It would be great to be able to download only diffs and apply them to a daily, weekly, monthly baseline.

Re: Protomaps – A free and open source map of the world

#17
post #6

I lurk in an online community of journalist coders and some folks there are excited about PMTiles as cost-saving way to host your own custom-styled map tiles. See, for instance, "How The Post is replacing Mapbox with open source solutions" https://www.kschaul.com/post/2023/02/16/how-the-post-is-repl...

Sounds like a neat community. Can you share where it is?

Re: Protomaps – A free and open source map of the world

#18
post #3

Usually .com domains were used by commercial entities, and protomaps.com seems like it might have cost some money. I don't fully understand LLC except that they protect owners from company liability. Just trying to figure out what the goal for this company is.

> Usually .com domains were used by commercial entities I must disagree. Even in the early days, even though that was the intended use of the .com TLD, it has always actually been used as the default TLD instead of the .net TLD. I really hate it, but whenever I see a .com I have never, and will never assume it has some sort of commercial angle.

The head-scratcher is more like: If it's a non-profit, they (and I) would have expected a .org, which, unlike .net, has been used consistently over the years. But I get your point in general.

Re: Protomaps – A free and open source map of the world

#19
post #3

Usually .com domains were used by commercial entities, and protomaps.com seems like it might have cost some money. I don't fully understand LLC except that they protect owners from company liability. Just trying to figure out what the goal for this company is.

From what I can tell, it's a for-profit company for a single dev that is attempting to get by through nothing but GitHub Sponsorships.

Said sponsorship is a requirement for using the pre-hosted files for commercial uses in a SaaS-like manner.

But some of the wording in the faq is a bit confusing. E.G. There's a whole section about "Why don't you just sell plans for the hosted API?" right after detailing how to sign up for said plan for the hosted API.

Post reply on HN