Skip to content

Commit 51d93e4

Browse files
committed
change formula for area threshold in python workers
1 parent ed6c162 commit 51d93e4

File tree

1 file changed

+3
-4
lines changed
  • mapswipe_workers/mapswipe_workers/project_types/tile_map_service_grid

1 file changed

+3
-4
lines changed

mapswipe_workers/mapswipe_workers/project_types/tile_map_service_grid/project.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,9 @@ def validate_geometries(self):
154154
# We calculate the max area based on zoom level.
155155
# This is an approximation to restrict the project size
156156
# in respect to the number of tasks.
157-
# At zoom level 22 the max area is set to 200 square kilometers.
158-
# For zoom level 18 this will result in an max area of 5000 square kilometers.
159-
# (23-18) * (23-18) * 200 = 5000
160-
max_area = (23 - int(self.zoomLevel)) * (23 - int(self.zoomLevel)) * 200
157+
# At zoom level 22 the max area is set to 20 square kilometers.
158+
# For zoom level 18 this will result in an max area of 5,120 square kilometers.
159+
max_area = 5 * 4 ** (23 - self.zoomLevel)
161160

162161
if project_area > max_area:
163162
logger.warning(

0 commit comments

Comments
 (0)