Mapsui: SQLite db with offline map - how to

Created on 16 Sep 2019  路  8Comments  路  Source: Mapsui/Mapsui

Hi,

related to #697 the question is: how to create (fill, the same structure - clean and upload new data) the database (world.mbtiles) with any map?
What is the solution, sample, tool, good recipe?

For example (just ex., I know it's not fully acceptable) if I choose some area in OpenStreetMap (f.e. Spain) and I would like to have all possible tiles (in specific zoom range) then what I need to do to have this offline map in the db?

Best Regards,
Lukasz

question

All 8 comments

A short search on Google shows, that Mobac can do this. See here.

Another one is Maperitive.

Thanks! I'll look closer them asap.

My first thought was that this is your individual, own solution and I thought that only you know the answer to my issue.

I was thinking more about some C# algorithm which I could use in my code.

Where do you get the tiles from?

It isn't very difficult to create the tabels for the MBTiles SQLite file. You could find the specification in the internet. There is one table for the common information about the tiles in this file and a second table, which contains the blobs for zoom level/column/row.

The plan is: in the app (C#) with Mapsui, I would like to create a feature for creating an offline maps by the user, f.e. based on OpenStreetMap or any layer in GeoServer.
User opens the big (world) map in the app (via Mapsui), select some area in it and saves it in db as offline map for future use (in Mapsui).

Now, I'm looking on the specification, Mobac and Maperitive.

The solution from #697 works perfectly for me and I would like to use the same structure like https://github.com/Mapsui/Mapsui/blob/master/Samples/Mapsui.Samples.Common/MbTiles/world.mbtiles but with own tiles, uploaded by the feature in the app.

Than you will find the commands for creating the tables in the mentioned specification.

The structure is fine, I can keep it, just clear data and reuse the db with my own uploaded ones.

I'm not sure if MOBAC or Maperitive are these tools what I need for create and fill the Mapbox db to have offline maps (for Mapsui) with any zoom levels, tiles etc.

I was hoping that you would tell me how you created the world.mbtiles database of a simple world map (1000 tiles)... have you used the MapTiler Free software for this?

I'm afraid that I'll have to create my own mapping solution... some map cruncher for OSM, GeoServer (WMTS) to get the tiles and upload them into Mapbox db (no data, preserved structure).
just... time pressure

Was this page helpful?
0 / 5 - 0 ratings