| 1 | # -*- coding: utf-8 -*-
|
|---|
| 2 | '''
|
|---|
| 3 | Copyright (C) 2020 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
|
|---|
| 4 |
|
|---|
| 5 | This program is free software: you can redistribute it and/or modify
|
|---|
| 6 | it under the terms of the GNU General Public License as published by
|
|---|
| 7 | the Free Software Foundation, either version 3 of the License, or
|
|---|
| 8 | (at your option) any later version.
|
|---|
| 9 |
|
|---|
| 10 | This program is distributed in the hope that it will be useful,
|
|---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 13 | GNU General Public License for more details.
|
|---|
| 14 |
|
|---|
| 15 | You should have received a copy of the GNU General Public License
|
|---|
| 16 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 17 | '''
|
|---|
| 18 |
|
|---|
| 19 | try:
|
|---|
| 20 | from dataclasses import dataclass
|
|---|
| 21 |
|
|---|
| 22 | @dataclass
|
|---|
| 23 | class TileConfig:
|
|---|
| 24 | cache_path: str
|
|---|
| 25 | sizes: Array[int]
|
|---|
| 26 | densities: Array[int]
|
|---|
| 27 | densitiy_base: int
|
|---|
| 28 | points_age_max: int
|
|---|
| 29 | zoom_range: Array[int]
|
|---|
| 30 | raster_file_size_max: [int]
|
|---|
| 31 | skip_empty: bool
|
|---|
| 32 |
|
|---|
| 33 | except ImportError:
|
|---|
| 34 | class TileConfig:
|
|---|
| 35 | """
|
|---|
| 36 | Workaround for @dataclass, until python 3.7 is available in main distros
|
|---|
| 37 | """
|
|---|
| 38 | def __init__(self, cache_path, sizes, densities, densitiy_base, points_age_max, zoom_range, raster_file_size_max, skip_empty):
|
|---|
| 39 | self.cache_path = cache_path
|
|---|
| 40 | self.sizes = sizes
|
|---|
| 41 | self.densities = densities
|
|---|
| 42 | self.densitiy_base = densitiy_base
|
|---|
| 43 | self.points_age_max = points_age_max
|
|---|
| 44 | self.zoom_range = zoom_range
|
|---|
| 45 | self.raster_file_size_max = raster_file_size_max
|
|---|
| 46 | self.skip_empty = skip_empty
|
|---|