From 91b821a87efdf1e8c61cf77d63805aca39ea8b37 Mon Sep 17 00:00:00 2001 From: Pete Schmitt Date: Thu, 3 Apr 2025 11:29:30 -0600 Subject: [PATCH 1/3] Add CHANGELOG.md --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0efae0f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ +# 1.1.0 (2020-01-03) +- Added new UTM5kmTiling tilescheme which aligns to the Maxar Analysis + Ready Data (ARD) grid. + +# 1.0.0 (2019-08-14) +- Added new UTM10kmTiling and UTM100kmTiling tile schemes. This + provides MGRS-like tilings at a particular zoom level in the + quadtree. +- Added multi zoom level capacity. Now you can pass several zoom + levels to cover_geometry and it will generate the biggest tiles + availables using those zoom levels. Example: + + tilecover.cover_geometry(tiler, geom, [16, 17, 19]) + +- Tiletanic now requires python >= 3.6 + +# 0.0.5 (2016-04-20) +- Added new tilecover CLI. To learn more, run + + tiletanic cover-geometry --help + +# 0.0.4 (2015-11-07) +- Added new WebMercator tile scheme + +# 0.0.3 (2015-11-04) +- Initial Release with DGTiling tile scheme From ddeeac9179d9bec3158b09b342489877879f7e90 Mon Sep 17 00:00:00 2001 From: Pete Schmitt Date: Thu, 3 Apr 2025 14:03:42 -0600 Subject: [PATCH 2/3] Remove python geojson dependency. Closes #8 --- CHANGELOG.md | 3 +++ requirements-dev.txt | 1 - setup.py | 1 - tiletanic/cli.py | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0efae0f..d3fe694 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# Next +- Remove geojson dependency + # 1.1.0 (2020-01-03) - Added new UTM5kmTiling tilescheme which aligns to the Maxar Analysis Ready Data (ARD) grid. diff --git a/requirements-dev.txt b/requirements-dev.txt index 10fb174..5f97832 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,3 @@ click -geojson pytest>=5.0 Shapely>=1.6 diff --git a/setup.py b/setup.py index c7e89b0..8b0bbde 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,6 @@ include_package_data=True, zip_safe=False, install_requires=['click', - 'geojson', 'shapely>=1.6'], entry_points=''' [console_scripts] diff --git a/tiletanic/cli.py b/tiletanic/cli.py index 8cedb1a..db3153b 100644 --- a/tiletanic/cli.py +++ b/tiletanic/cli.py @@ -3,7 +3,7 @@ # Add documentation - how to run with a file vs stdout, document arguments, etc. import click -import geojson +import json from shapely import geometry, ops, prepared import tiletanic @@ -74,7 +74,7 @@ def cover_geometry(tilescheme, aoi_geojson, zoom, adjacent, quadkey): else: raise ValueError("tilescheme '{}' is unsupported.").format(tilescheme) - aoi = geojson.loads( aoi_geojson.read() ) + aoi = json.loads( aoi_geojson.read() ) if 'type' not in aoi: raise ValueError("The 'AOI_GEOJSON' doesn't have a 'type' member. Is it valid GeoJSON?") From fc2070fe994f1e87f42118896c39a6f24f300777 Mon Sep 17 00:00:00 2001 From: Pete Schmitt Date: Thu, 3 Apr 2025 15:05:18 -0600 Subject: [PATCH 3/3] Add suport for cover-geometry CLI to accept more GeoJSON geom types --- CHANGELOG.md | 3 +++ tiletanic/cli.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3fe694..7829e09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Next +- Add `tiletanic cover-geometry` support for a variety of GeoJSON + geometry types (Point, MultiPoint, Polygon, MultiPolygon, + LineString, MultiLineString). - Remove geojson dependency # 1.1.0 (2020-01-03) diff --git a/tiletanic/cli.py b/tiletanic/cli.py index db3153b..b355650 100644 --- a/tiletanic/cli.py +++ b/tiletanic/cli.py @@ -84,9 +84,11 @@ def cover_geometry(tilescheme, aoi_geojson, zoom, adjacent, quadkey): if f['geometry']['type'].endswith('Polygon')]) elif aoi['type'] == 'Feature': geom = geometry.shape(aoi['geometry']) + elif aoi['type'] in set(['Point', 'MultiPoint', 'Polygon', 'MultiPolygon', 'LineString', 'MultiLineString']): + geom = geometry.shape(aoi) else: raise ValueError("The AOI_GEOJSON 'type' %s is unsupported, " % aoi['type'] + - "it must be 'Feature' or 'FeatureCollection'") + "it must be Feature, FeatureCollection or a standard GeoJSON Geometry (Point, LineString, Polygon, MultiPolygon, etc.)") tiles = tiletanic.tilecover.cover_geometry(scheme, geom, zoom)