morecantile 5.3.0__tar.gz → 5.3.1__tar.gz

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.
Files changed (30) hide show
  1. {morecantile-5.3.0 → morecantile-5.3.1}/PKG-INFO +2 -1
  2. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/__init__.py +1 -1
  3. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/models.py +5 -2
  4. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/utils.py +24 -0
  5. {morecantile-5.3.0 → morecantile-5.3.1}/pyproject.toml +16 -0
  6. morecantile-5.3.0/.bumpversion.cfg +0 -9
  7. {morecantile-5.3.0 → morecantile-5.3.1}/.gitignore +0 -0
  8. {morecantile-5.3.0 → morecantile-5.3.1}/.pre-commit-config.yaml +0 -0
  9. {morecantile-5.3.0 → morecantile-5.3.1}/LICENSE +0 -0
  10. {morecantile-5.3.0 → morecantile-5.3.1}/README.md +0 -0
  11. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/commons.py +0 -0
  12. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/CDB1GlobalGrid.json +0 -0
  13. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/CanadianNAD83_LCC.json +0 -0
  14. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/EuropeanETRS89_LAEAQuad.json +0 -0
  15. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/GNOSISGlobalGrid.json +0 -0
  16. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/LINZAntarticaMapTilegrid.json +0 -0
  17. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/NZTM2000Quad.json +0 -0
  18. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/README.md +0 -0
  19. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/UPSAntarcticWGS84Quad.json +0 -0
  20. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/UPSArcticWGS84Quad.json +0 -0
  21. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/UTM31WGS84Quad.json +0 -0
  22. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/WGS1984Quad.json +0 -0
  23. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/WebMercatorQuad.json +0 -0
  24. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/WorldCRS84Quad.json +0 -0
  25. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/data/WorldMercatorWGS84Quad.json +0 -0
  26. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/defaults.py +0 -0
  27. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/errors.py +0 -0
  28. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/py.typed +0 -0
  29. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/scripts/__init__.py +0 -0
  30. {morecantile-5.3.0 → morecantile-5.3.1}/morecantile/scripts/cli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: morecantile
3
- Version: 5.3.0
3
+ Version: 5.3.1
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,7 @@ Requires-Dist: attrs
18
18
  Requires-Dist: pyproj~=3.1
19
19
  Requires-Dist: pydantic~=2.0
20
20
  Requires-Dist: pre-commit ; extra == "dev"
21
+ Requires-Dist: bump-my-version ; extra == "dev"
21
22
  Requires-Dist: mkdocs ; extra == "docs"
22
23
  Requires-Dist: mkdocs-material ; extra == "docs"
23
24
  Requires-Dist: pygments ; extra == "docs"
@@ -8,7 +8,7 @@ Refs:
8
8
 
9
9
  """
10
10
 
11
- __version__ = "5.3.0"
11
+ __version__ = "5.3.1"
12
12
 
13
13
  from .commons import BoundingBox, Coords, Tile # noqa
14
14
  from .defaults import TileMatrixSets, tms # noqa
@@ -31,6 +31,7 @@ from morecantile.utils import (
31
31
  _parse_tile_arg,
32
32
  bbox_to_feature,
33
33
  check_quadkey_support,
34
+ lons_contain_antimeridian,
34
35
  meters_per_unit,
35
36
  point_in_bbox,
36
37
  to_rasterio_crs,
@@ -1252,9 +1253,11 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True):
1252
1253
 
1253
1254
  for w, s, e, n in bboxes:
1254
1255
  # Clamp bounding values.
1255
- w = max(self.bbox.left, w)
1256
+ ws_contain_180th = lons_contain_antimeridian(w, self.bbox.left)
1257
+ es_contain_180th = lons_contain_antimeridian(e, self.bbox.right)
1258
+ w = min(self.bbox.left, w) if ws_contain_180th else max(self.bbox.left, w)
1256
1259
  s = max(self.bbox.bottom, s)
1257
- e = min(self.bbox.right, e)
1260
+ e = max(self.bbox.right, e) if es_contain_180th else min(self.bbox.right, e)
1258
1261
  n = min(self.bbox.top, n)
1259
1262
 
1260
1263
  for z in zooms:
@@ -40,6 +40,30 @@ def _parse_tile_arg(*args) -> Tile:
40
40
  )
41
41
 
42
42
 
43
+ def lons_contain_antimeridian(lon1: float, lon2: float) -> bool:
44
+ """
45
+ Check if the antimeridian (180th meridian) is between two longitude points
46
+
47
+ Parameters
48
+ ----------
49
+ lon1: float
50
+ The first longitude.
51
+ lon2: float
52
+ The second longitude
53
+
54
+ Returns
55
+ -------
56
+ A bool representing whether two longs contain the 180th meridian.
57
+ """
58
+ lon1_clipped = max(-180.0, min(lon1, 180))
59
+ lon2_clipped = max(-180.0, min(lon2, 180))
60
+ lon1_converted = (lon1_clipped + 360) % 360
61
+ lon2_converted = (lon2_clipped + 360) % 360
62
+ ws = [lon1_converted, lon2_converted]
63
+ sorted(ws)
64
+ return ws[0] < 180 < ws[1]
65
+
66
+
43
67
  def meters_per_unit(crs: CRS) -> float:
44
68
  """
45
69
  Coefficient to convert the coordinate reference system (CRS)
@@ -37,6 +37,7 @@ test = [
37
37
  ]
38
38
  dev = [
39
39
  "pre-commit",
40
+ "bump-my-version",
40
41
  ]
41
42
  docs = [
42
43
  "mkdocs",
@@ -110,3 +111,18 @@ ignore = [
110
111
  filterwarnings = [
111
112
  "ignore:You will likely lose important projection*:UserWarning",
112
113
  ]
114
+
115
+ [tool.bumpversion]
116
+ current_version = "5.3.1"
117
+
118
+ search = "{current_version}"
119
+ replace = "{new_version}"
120
+ regex = false
121
+ tag = true
122
+ commit = true
123
+ tag_name = "{new_version}"
124
+
125
+ [[tool.bumpversion.files]]
126
+ filename = "morecantile/__init__.py"
127
+ search = '__version__ = "{current_version}"'
128
+ replace = '__version__ = "{new_version}"'
@@ -1,9 +0,0 @@
1
- [bumpversion]
2
- current_version = 5.3.0
3
- commit = True
4
- tag = True
5
- tag_name = {new_version}
6
-
7
- [bumpversion:file:morecantile/__init__.py]
8
- search = __version__ = "{current_version}"
9
- replace = __version__ = "{new_version}"
File without changes
File without changes
File without changes