morecantile 5.4.1__py3-none-any.whl → 6.0.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/commons.py +4 -4
- morecantile/models.py +5 -16
- {morecantile-5.4.1.dist-info → morecantile-6.0.0.dist-info}/METADATA +5 -3
- {morecantile-5.4.1.dist-info → morecantile-6.0.0.dist-info}/RECORD +8 -8
- {morecantile-5.4.1.dist-info → morecantile-6.0.0.dist-info}/LICENSE +0 -0
- {morecantile-5.4.1.dist-info → morecantile-6.0.0.dist-info}/WHEEL +0 -0
- {morecantile-5.4.1.dist-info → morecantile-6.0.0.dist-info}/entry_points.txt +0 -0
morecantile/__init__.py
CHANGED
morecantile/commons.py
CHANGED
|
@@ -7,10 +7,10 @@ class BoundingBox(NamedTuple):
|
|
|
7
7
|
"""A xmin,ymin,xmax,ymax coordinates tuple.
|
|
8
8
|
|
|
9
9
|
Args:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
left (number): min horizontal coordinate.
|
|
11
|
+
bottom (number):min vertical coordinate.
|
|
12
|
+
right (number): max horizontal coordinate.
|
|
13
|
+
top (number): max vertical coordinate.
|
|
14
14
|
|
|
15
15
|
Examples:
|
|
16
16
|
>>> BoundingBox(-180.0, -90.0, 180.0, 90.0)
|
morecantile/models.py
CHANGED
|
@@ -40,7 +40,6 @@ from morecantile.utils import (
|
|
|
40
40
|
NumType = Union[float, int]
|
|
41
41
|
BoundsType = Tuple[NumType, NumType]
|
|
42
42
|
LL_EPSILON = 1e-11
|
|
43
|
-
WGS84_CRS = pyproj.CRS.from_epsg(4326)
|
|
44
43
|
axesInfo = Annotated[List[str], Field(min_length=2, max_length=2)]
|
|
45
44
|
|
|
46
45
|
|
|
@@ -486,7 +485,6 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
486
485
|
]
|
|
487
486
|
|
|
488
487
|
# Private attributes
|
|
489
|
-
_geographic_crs: pyproj.CRS = PrivateAttr(default=WGS84_CRS)
|
|
490
488
|
_to_geographic: pyproj.Transformer = PrivateAttr()
|
|
491
489
|
_from_geographic: pyproj.Transformer = PrivateAttr()
|
|
492
490
|
|
|
@@ -494,16 +492,12 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
494
492
|
"""Set private attributes."""
|
|
495
493
|
super().__init__(**data)
|
|
496
494
|
|
|
497
|
-
self._geographic_crs = pyproj.CRS.from_user_input(
|
|
498
|
-
data.get("_geographic_crs", WGS84_CRS)
|
|
499
|
-
)
|
|
500
|
-
|
|
501
495
|
try:
|
|
502
496
|
self._to_geographic = pyproj.Transformer.from_crs(
|
|
503
|
-
self.crs._pyproj_crs, self.
|
|
497
|
+
self.crs._pyproj_crs, self.crs._pyproj_crs.geodetic_crs, always_xy=True
|
|
504
498
|
)
|
|
505
499
|
self._from_geographic = pyproj.Transformer.from_crs(
|
|
506
|
-
self.
|
|
500
|
+
self.crs._pyproj_crs.geodetic_crs, self.crs._pyproj_crs, always_xy=True
|
|
507
501
|
)
|
|
508
502
|
except ProjError:
|
|
509
503
|
warnings.warn(
|
|
@@ -555,7 +549,7 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
555
549
|
@cached_property
|
|
556
550
|
def geographic_crs(self) -> pyproj.CRS:
|
|
557
551
|
"""Return the TMS's geographic CRS."""
|
|
558
|
-
return self.
|
|
552
|
+
return self.crs._pyproj_crs.geodetic_crs
|
|
559
553
|
|
|
560
554
|
@cached_property
|
|
561
555
|
def rasterio_crs(self):
|
|
@@ -565,7 +559,7 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
565
559
|
@cached_property
|
|
566
560
|
def rasterio_geographic_crs(self):
|
|
567
561
|
"""Return the geographic CRS as a rasterio CRS."""
|
|
568
|
-
return to_rasterio_crs(self.
|
|
562
|
+
return to_rasterio_crs(self.crs._pyproj_crs.geodetic_crs)
|
|
569
563
|
|
|
570
564
|
@property
|
|
571
565
|
def minzoom(self) -> int:
|
|
@@ -656,7 +650,6 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
656
650
|
title: Optional[str] = None,
|
|
657
651
|
id: Optional[str] = None,
|
|
658
652
|
ordered_axes: Optional[List[str]] = None,
|
|
659
|
-
geographic_crs: pyproj.CRS = WGS84_CRS,
|
|
660
653
|
screen_pixel_size: float = 0.28e-3,
|
|
661
654
|
decimation_base: int = 2,
|
|
662
655
|
**kwargs: Any,
|
|
@@ -689,8 +682,6 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
689
682
|
Tile Matrix Set title
|
|
690
683
|
id: str, optional
|
|
691
684
|
Tile Matrix Set identifier
|
|
692
|
-
geographic_crs: pyproj.CRS
|
|
693
|
-
Geographic (lat,lon) coordinate reference system (default is EPSG:4326)
|
|
694
685
|
ordered_axes: list of str, optional
|
|
695
686
|
Override Axis order (e.g `["N", "S"]`) else default to CRS's metadata
|
|
696
687
|
screen_pixel_size: float, optional
|
|
@@ -769,7 +760,6 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
769
760
|
tileMatrices=tile_matrices,
|
|
770
761
|
id=id,
|
|
771
762
|
title=title,
|
|
772
|
-
_geographic_crs=geographic_crs,
|
|
773
763
|
**kwargs,
|
|
774
764
|
)
|
|
775
765
|
|
|
@@ -1250,9 +1240,8 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
|
|
|
1250
1240
|
|
|
1251
1241
|
for w, s, e, n in bboxes:
|
|
1252
1242
|
# Clamp bounding values.
|
|
1253
|
-
ws_contain_180th = lons_contain_antimeridian(w, self.bbox.left)
|
|
1254
1243
|
es_contain_180th = lons_contain_antimeridian(e, self.bbox.right)
|
|
1255
|
-
w =
|
|
1244
|
+
w = max(self.bbox.left, w)
|
|
1256
1245
|
s = max(self.bbox.bottom, s)
|
|
1257
1246
|
e = max(self.bbox.right, e) if es_contain_180th else min(self.bbox.right, e)
|
|
1258
1247
|
n = min(self.bbox.top, n)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: morecantile
|
|
3
|
-
Version:
|
|
3
|
+
Version: 6.0.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>
|
|
@@ -20,8 +20,10 @@ Requires-Dist: pyproj~=3.1
|
|
|
20
20
|
Requires-Dist: pydantic~=2.0
|
|
21
21
|
Requires-Dist: pre-commit ; extra == "dev"
|
|
22
22
|
Requires-Dist: bump-my-version ; extra == "dev"
|
|
23
|
-
Requires-Dist: mkdocs ; extra == "docs"
|
|
24
|
-
Requires-Dist: mkdocs-material ; extra == "docs"
|
|
23
|
+
Requires-Dist: mkdocs>=1.4.3 ; extra == "docs"
|
|
24
|
+
Requires-Dist: mkdocs-material[imaging]>=9.5 ; extra == "docs"
|
|
25
|
+
Requires-Dist: griffe-inherited-docstrings>=1.0.0 ; extra == "docs"
|
|
26
|
+
Requires-Dist: mkdocstrings[python]>=0.25.1 ; extra == "docs"
|
|
25
27
|
Requires-Dist: pygments ; extra == "docs"
|
|
26
28
|
Requires-Dist: rasterio>=1.2.1 ; extra == "rasterio"
|
|
27
29
|
Requires-Dist: mercantile ; extra == "test"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
morecantile/__init__.py,sha256=
|
|
2
|
-
morecantile/commons.py,sha256=
|
|
1
|
+
morecantile/__init__.py,sha256=nU-M9zzFyyUJOGF9xw5-VjHdf30Ft4Kui1uizI32GzQ,436
|
|
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=ZOA_J0cLVZd1Sknn1CW3bDRVwM1M6iVpIujb-Zm5bE8,51068
|
|
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-
|
|
25
|
-
morecantile-
|
|
26
|
-
morecantile-
|
|
27
|
-
morecantile-
|
|
28
|
-
morecantile-
|
|
24
|
+
morecantile-6.0.0.dist-info/entry_points.txt,sha256=keoXuYgnX-mdrGWwXIHqEkSZjQK_iAmtmdrtZ3sCT24,59
|
|
25
|
+
morecantile-6.0.0.dist-info/LICENSE,sha256=18IxFIta7rF_RcVSIgLUUd_alyfQ9bGoZKQm5vOarGU,1073
|
|
26
|
+
morecantile-6.0.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
27
|
+
morecantile-6.0.0.dist-info/METADATA,sha256=LHgzSmCyr9fyl8iYdOX1sPRExHAa38Vd1YnDZFOOp04,7140
|
|
28
|
+
morecantile-6.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|