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

fix center coordinates of pmtiles writer #769

Merged
merged 2 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ public void finish(TileArchiveMetadata tileArchiveMetadata) {
(int) (bounds.getMaxX() * 10_000_000),
(int) (bounds.getMaxY() * 10_000_000),
(byte) zoom,
(int) center.x * 10_000_000,
(int) center.y * 10_000_000
(int) (center.x * 10_000_000),
(int) (center.y * 10_000_000)
);

LOGGER.info("Writing metadata and leaf directories...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ void testRoundtripHeader() {
Pmtiles.TileType tileType = Pmtiles.TileType.MVT;
byte minZoom = 1;
byte maxZoom = 3;
int minLonE7 = -10_000_000;
int minLatE7 = -20_000_000;
int maxLonE7 = 10_000_000;
int maxLatE7 = 20_000_000;
int minLonE7 = -10_100_000;
int minLatE7 = -20_200_000;
int maxLonE7 = 10_100_000;
int maxLatE7 = 20_200_000;
byte centerZoom = 2;
int centerLonE7 = -5_000_000;
int centerLatE7 = -6_000_000;
int centerLonE7 = -5_500_000;
int centerLatE7 = -6_600_000;

Pmtiles.Header in = new Pmtiles.Header(
specVersion,
Expand Down Expand Up @@ -220,8 +220,8 @@ void testRoundtripMetadata() throws IOException {
"MyVersion",
"baselayer",
TileArchiveMetadata.MVT_FORMAT,
new Envelope(1, 2, 3, 4),
new CoordinateXY(5, 6),
new Envelope(1.1, 2.2, 3.3, 4.4),
new CoordinateXY(5.5, 6.6),
7d,
8,
9,
Expand Down
Loading