Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you want to use vector maps you should also check out Mapbox GL JS. I use their tiles but can use other providers or generate and host your own, which I also do.

I've been making spatial apps for probably 8 years now and moved from Google maps and Leaflet towards vector maps and I don't think I'd ever go back.

https://github.com/mapbox/awesome-vector-tiles/



Yes! Particularly OpenMapTiles has a fantastic docker setup to generate vector tiles for extracts or the whole planet: https://openmaptiles.org/docs/generate/generate-openmaptiles...


Particularly now that it's relatively straightforward to bake and serve your own MVT tiles, so you're not tied into the Mapbox service ecosystem if you don't need any of its other features (and you're happy with the scale / performance of your own tile server(s))


If your data set isn't dynamic you don't even need a tile server. You can generate the tiles with tippecanoe [1] and serve them straight out of S3.

When things get too large you can keep them in the mbtile file and serve them out with an express app.

I've done it in a severless environment which scales well but would get crazy expensive for any high use.

[1] https://github.com/mapbox/tippecanoe


Do you know of any tutorials on how to generate and host own (raster) tiles?


I would suggest starting with something static if you're just starting out. Best way to get a feel for how it works without having to worry about setting up a spatial database.

I used this article myself to learn: https://geovation.github.io/build-your-own-static-vector-til...

There are a couple more articles at the bottom of the awesome vector tiles I linked to before but haven't read them myself.

Reading through the list is good as well because it's a good overview of the whole ecosystem.

Edit: This article also shows a simple way to dynamically serve vector tiles directly from PostGIS. I didn't realise you could do it without the middlewear, time to look into doing it this way!

https://medium.com/nyc-planning-digital/using-the-new-mvt-fu...


Thanks for the explanation on the vector maps! Do you also happen to know how to get started on raster maps, e.g. where to get satellite imagery, prepare and host the tiles?

I am currently interested in it because I want to feed tiles to a GAN to automatically generate maps of an imaginary earth..


Tiling and hosting is the straightforward part, FWIW.

For the reprojection, tile cutting, and overview building in gdal, see https://gdal.org/programs/gdal2tiles.html You can also implement it yourself fairly easily if gdal2tiles.py doesn't have the features you need. The files and directory structure it outputs you can slap into into a static webserver and visualize directly with something like leaflet.

As far as where to get data, that's a whole topic unto itself, but you can start with things like https://earthexplorer.usgs.gov/ for Landsat or https://datagateway.nrcs.usda.gov/ for NAIP or https://scihub.copernicus.eu/ for Sentinel.


I haven't implemented it yet, but [0] looks like a great, detailed tutorial for serving tiles from S3. The article talks about vector tiles, but it should work with raster tiles that you save as .PNG in the same directory structure.

[0]: https://github.com/addresscloud/serverless-tiles




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

Search: