2

Tell me, please, I need to create an application that without the Internet will load an (offline) map of some area and it will be possible to indicate the path on it with points (points will be anchored to latitude and longitude coordinates).

Tile server is NOT supposed to be raised, the main emphasis is on autonomy.

Files of the following formats were downloaded from the sites:

  1. http://download.geofabrik.de/russia.html
  • russia-latest.osm.pbf - which is suitable for Osmium, Osmosis, imposm, osm2pgsql, mkgmap and others;
  • russia-latest.osm.bz2 - file with the extension (yields OSM XML when decompressed; use for programs that cannot process the .pbf format).
  1. https://data.maptiler.com/downloads/tileset/osm/russia/central-fed-district/
  • russia_central.mbtiles - format -> MBTiles (PBF)

To create a web interface for displaying cartographic materials on the site, it is planned to use the OpenLayers library (or Leaflet, if it will be easier to organize what was conceived) together with Webix.

When setting up the environment for the first time and connecting the specified files, all attempts ended in failure.

Also, the russia_central.mbtiles file using the mbutil utility tried to unzip both in pictures and in PBF, but I don’t know how to force this entire folder with .pbf files to be processed by OpenLayers, I tried many examples from https://openlayers.org/en/latest/examples/ to no avail :(

Tell me how to attach an autonomous kata to the site or how you can do it from the specified files ?!

Thr0TT1e
  • 35
  • 4
  • Easiest way I've seen to do this is host a server locally that serves the tiles to some endpoint. Then its easy to send requests asking for the specific time at different resolution levels. Doing it without the server (internal file IO only) is definitely doable, but I haven't seen support for that in modern libraries. – code11 Dec 16 '20 at 15:52
  • So I cannot find a solution for such a problem. There was an idea to take a local server, but they said it was not provided! Yes, and image files in open form, and not in `.osm` (or any other), do not unload ( – Thr0TT1e Dec 17 '20 at 06:28
  • `.pbf` and `.osm` is raw data. You can't display it directly, it needs to be rendered first. So either use a renderer in order to create tiles (=image files) or download pre-rendered files (e.g. mbtiles) and use those. – scai Dec 17 '20 at 07:10
  • If it doesn't bother you, please tell me how you can process `.osm` or `.osm.pbf`? As for the `.mbtiles` files, I have such an archive, but the specified libraries do not read it. Using the `mbutil` utility, I was able to unzip it, but instead of `.jpg` and `.png` pictures it contains `.pbf` ( [site](https://data.maptiler.com/downloads/tileset/osm/russia/central-fed-district/) ). That is, they also cannot be screwed on a straight line ( – Thr0TT1e Dec 18 '20 at 08:00

1 Answers1

0

Use QGIS 3.x, select the "Generate XYZ tile" (MBTiles) option and generate tiles for your region.