tilezen / go-tilepacks

A Go-based tile downloader that saves to deduplicated mbtiles files.
MIT License
14 stars 3 forks source link

Add methods and tools to ensure spatial metadata properties for MBTiles databases #27

Closed thisisaaronland closed 2 months ago

thisisaaronland commented 2 months ago

Version 1.3 of the MBTiles spec says:

The metadata table SHOULD contain these four rows: bounds, center, minzoom, maxzoom

This PR adds methods to ensure those metadata properties are assigned when a new database is created and tools to update existing database.

This PR introduces backwards incompatible changes to the tilepack.TileOutputter interface:

This PR introduces backwards incompatible changes to the tilepack.MbtilesReader interface:

This PR introduces a new MbtilesMetadata for working with MBTiles metadata properties.

The PR updates the cmd/build and cmd/merge tools to call the MbtilesMetadata on their respective tile "outputters". Additionally the cmd/merge tool has been updated to derive the updated bounds and min/max zoom levels for the set of MBTiles databases being merged.

This PR updates dependencies to their most recent version and requires Go 1.23.

Aside from the backwards incompatible changes to the interfaces this PR introduces no outward facing changes. All the command line tools work the same way and all the tests pass.

thisisaaronland commented 2 months ago

I can see the checks are failing because the go.mod file specifies Go 1.23 and .github/workflows/go.yml specifies Go 1.20

I am not wed to Go 1.23 but the requirements should probably be bumped to Go 1.21 since I think previous versions have been EOL-ed.

iandees commented 2 months ago

If you can rebase or merge in my change in #28 should allow compiling Go 1.23.

thisisaaronland commented 2 months ago

Do you need me to do anything else for this?

iandees commented 2 months ago

Nope, sorry didn't see the merge.