morecantile 5.3.1__tar.gz → 5.4.0__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 (29) hide show
  1. {morecantile-5.3.1 → morecantile-5.4.0}/PKG-INFO +1 -1
  2. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/__init__.py +1 -1
  3. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/scripts/cli.py +25 -6
  4. {morecantile-5.3.1 → morecantile-5.4.0}/pyproject.toml +1 -1
  5. {morecantile-5.3.1 → morecantile-5.4.0}/.gitignore +0 -0
  6. {morecantile-5.3.1 → morecantile-5.4.0}/.pre-commit-config.yaml +0 -0
  7. {morecantile-5.3.1 → morecantile-5.4.0}/LICENSE +0 -0
  8. {morecantile-5.3.1 → morecantile-5.4.0}/README.md +0 -0
  9. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/commons.py +0 -0
  10. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/CDB1GlobalGrid.json +0 -0
  11. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/CanadianNAD83_LCC.json +0 -0
  12. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/EuropeanETRS89_LAEAQuad.json +0 -0
  13. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/GNOSISGlobalGrid.json +0 -0
  14. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/LINZAntarticaMapTilegrid.json +0 -0
  15. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/NZTM2000Quad.json +0 -0
  16. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/README.md +0 -0
  17. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/UPSAntarcticWGS84Quad.json +0 -0
  18. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/UPSArcticWGS84Quad.json +0 -0
  19. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/UTM31WGS84Quad.json +0 -0
  20. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/WGS1984Quad.json +0 -0
  21. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/WebMercatorQuad.json +0 -0
  22. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/WorldCRS84Quad.json +0 -0
  23. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/data/WorldMercatorWGS84Quad.json +0 -0
  24. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/defaults.py +0 -0
  25. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/errors.py +0 -0
  26. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/models.py +0 -0
  27. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/py.typed +0 -0
  28. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/scripts/__init__.py +0 -0
  29. {morecantile-5.3.1 → morecantile-5.4.0}/morecantile/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: morecantile
3
- Version: 5.3.1
3
+ Version: 5.4.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>
@@ -8,7 +8,7 @@ Refs:
8
8
 
9
9
  """
10
10
 
11
- __version__ = "5.3.1"
11
+ __version__ = "5.4.0"
12
12
 
13
13
  from .commons import BoundingBox, Coords, Tile # noqa
14
14
  from .defaults import TileMatrixSets, tms # noqa
@@ -184,6 +184,11 @@ def cli(ctx, verbose, quiet):
184
184
  default=None,
185
185
  help="Shift shape x and y values by a constant number",
186
186
  )
187
+ @click.option(
188
+ "--tms",
189
+ help="Path to TileMatrixSet JSON file.",
190
+ type=click.Path(),
191
+ )
187
192
  @click.pass_context
188
193
  def shapes( # noqa: C901
189
194
  ctx,
@@ -198,6 +203,7 @@ def shapes( # noqa: C901
198
203
  collect,
199
204
  extents,
200
205
  buffer,
206
+ tms,
201
207
  ):
202
208
  """
203
209
  Reads one or more Web Mercator tile descriptions
@@ -217,7 +223,10 @@ def shapes( # noqa: C901
217
223
  the properties object of the output feature.
218
224
 
219
225
  """
220
- tms = morecantile.tms.get(identifier)
226
+ tilematrixset = morecantile.tms.get(identifier)
227
+ if tms:
228
+ with open(tms, "r") as f:
229
+ tilematrixset = morecantile.TileMatrixSet(**json.load(f))
221
230
 
222
231
  dump_kwds = {"sort_keys": True}
223
232
  if indent:
@@ -243,7 +252,7 @@ def shapes( # noqa: C901
243
252
  else:
244
253
  raise click.BadParameter("{0}".format(obj), param=input, param_hint="input")
245
254
 
246
- feature = tms.feature(
255
+ feature = tilematrixset.feature(
247
256
  (x, y, z),
248
257
  fid=fid,
249
258
  props=props,
@@ -273,7 +282,7 @@ def shapes( # noqa: C901
273
282
  click.echo(
274
283
  json.dumps(
275
284
  {"type": "FeatureCollection", "bbox": bbox, "features": features},
276
- **dump_kwds
285
+ **dump_kwds,
277
286
  )
278
287
  )
279
288
 
@@ -302,8 +311,13 @@ def shapes( # noqa: C901
302
311
  default=False,
303
312
  help="Write a RS-delimited JSON sequence (default is LF).",
304
313
  )
314
+ @click.option(
315
+ "--tms",
316
+ help="Path to TileMatrixSet JSON file.",
317
+ type=click.Path(),
318
+ )
305
319
  @click.pass_context
306
- def tiles(ctx, zoom, input, identifier, seq): # noqa: C901
320
+ def tiles(ctx, zoom, input, identifier, seq, tms): # noqa: C901
307
321
  """
308
322
  Lists TMS tiles at ZOOM level intersecting
309
323
  GeoJSON [west, south, east, north] bounding boxen, features, or
@@ -324,7 +338,10 @@ def tiles(ctx, zoom, input, identifier, seq): # noqa: C901
324
338
  [853, 1551, 12]
325
339
 
326
340
  """
327
- tms = morecantile.tms.get(identifier)
341
+ tilematrixset = morecantile.tms.get(identifier)
342
+ if tms:
343
+ with open(tms, "r") as f:
344
+ tilematrixset = morecantile.TileMatrixSet(**json.load(f))
328
345
 
329
346
  for obj in normalize_source(input):
330
347
  if isinstance(obj, list):
@@ -362,7 +379,9 @@ def tiles(ctx, zoom, input, identifier, seq): # noqa: C901
362
379
  east -= epsilon
363
380
  north -= epsilon
364
381
 
365
- for tile in tms.tiles(west, south, east, north, [zoom], truncate=False):
382
+ for tile in tilematrixset.tiles(
383
+ west, south, east, north, [zoom], truncate=False
384
+ ):
366
385
  vals = (tile.x, tile.y, zoom)
367
386
  output = json.dumps(vals)
368
387
  if seq:
@@ -113,7 +113,7 @@ filterwarnings = [
113
113
  ]
114
114
 
115
115
  [tool.bumpversion]
116
- current_version = "5.3.1"
116
+ current_version = "5.4.0"
117
117
 
118
118
  search = "{current_version}"
119
119
  replace = "{new_version}"
File without changes
File without changes
File without changes