[Git][debian-gis-team/morecantile][upstream] New upstream version 7.0.2
Antonio Valentino (@antonio.valentino)
gitlab at salsa.debian.org
Sat Jan 10 17:38:18 GMT 2026
Antonio Valentino pushed to branch upstream at Debian GIS Project / morecantile
Commits:
197bae23 by Antonio Valentino at 2026-01-10T17:25:43+00:00
New upstream version 7.0.2
- - - - -
7 changed files:
- CHANGES.md
- docs/src/cli.md
- morecantile/__init__.py
- morecantile/models.py
- morecantile/scripts/cli.py
- pyproject.toml
- tests/test_models.py
Changes:
=====================================
CHANGES.md
=====================================
@@ -1,6 +1,10 @@
## Unreleased
+## 7.0.2 (2026-01-05)
+
+* fix `_lr` and `_ul` methods for `bottomLeft` TMS
+
## 7.0.1 (2025-12-19)
* fix and improve type hints
=====================================
docs/src/cli.md
=====================================
@@ -129,7 +129,7 @@ Options:
--epsg INTEGER EPSG number. [required]
--extent FLOAT... left, bottom, right, top Bounding box of the Tile Matrix Set. [required]
--name TEXT Identifier of the custom TMS.
- --minzoom INTEGER Minumum Zoom level.
+ --minzoom INTEGER Minimum Zoom level.
--maxzoom INTEGER Maximum Zoom level.
--tile-width INTEGER Width of each tile.
--tile-height INTEGER Height of each tile.
=====================================
morecantile/__init__.py
=====================================
@@ -8,7 +8,7 @@ Refs:
"""
-__version__ = "7.0.1"
+__version__ = "7.0.2"
from .commons import BoundingBox, Coords, Tile # noqa
from .defaults import TileMatrixSets, tms # noqa
=====================================
morecantile/models.py
=====================================
@@ -1127,7 +1127,7 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True, extra="ignore"):
y_coord = (
origin_y - t.y * matrix.cellSize * matrix.tileHeight
if matrix.cornerOfOrigin == "topLeft"
- else origin_y + t.y * matrix.cellSize * matrix.tileHeight
+ else origin_y + (t.y + 1) * matrix.cellSize * matrix.tileHeight
)
return Coords(x_coord, y_coord)
@@ -1162,7 +1162,7 @@ class TileMatrixSet(BaseModel, arbitrary_types_allowed=True, extra="ignore"):
y_coord = (
origin_y - (t.y + 1) * matrix.cellSize * matrix.tileHeight
if matrix.cornerOfOrigin == "topLeft"
- else origin_y + (t.y + 1) * matrix.cellSize * matrix.tileHeight
+ else origin_y + t.y * matrix.cellSize * matrix.tileHeight
)
return Coords(x_coord, y_coord)
=====================================
morecantile/scripts/cli.py
=====================================
@@ -436,7 +436,7 @@ def tms(identifier):
help="Identifier of the custom TMS.",
default="CustomTileMatrixSet",
)
- at click.option("--minzoom", type=int, default=0, help="Minumum Zoom level.")
+ at click.option("--minzoom", type=int, default=0, help="Minimum Zoom level.")
@click.option("--maxzoom", type=int, default=24, help="Maximum Zoom level.")
@click.option("--tile-width", type=int, default=256, help="Width of each tile.")
@click.option("--tile-height", type=int, default=256, help="Height of each tile.")
=====================================
pyproject.toml
=====================================
@@ -119,7 +119,7 @@ filterwarnings = [
]
[tool.bumpversion]
-current_version = "7.0.1"
+current_version = "7.0.2"
search = "{current_version}"
replace = "{new_version}"
=====================================
tests/test_models.py
=====================================
@@ -10,11 +10,11 @@ import pytest
from pydantic import ValidationError
import morecantile
-from morecantile.commons import Tile
+from morecantile.commons import BoundingBox, Coords, Tile
from morecantile.errors import InvalidIdentifier
from morecantile.models import CRS, CRSWKT, CRSUri, TileMatrix, TileMatrixSet
-data_dir = os.path.join(os.path.dirname(__file__), "../morecantile/data")
+data_dir = os.path.join(os.path.dirname(morecantile.__file__), "data")
tilesets = [
os.path.join(data_dir, f) for f in os.listdir(data_dir) if f.endswith(".json")
]
@@ -804,6 +804,21 @@ def test_bottomleft_origin():
-20037508.342789244,
)
assert tms.xy_bounds(0, 0, 0) == wmTopLeft.xy_bounds(0, 0, 0)
+
+ # bottomLeft corner can also be used as
+ # origin making TileRow increase towards the top
+ assert tms.xy_bounds(1, 1, 1) == wmTopLeft.xy_bounds(1, 0, 1)
+ assert tms.xy_bounds(1, 0, 1) == wmTopLeft.xy_bounds(1, 1, 1)
+
+ assert tms._ul(0, 0, 0) == wmTopLeft._ul(0, 0, 0)
+ assert tms._lr(0, 0, 0) == wmTopLeft._lr(0, 0, 0)
+
+ # TileRow is inverted
+ assert tms._ul(0, 0, 1).y == wmTopLeft._ul(0, 1, 1).y
+ assert tms._ul(0, 1, 1).y == wmTopLeft._ul(0, 0, 1).y
+ assert tms._lr(0, 0, 1).y == wmTopLeft._lr(0, 1, 1).y
+ assert tms._lr(0, 1, 1).y == wmTopLeft._lr(0, 0, 1).y
+
assert tms.bounds(0, 0, 0) == wmTopLeft.bounds(0, 0, 0)
assert tms.xy_bounds(0, 0, 1).left == -20037508.342789244
@@ -884,3 +899,43 @@ def test_webmercator_bounds():
)
assert tms.bounds(0, 0, 1).left == -180.0
assert tms.bounds(1, 0, 1).right == 180.0
+
+
+def test_bbox_bottom_left():
+ """Ref: issue #193"""
+ extent = [-100_000, -100_000, 100_000, 100_000]
+ tms = TileMatrixSet.custom(
+ extent,
+ pyproj.CRS.from_epsg(3857),
+ minzoom=0,
+ maxzoom=2,
+ corner_of_origin="bottomLeft",
+ )
+ assert tms.xy_bbox == BoundingBox(
+ left=-100_000,
+ bottom=-100_000,
+ right=100_000,
+ top=100_000,
+ )
+
+ assert tms.xy_bounds(Tile(x=0, y=0, z=0)) == BoundingBox(
+ left=-100_000,
+ bottom=-100_000,
+ right=100_000,
+ top=100_000,
+ )
+
+ assert tms._ul(Tile(x=0, y=0, z=0)) == Coords(x=-100000.0, y=100000.0)
+ assert tms._lr(Tile(x=0, y=0, z=0)) == Coords(x=100000.0, y=-100000.0)
+
+ assert tms._ul(Tile(x=0, y=0, z=1)) == Coords(x=-100000.0, y=0.0)
+ assert tms._lr(Tile(x=0, y=0, z=1)) == Coords(x=0.0, y=-100000.0)
+
+ assert tms._ul(Tile(x=1, y=0, z=1)) == Coords(x=0.0, y=0.0)
+ assert tms._lr(Tile(x=1, y=0, z=1)) == Coords(x=100000.0, y=-100000.0)
+
+ assert tms._ul(Tile(x=0, y=1, z=1)) == Coords(x=-100000.0, y=100000.0)
+ assert tms._lr(Tile(x=0, y=1, z=1)) == Coords(x=0.0, y=0.0)
+
+ assert tms._ul(Tile(x=1, y=1, z=1)) == Coords(x=0.0, y=100000.0)
+ assert tms._lr(Tile(x=1, y=1, z=1)) == Coords(x=100000.0, y=0)
View it on GitLab: https://salsa.debian.org/debian-gis-team/morecantile/-/commit/197bae230b9efa7882ea6ea5dc2a8de7261f53fd
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/morecantile/-/commit/197bae230b9efa7882ea6ea5dc2a8de7261f53fd
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20260110/d3ac786b/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list