Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 11 commits into from
Sep 28, 2024

Conversation

thisisaaronland
Copy link
Contributor

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:

  • Add a AssignSpatialMetadata(orb.Bound, maptile.Zoom, maptile.Zoom) error method.

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

  • Add a Metadata() (*MbtilesMetadata, error) method.

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
Copy link
Contributor Author

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.

cmd/merge/main.go Outdated Show resolved Hide resolved
cmd/merge/main.go Outdated Show resolved Hide resolved
@iandees
Copy link
Member

iandees commented Sep 11, 2024

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

thisisaaronland and others added 2 commits September 22, 2024 11:47
@thisisaaronland
Copy link
Contributor Author

Do you need me to do anything else for this?

@iandees
Copy link
Member

iandees commented Sep 28, 2024

Nope, sorry didn't see the merge.

@iandees iandees merged commit f75e845 into tilezen:master Sep 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants