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

Bug fix tile_to_bbox(): use pixel_width instead of extent. #333

Merged
merged 2 commits into from
Oct 30, 2020
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions openmaptiles/sqltomvt.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ def tile_to_bbox(self, layer: Layer, zoom, x, y):
# Every subsequent zoom divides it by 2
if layer.buffer_size > 0:
if not self.tile_envelope_margin:
percentage = 40075016.6855785 * layer.buffer_size / self.extent
percentage = 40075016.6855785 * layer.buffer_size / self.pixel_width
return f"ST_Expand({self.bbox(zoom, x, y)}, {percentage}/2^{zoom})"
else:
# Once https://github.com/postgis/postgis/pull/514 is merged
return self.bbox(zoom, x, y, float(layer.buffer_size) / self.extent)
return self.bbox(zoom, x, y, float(layer.buffer_size) / self.pixel_width)
else:
return self.bbox(zoom, x, y)

Expand Down