-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Expose pmtiles writer #520
Conversation
https://github.com/onthegomap/planetiler/actions/runs/4456711247 ℹ️ Base Logs 9945ad4
ℹ️ This Branch Logs 171d090
|
assert lastTile == null || lastTile.compareTo(tileCoord) < 0 : "Tiles out of order %s before %s" | ||
.formatted(lastTile, tileCoord); | ||
assert lastTile == null || | ||
order.encode(tileCoord) > order.encode(lastTile) : "Tiles out of order %s before %s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically the PMTiles writer can take out-of-order writes and has some logic to set clustered=false
and re-sort the entries. If we are enforcing this via assertion then we could take that logic out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assertion only runs when -ea
jvm flag is set (including during tests). All of the code within planetiler is designed to output tiles in order so I like having the assertion in here, but if someone uses this utility outside of planetiler then they might not write in order....
@@ -0,0 +1,75 @@ | |||
package com.onthegomap.planetiler.archive; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if TileArchives
utilities for working with tile archives makes the most sense, or collapse TileArchives
and TileArchiveMetadata
into one record TileArchive
that also has static factory methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems useful to be able to manipulate metadata not in the context of an entire archive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops sorry I meant collapse TileArchives
and TileArchiveConfig
into just TileArchive
, for example: 17bdd19
LGTM! We should also update the README/other doc files about the new output format but that can go in a follow-up |
Kudos, SonarCloud Quality Gate passed! |
Add support for using new pmtiles writer functionality by changing
--output
argument to point at a file ending in.pmtiles
.Major changes:
--output=path.mbtiles
or--output=path.pmtiles
command-line argument to control where the output goes.--mbtiles=output.mbtiles
will also continue to work until you upgrade from deprecatedsetOutput("mbtiles", path)
tosetOutput(path)
.--compact-db=false
becomes--output=out.mbtiles?compact=false
--skip-mbtiles-index-creation
becomes--output=out.mbtiles?no_index
--optimize-db
becomes--output=out.mbtiles?vacuum_analyze
Also cleaned up the code since there were quite a few places that assumed mbtiles output:
TileArchiveMetadata
that describes metadata that pmtiles and mbtiles metadata can hold and pulled metadata interface up intoWriteableTileArchive
andReadableTileArchive
interfaces.TileArchiveConfig
that describes the location, format, and options of a tile archive to write to/read fromTileArchives
utility with static factory methods for creating readable and writable archives