Skip to content

Commit

Permalink
fix center coordinates of pmtiles writer (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon authored Dec 28, 2023
1 parent 3dea746 commit a233e68
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
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

0 comments on commit a233e68

Please sign in to comment.