0

I am working on an project which is completely offline (windows), the frontend is in react where i display a base map using react-leaflet library, and i serve the base map through a node backend from XYZ directory files stored locally. I'm trying to find a better solution to serve the map files for my frontend. The XYZ directory files stored locally are huge and its a pain when my end user need a new map displayed in the frontend. As of right now, i create new maps using QGIS as XYZ directory and send it to them, and they would have to copy the entire folder to the project directory. I'm looking for a solution where they can upload the map file (like osm or any other readily available format) from the frontend and the node backend do the conversion. This way my clients don't have to access the project directory directly.

So i guess what i am looking for is a solution to convert osm file to mbtiles format or xyz directory files format in my node backend so that it can be served to my react app. Is this possible ?

PS: I'm a beginner and new to GIS.

I tried using tilerser-gl and i was able to use mbtiles, which is a better option than xyz files because of smaller size. But i would rather have the user download the osm file from geofabrik and upload it from the frontend whenever they need a new map.

2
  • Is this just for the basemaps with OSM data? Do they need to change often? Or is this including user edited data as well? Commented Dec 11, 2023 at 17:00
  • Yes it’s just for the basemaps. But I would need to use satellite imagery in my project and I just read somewhere that osm data can have only regular maps with line and polygons. Is that correct? What could be a solution if I need satellite imagery for my base maps and can’t use osm file ? Commented Dec 12, 2023 at 19:19

1 Answer 1

0

If you're wanting to generate your own map tiles, check out planetiler, which is specifically designed for generating MBTiles (or similar container formats) for the planet from OSM data. This takes some rather significant resources, but it's possible if you really want to do this yourself and understand what schema you want.

You can also check out protomaps for a readily downloadable version if the tile schema suits you.

Finally, you could also go with a commercial offering like Stadia Maps or Mapbox (full disclosure, I'm a cofounder of Stadia Maps).

I see in your comment that you're also looking for satellite imagery. OSM indeed is just the "vector" info on the planet in database form (roads, points of interest, etc.). For imagery, the only free options are relatively low resolution. If you want reasonably up-to-date high-res cloudless imagery, you'll probably need to pay either for a hosted solution or buy imagery from a vendor like Maxar, SI Imaging, Airbus, or Planet. Buying imagery is not cheap, but could make sense for an offline solution if you have a fairly small area of interest.

Not the answer you're looking for? Browse other questions tagged or ask your own question.