simonw / download-tiles

Download map tiles and store them in an MBTiles database
https://datasette.io/tools/download-tiles
Apache License 2.0
29 stars 6 forks source link

Make sure this sets the application ID in the SQLite files it creates #10

Closed simonw closed 1 year ago

simonw commented 1 year ago

https://www.sqlite.org/src/artifact?ci=trunk&filename=magic.txt

Suggests that PRAGMA application_id = INTEGER; be used to set this for MBTiles:

>68  belong  =0x4d504258  MBTiles tileset -
simonw commented 1 year ago

Here's an example found via GitHub code search: https://github.com/maptiler/planetiler/blob/dab37f572e1b352cb3216b5115671f6f69e8d73c/planetiler-core/src/main/java/com/onthegomap/planetiler/mbtiles/Mbtiles.java#L46

public final class Mbtiles implements Closeable {

  // https://www.sqlite.org/src/artifact?ci=trunk&filename=magic.txt
  private static final int MBTILES_APPLICATION_ID = 0x4d504258;

...

      config.setApplicationId(MBTILES_APPLICATION_ID);
simonw commented 1 year ago

For the record, 0x4d504258 is the same value as 1297105496.