confusion about tiles not filling extent #174
Replies: 1 comment
-
@vincentsarago I think I might have worked it out at least for supermorecado. def tile_extrema(
self, bounds: Tuple[float, float, float, float], zoom: int
) -> Dict:
"""Tiles min/max at the given zoom for bounds."""
ulTile = self.tms.tile(bounds[0], bounds[3], zoom)
lrTile = self.tms.tile(bounds[2], bounds[1], zoom)
minx, maxx = (min(ulTile.x, lrTile.x), max(ulTile.x, lrTile.x))
miny, maxy = (min(ulTile.y, lrTile.y), max(ulTile.y, lrTile.y))
return {
"x": {"min": minx, "max": maxx + 1},
"y": {"min": miny, "max": maxy + 1},
} you grab the min x tile coordinate from the upper left coordinate. I was able to correct things by grabbing the min x tile from the lower left tile. For a bounds of 0-6 degrees longitude, 0-84 degrees latitude at zoom level 9, I get the following tiles for each corner: print(tms.tile(0, 0, 9), tms.tile(6, 0, 9), tms.tile(0, 84, 9), tms.tile(6, 84, 9)) you get: (Tile(x=123, y=255, z=9),
Tile(x=132, y=255, z=9),
Tile(x=127, y=136, z=9),
Tile(x=128, y=136, z=9)) but {'x': {'min': 127, 'max': 133}, 'y': {'min': 136, 'max': 256}} the xmin being unless I am missing something here entirely this seems to be an issue. I created a monkey patch for this and got the following ![]() and also made a gist with the geojson files: https://gist.github.com/AndrewAnnex/da4f4c353a6929dec22e8834c54fd881 As a side note, given my use case I may want to actually buffer the tile range to ensure no areas within the area of use polygon are not covered, like a adding a buffer to the tile extrema rather than buffering the geometry or maybe changing the behavior of truncate a bit. another side point using I hope that I am not just super confused about something with the intended usage/expected input coordinate systems for burn/tiles. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am attempting to build a set of TMSs using transverse mercator projection for all of the zones, to start though I wanted to test things out with morecantile's UTM31WGS84Quad TMS,
But after some experimentation, I am seeing something unexpected when trying to enumerate all the tiles for the area of use for UTM31N, which is 0 to 6 longitude and 0 to 84 north latitude when using
tms.tiles()
where the tiles don't extend to the lower left corner of the expected extent in 4326. I am also comparing the results from supermorecado burn as I'll need the performance at higher zoom levels and I get a more truncated response in comparison to morecantile.shapes, even though I am setting truncate to falsehere's a plot of this in 4326, at zoom level 9 and the red boxes corresponding to supermorecado, and the green from morecantiles' tiles function
And the same in EPSG:32631
What's interesting, is it could be related to the false easting, which is dead center of the projections only the 1 column of tiles to the left is shown.
I am a little confused about all of this, it should be the case that all of the area of use for the crs should be usable in the tms
Beta Was this translation helpful? Give feedback.
All reactions