- add
_tile_matrices_idx: Dict[str, int]
private attribute to improvematrices
lookup - change
xy_bounds()
andbounds()
methods to avoid calculation duplication
- remove
_geographic_crs
private attribute inTileMatrixSet
model breaking change - use
crs.geodetic_crs
property asgeographic_crs
breaking change
- better handle anti-meridian crossing bbox in
tms.tiles()
(author @ljstrnadiii, #154)
- ensure
TileMatrixSet._geographic_crs
is a pyproj CRS object (author @AndrewAnnex, #152) - add
python 3.12
support
- adds --tms optional argument to the shapes and tiles cli tools (author @AndrewAnnex, #151)
- handle 180th meridian case for
tms.tiles()
(author @ljstrnadiii, #150)
- enable custom decimation value for in
TileMatrixSet.custom
method (author @mccarthyryanc, #146)
- update pydantic
Field
usage to avoid deprecation in 3.0
- fix
id
forWGS1984Quad
TileMatrixSet (fromWorldCRS84Quad
toWGS1984Quad
)
-
fix
CRS
WKT type fromstring
toObject
(PROJJSON) (ref: opengeospatial/2D-Tile-Matrix-Set#89).# Before wkt = pyproj.CRS.from_epsg(3857).to_wkt() TileMatrixSet( ... crs={"wkt": wkt} ) # Now wkt = pyproj.CRS.from_epsg(3857).to_json_dict() TileMatrixSet( ... crs={"wkt": wkt} )
-
fix
CRS
parsing to allowwkt ({"wkt": ...})
anduri ({"uri": ...})
defined CRSTileMatrixSet( ... crs="http://www.opengis.net/def/crs/EPSG/0/3857" ) TileMatrixSet( ... crs={"uri": "http://www.opengis.net/def/crs/EPSG/0/3857"} ) wkt = pyproj.CRS.from_epsg(3857).to_wkt() TileMatrixSet( ... crs={"wkt": wkt} )
-
update
TileMatrixSet
representation to use CRS's URI -
remove default for
TileMatrixSet.pointOfOrigin
attribute (required) -
add
topLeft
default forTileMatrixSet.cornerOfOrigin
attribute -
renamed
morecantile.models.CRSType
->morecantile.models.CRS
- Simplify bounds calculation by using
TileMatrix.cellSize
instead ofTileMatrix.scaleDenominator
- remove
TileMatrixSet._resolution
private method
- Remove alias tiles in
.parent()
,.children()
,.neighbors()
and.tiles()
methods for Variable Matrix Width TileMatrixSets (#136)
Remove alias tiles in.parent()
,.children()
,.neighbors()
and.tiles()
methods for Variable Matrix Width TileMatrixSets (#136)
-
update pydantic requirement to
~=2.0
-
add support for TileMatrixSets with Variable Matrix Width
-
add
variableMatrixWidths
to theTileMatrix
model -
add
TileMatrixSet._lr()
(andlr()
) to retrieve the lower right coordinates of a tile (instead of using upper-left of tile+1) -
switch to
functools.cached_property
to cache properties (instead of cachetools.LRUcache) -
rename
_is_quadtree
property tois_quadtree
inTileMatrixSet
model -
fix possible bug in
TileMatrixSet._tile()
(and.tile()
) method to make sure x or y are not greater thanmatrixWidth - 1
ormatrixHeight - 1
- add
.srs
property toCRSType
- forward arguments to
pyproj.CRS
methods forto_epsg()
,to_wkt()
,to_proj4()
andto_json()
CRSType methods
- limit pydantic requirement to `~=1.0``
- add
to_proj4
andto_dict
andto_json
methods toCRSType
- remove
TileMatrixSet._crs
(replaced withTileMatrixSet.crs._pyproj_crs
)
- add
to_epsg()
andto_wkt()
methods toCRSType
to allow compatibility with4.0
import morecantile
tms = morecantile.tms.get("WebMercatorQuad")
tms.crs
>> CRSType(__root__='http://www.opengis.net/def/crs/EPSG/0/3857')
tms.crs.to_epsg()
>> 3857
tms._crs
>> <Projected CRS: EPSG:3857>
tms._crs.to_epsg()
>> 3857
- Change CRS attribute in model to align more with the TMS spec and fix some OpenAPI schema issues (It should be a string URI or WKT, not a pyproj.CRS)
- add
TileMatrixSet._crs
PrivateAttr to host thepyproj.CRS
version of the crs - update
grid_crs
properties inTileMatrixSet.feature()
result to return theTileMatrixSet.CRS
(uri/wkt) instead of EPSG code
- Fix TileMatrixSet BoundingBox definition (#122)
- Raise a
ValueError
whennan
bounds are passed totiles
(author @samn, #120)
- no change since
4.0.0a1
- Fix possible bug when a TileMatrixSet does not have
id
-
Remove assumption tile rows/cols are ordered in
TileMatrixSet.tiles()
method (author @fsvenson, #104) -
switch to TMS 2.0 specification (author @dchirst, #101). See https://developmentseed.org/morecantile/tms-v2/ for more info.
-
remove
NZTM2000
TileMatrixSet (ref: #103) -
add
rasterio_geographic_crs
to export TMS's geographic CRS to Rasterio's CRS object (author @AndrewAnnex, #109) -
add
geographic_crs
property in the TileMatrixSet model to return the private_geographic_crs
attribute -
add cache LRU layer on top of
TileMatrixSet.bbox
method -
changed the input type in
morecantile.defaults.TileMatrixSets.register()
fromSequence[TileMatrixSet]
toDict[str, TileMatrixSets]
my_custom_tms = ... # before defaults = morecantile.tms.register([my_custom_tms]) # now defaults = morecantile.tms.register({"MyCustomGrid": my_custom_tms})
-
made
id
andtitle
optional inmorecantile.TileMatrixSet.custom()
methodcrs = CRS.from_epsg(3031) extent = [-948.75, -543592.47, 5817.41, -3333128.95] # From https:///epsg.io/3031 # before tms = morecantile.TileMatrixSet.custom(extent, crs) print(tms.id, tms.title) >>> "Custom", "Custom TileMatrixSet" # now tms = morecantile.TileMatrixSet.custom(extent, crs) print(tms.id, tms.title) >>> None, None
-
remove
boundingBox
in TileMatrixSet definition when created withmorecantile.TileMatrixSet.custom
- [backported from 4.0] Remove assumption tile rows/cols are ordered in
TileMatrixSet.tiles()
method (author @fsvenson, #104) - [backported from 4.0] add
rasterio_geographic_crs
to export TMS's geographic CRS to Rasterio's CRS object (author @AndrewAnnex, #109) - [backported from 4.0] add
geographic_crs
property in the TileMatrixSet model to return the private_geographic_crs
attribute - [backported from 4.0] add cache LRU layer on top of
TileMatrixSet.bbox
method
- sort default TMS (author @jlaura, #98)
- Switch to ruff for linting and fixing linting issues
- Do not parse TMS json files automatically but wait for the TMS to be used
- fix
CanadianNAD83_LCC
,WorldMercatorWGS84Quad
andEuropeanETRS89_LAEAQuad
TMS - add
title
option inmorecantile custom
CLI
- fix
utils.meters_per_unit
for non earth bodies (author @AndrewAnnex, #92) - fix
CRS_to_uri
function to adds ability to export non-EPSG CRSs URIs (author @AndrewAnnex, #93)
- add
morecantile.defaults.TileMatrixSets
in export
- add python 3.11 support
- add python 3.10 support
- remove python 3.7 support
- switch to pyproject.toml
- add support for
foot
andUS survey foot
CRS (#86)
- fix issue with
zoom_for_res
when resolution is smaller than minzoom (author @samn, #84)
- add
parent
,children
,neighbors
,minmax
,is_valid
methods (#82)
breaking changes
- update
WebMercatorQuad
TMS to matchmercantile
andGDAL
definition of the half-earth value
- truncate geographic Lon/Lat inputs to the TMS geographic bbox instead of
-180., -90., 180., 90.
(#79) - remove
utils.truncate_lnglat
function (#79)
- Allow zoom_for_res to work for a TMS with a minzoom > 0 (author @samn, #78)
- add
WGS1984Quad
(WGS84/epgs:4326
) TileMatrixSet (#74)
- add
_geographic_crs
definition in__init__
to make sure it's initialized from user input (author @davenquinn, #72)
- rename
_to_wgs84
and_from_wgs84
private attributes to_to_geographic
and_from_geographic
(#68) - add
_geographic_crs
private attribute tomorecantile.TileMatrixSet
to define the CRS used in_to_geographic
and_from_geographic
(#68) - fix
TileMatrixSet._invert_axis
method to only check axis information (#71)
- no change since 3.0.0a1
- only import rasterio if needed (#66)
- add
.rasterio_crs
properties to TMS for compatibility with rasterio (#58) - Use new Class-like notation for namedtuple (#58)
breaking changes
- switch from rasterio to PyProj for CRS definition and projection transformation (#58)
- remove python 3.6 supports (because of pyproj)
-
add NZTM2000Quad tile matrix set from LINZ (author @blacha, #57)
-
add quadkey supports (@author adrian-knauer, #56)
import morecantile tms = morecantile.tms.get("WebMercatorQuad") # Tile to Quadkey tms.quadkey(486, 332, 10) >>> "0313102310" # Quadkey to Tile tms.quadkey_to_tile("0313102310") >>> Tile(486, 332, 10)
-
update
NZTM2000*
CRS uri fromhttps://www.opengis.net/def/crs/EPSG/0/2193
tourn:ogc:def:crs:EPSG:2193
(#61)
- fix wrong TMS boundingBox definition when using inverted CRS (#53)
- remove
mercantile
dependency. - raise
PointOutsideTMSBounds
warning when user is doing operations outside TMS bounds. - fix wrong
xy_bbox
whentms.boundingBox
use a specific CRS.
- add
zoom_level_strategy
option forTileMatrixSet.zoom_for_res
to match GDAL 3.2. By default, it is set toauto
, meaning that it will select the closest zoom level. User can set the strategy tolower
orupper
to select below or above zoom levels.
import morecantile
tms = morecantile.tms.get("WebMercatorQuad")
# native resolution of zoom 7 is 1222.9924 m
# native resolution of zoom 8 is 611.4962 m
assert tms.zoom_for_res(612.0) == 8
assert tms.zoom_for_res(612.0, zoom_level_strategy="lower") == 7
assert tms.zoom_for_res(612.0, zoom_level_strategy="upper") == 8
- simplify
morecantile.TileMatrixSet
default representation
from morecantile import tms
tms.get("WorldCRS84Quad")
>>> <TileMatrixSet title='CRS84 for the World' identifier='WorldCRS84Quad'>
print(tms.get("WorldCRS84Quad").json())
>>> {
'type': 'TileMatrixSetType',
'title': 'CRS84 for the World',
'abstract': None,
'keywords': None,
'identifier': 'WorldCRS84Quad',
'supportedCRS': CRS.from_epsg(4326),
'wellKnownScaleSet': AnyHttpUrl(...),
'boundingBox': {
'type': 'BoundingBoxType',
'crs': CRS.from_epsg(4326),
'lowerCorner': (-180.0, -90.0),
'upperCorner': (180.0, 90.0)},
'tileMatrix': [...]
}
- switch from
CoordBBox
torasterio.coords.BoundingBox
(ref: #38). - update
morecantile.commons
Tile and Coords to match rasterio's BoundingBox. - rename
morecantile.models.BoundingBox
tomorecantile.models.TMSBoundingBox
to avoind name colision with rasterio's BoundingBox. - improve default TMS immutability by making
morecantile.tms.register
to return a new TileMatrixSets instance (ref: #37)
import morecantile import TileMatrixSet, tms
from rasterio.crs import CRS
crs = CRS.from_epsg(3031)
extent = [-948.75, -543592.47, 5817.41, -3333128.95] # From https:///epsg.io/3031
custom_tms = TileMatrixSet.custom(extent, crs, identifier="MyCustomTmsEPSG3031")
print(len(tms.list()))
>>> 10
defaults = tms.register(custom_tms)
print(len(tms.list()))
>>> 10
print(len(defaults.list()))
>>> 11
- remove
pkg_resources
(pypa/setuptools#510, #36) - add
TILEMATRIXSET_DIRECTORY
to allow morecantile to load user's TMS
# Save custom TMS to a file
import morecantile
from rasterio.crs import CRS
crs = CRS.from_epsg(3031)
extent = [-948.75, -543592.47, 5817.41, -3333128.95] # From https:///epsg.io/3031
tms = morecantile.TileMatrixSet.custom(extent, crs, identifier="MyCustomTmsEPSG3031")
with open("/tmp/mytms/MyCustomTmsEPSG3031.json", "w") as f:
f.write(tms.json(exclude_none=True))
import os
os.environ["TILEMATRIXSET_DIRECTORY"] = "/tmp/mytms"
from morecantile import tms
assert "MyCustomTmsEPSG3031" in tms.list()
- fix TileMatrixSet's model schema bug where pydantic wasn't able to translate
Union[rasterio.crs.CRS, pydantic.AnyHttpUrl]
to a valid schema (ref: #34)
- Allow Custom CRS for custom TMS definition (#23)
- Extend TMS beyond TMS Document max zoom level (#28)
- Require rasterio >= 1.1.7 (sept 2020) to support inverted lat/lon TMS (ref: #26)
- Remove deprecated function
- Add
tms.xy_bbox
andtms.bbox
properties to return TileMatrixSet boundaries. - Add
tms.intersect_tms
to check if a bbox intersect with the TileMatrixSet boundaries. - Avoid out-range tiles (e.g. negative indexes)
- Add
tms.zoom_for_res
function to get the TMS zoom level for a specific resolution (#31).
- add TileMatrixSet minzoom/maxzoom properties
- fix TileMatrixSet.tile calculation
- add TileMatrixSet.tiles function (replicat from mercantile)
- add buffer and projected options to TileMatrixSet.feature method
- removes mercantile as dependencies
- add CLI
- renamed
morecantile.TileMatrixSet.point_towgs84
tomorecantile.TileMatrixSet.lnglat
(matches mercantile) - renamed
morecantile.TileMatrixSet.point_fromwgs84
tomorecantile.TileMatrixSet.xy
(matches mercantile) - add
truncate
option inmorecantile.TileMatrixSet.tile
(matches mercantile) - re-order buffer and precision options in
morecantile.TileMatrixSet.feature
(matches mercantile) - uses mercantile's tests
- Fix bad default TMS files (#13)
- Add regex in model for identifier validation
- better submodule definition
- add
morecantile.tms
object to access and register defaults TileMatrixSet - Add depreciation warning for
morecantile.TileMatrixSet.load
method
Major refactor of Morecantile, which is now based on OGC TileMatrixSet JSON documents.
- use pydantic model to validate TMS JSON documents (#6, author @geospatial-jeff)
- morecantile methods are part of the TMS model (#7)
- Rename defaults grids (#1)
- Initial release