PMTiles: invert y axis of tile coordinates

The y axis of XYZ tiles is oriented from north to south. When
enumerating tiles for a given bounding box, the y coordinates have to be
enumerated from north/top to south/bottom.
pull/44/head
Hermann Schwarting 2024-01-03 17:36:30 +01:00 zatwierdzone przez hfs
rodzic 68b9ff91c1
commit d13d61f13c
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -135,7 +135,7 @@ public class BoundingBoxMapWithAIDownloader extends BoundingBoxDownloader {
final var tile1 = tileFromLatLonZoom(left, bottom, zoom);
final var tile2 = tileFromLatLonZoom(right, top, zoom);
return IntStream.rangeClosed(tile1.x, tile2.x)
.mapToObj(x -> IntStream.rangeClosed(tile1.y, tile2.y).mapToObj(y -> new TileXYZ(x, y, zoom)))
.mapToObj(x -> IntStream.rangeClosed(tile2.y, tile1.y).mapToObj(y -> new TileXYZ(x, y, zoom)))
.flatMap(stream -> stream);
}