morecantile 6.0.0__py3-none-any.whl → 6.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- morecantile/__init__.py +1 -1
- morecantile/models.py +28 -8
- {morecantile-6.0.0.dist-info → morecantile-6.1.0.dist-info}/METADATA +4 -1
- {morecantile-6.0.0.dist-info → morecantile-6.1.0.dist-info}/RECORD +7 -7
- {morecantile-6.0.0.dist-info → morecantile-6.1.0.dist-info}/LICENSE +0 -0
- {morecantile-6.0.0.dist-info → morecantile-6.1.0.dist-info}/WHEEL +0 -0
- {morecantile-6.0.0.dist-info → morecantile-6.1.0.dist-info}/entry_points.txt +0 -0
morecantile/__init__.py
CHANGED
morecantile/models.py
CHANGED
|
@@ -488,10 +488,16 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
488
488
|
_to_geographic: pyproj.Transformer = PrivateAttr()
|
|
489
489
|
_from_geographic: pyproj.Transformer = PrivateAttr()
|
|
490
490
|
|
|
491
|
+
_tile_matrices_idx: Dict[int, int] = PrivateAttr()
|
|
492
|
+
|
|
491
493
|
def __init__(self, **data):
|
|
492
494
|
"""Set private attributes."""
|
|
493
495
|
super().__init__(**data)
|
|
494
496
|
|
|
497
|
+
self._tile_matrices_idx = {
|
|
498
|
+
int(mat.id): idx for idx, mat in enumerate(self.tileMatrices)
|
|
499
|
+
}
|
|
500
|
+
|
|
495
501
|
try:
|
|
496
502
|
self._to_geographic = pyproj.Transformer.from_crs(
|
|
497
503
|
self.crs._pyproj_crs, self.crs._pyproj_crs.geodetic_crs, always_xy=True
|
|
@@ -765,9 +771,8 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
765
771
|
|
|
766
772
|
def matrix(self, zoom: int) -> TileMatrix:
|
|
767
773
|
"""Return the TileMatrix for a specific zoom."""
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
return m
|
|
774
|
+
if (idx := self._tile_matrices_idx.get(zoom, None)) is not None:
|
|
775
|
+
return self.tileMatrices[idx]
|
|
771
776
|
|
|
772
777
|
#######################################################################
|
|
773
778
|
# If user wants a deeper matrix we calculate it
|
|
@@ -1093,8 +1098,23 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
1093
1098
|
"""
|
|
1094
1099
|
t = _parse_tile_arg(*tile)
|
|
1095
1100
|
|
|
1096
|
-
|
|
1097
|
-
|
|
1101
|
+
matrix = self.matrix(t.z)
|
|
1102
|
+
origin_x, origin_y = self._matrix_origin(matrix)
|
|
1103
|
+
|
|
1104
|
+
cf = (
|
|
1105
|
+
matrix.get_coalesce_factor(t.y)
|
|
1106
|
+
if matrix.variableMatrixWidths is not None
|
|
1107
|
+
else 1
|
|
1108
|
+
)
|
|
1109
|
+
|
|
1110
|
+
left = origin_x + math.floor(t.x / cf) * matrix.cellSize * cf * matrix.tileWidth
|
|
1111
|
+
top = origin_y - t.y * matrix.cellSize * matrix.tileHeight
|
|
1112
|
+
right = (
|
|
1113
|
+
origin_x
|
|
1114
|
+
+ (math.floor(t.x / cf) + 1) * matrix.cellSize * cf * matrix.tileWidth
|
|
1115
|
+
)
|
|
1116
|
+
bottom = origin_y - (t.y + 1) * matrix.cellSize * matrix.tileHeight
|
|
1117
|
+
|
|
1098
1118
|
return BoundingBox(left, bottom, right, top)
|
|
1099
1119
|
|
|
1100
1120
|
def ul(self, *tile: Tile) -> Coords:
|
|
@@ -1146,10 +1166,10 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
1146
1166
|
BoundingBox: The bounding box of the input tile.
|
|
1147
1167
|
|
|
1148
1168
|
"""
|
|
1149
|
-
|
|
1169
|
+
_left, _bottom, _right, _top = self.xy_bounds(*tile)
|
|
1170
|
+
left, top = self.lnglat(_left, _top)
|
|
1171
|
+
right, bottom = self.lnglat(_right, _bottom)
|
|
1150
1172
|
|
|
1151
|
-
left, top = self.ul(t)
|
|
1152
|
-
right, bottom = self.lr(t)
|
|
1153
1173
|
return BoundingBox(left, bottom, right, top)
|
|
1154
1174
|
|
|
1155
1175
|
@property
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: morecantile
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.1.0
|
|
4
4
|
Summary: Construct and use map tile grids (a.k.a TileMatrixSet / TMS).
|
|
5
5
|
Keywords: GIS,TMS,TileMatrixSet,Map Tile
|
|
6
6
|
Author-email: Vincent Sarago <vincent@developmentseed.com>
|
|
@@ -18,6 +18,8 @@ Classifier: Topic :: Scientific/Engineering :: GIS
|
|
|
18
18
|
Requires-Dist: attrs
|
|
19
19
|
Requires-Dist: pyproj~=3.1
|
|
20
20
|
Requires-Dist: pydantic~=2.0
|
|
21
|
+
Requires-Dist: pytest ; extra == "benchmark"
|
|
22
|
+
Requires-Dist: pytest-benchmark ; extra == "benchmark"
|
|
21
23
|
Requires-Dist: pre-commit ; extra == "dev"
|
|
22
24
|
Requires-Dist: bump-my-version ; extra == "dev"
|
|
23
25
|
Requires-Dist: mkdocs>=1.4.3 ; extra == "docs"
|
|
@@ -32,6 +34,7 @@ Requires-Dist: pytest-cov ; extra == "test"
|
|
|
32
34
|
Requires-Dist: rasterio>=1.2.1 ; extra == "test"
|
|
33
35
|
Project-URL: Documentation, https://developmentseed.org/morecantile/
|
|
34
36
|
Project-URL: Source, https://github.com/developmentseed/morecantile
|
|
37
|
+
Provides-Extra: benchmark
|
|
35
38
|
Provides-Extra: dev
|
|
36
39
|
Provides-Extra: docs
|
|
37
40
|
Provides-Extra: rasterio
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
morecantile/__init__.py,sha256=
|
|
1
|
+
morecantile/__init__.py,sha256=Ge_Q-KuZkTJKwAfz3oz8LHNYTPlGZpU-OHRpTtm4XjY,436
|
|
2
2
|
morecantile/commons.py,sha256=iHElysLSMu-zb3h1G1-AJnQrZ6y-2GseZkoBkOuzcZ8,1031
|
|
3
3
|
morecantile/defaults.py,sha256=9lvHmZ9WM_J5uNCS9VWEy8O5_x2dA2Spvk4H5aHv6UQ,1804
|
|
4
4
|
morecantile/errors.py,sha256=rhtdpNglfEz5nC8I-BJKUr_gkOwAPwVi1vhLFJ2StYw,907
|
|
5
|
-
morecantile/models.py,sha256=
|
|
5
|
+
morecantile/models.py,sha256=17p2BlpYRGxW61WK4fwh6GU68Gffa9ovGWghk2cQzaI,51856
|
|
6
6
|
morecantile/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
morecantile/utils.py,sha256=-JUTcrwhT_TEWAPWV8YQBQJoYU2HfVkqQEJaggtnKJg,4020
|
|
8
8
|
morecantile/data/CDB1GlobalGrid.json,sha256=VDc2ukAWtTQeCdOG8YMqsGO-D7eSzSCN1TEaBn2qLZI,36115
|
|
@@ -21,8 +21,8 @@ morecantile/data/WorldCRS84Quad.json,sha256=l0Wf2faYwzRwO0mG-Tea1Vydpi7V1Oel5L9l
|
|
|
21
21
|
morecantile/data/WorldMercatorWGS84Quad.json,sha256=JaqoBSu5qVJmL-J7oSVU1etP2OPWx_aVaTc68dGX0Ec,7001
|
|
22
22
|
morecantile/scripts/__init__.py,sha256=-CJncfgWDnSZ8au-SJtgX-OFgCddlf7___d91qQcqQM,23
|
|
23
23
|
morecantile/scripts/cli.py,sha256=TOc1RjLXuTzKs2FNNHQ3eCiGqiBoDFA4fKWpOAuY12s,17364
|
|
24
|
-
morecantile-6.
|
|
25
|
-
morecantile-6.
|
|
26
|
-
morecantile-6.
|
|
27
|
-
morecantile-6.
|
|
28
|
-
morecantile-6.
|
|
24
|
+
morecantile-6.1.0.dist-info/entry_points.txt,sha256=keoXuYgnX-mdrGWwXIHqEkSZjQK_iAmtmdrtZ3sCT24,59
|
|
25
|
+
morecantile-6.1.0.dist-info/LICENSE,sha256=18IxFIta7rF_RcVSIgLUUd_alyfQ9bGoZKQm5vOarGU,1073
|
|
26
|
+
morecantile-6.1.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
27
|
+
morecantile-6.1.0.dist-info/METADATA,sha256=FuP9VVcbql1Tn47NSTrmD_cOL8T2rBLqvp2pc0mYges,7266
|
|
28
|
+
morecantile-6.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|