rio-tiler 7.2.2__py3-none-any.whl → 7.3.0__py3-none-any.whl

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.
rio_tiler/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """rio-tiler."""
2
2
 
3
- __version__ = "7.2.2"
3
+ __version__ = "7.3.0"
4
4
 
5
5
  from . import ( # noqa
6
6
  colormap,
rio_tiler/utils.py CHANGED
@@ -133,6 +133,8 @@ def get_array_statistics(
133
133
  else:
134
134
  coverage = numpy.ones((data.shape[1], data.shape[2]))
135
135
 
136
+ coverage_pixels = numpy.count_nonzero(coverage)
137
+
136
138
  # Avoid non masked nan/inf values
137
139
  numpy.ma.fix_invalid(data, copy=False)
138
140
 
@@ -143,7 +145,7 @@ def get_array_statistics(
143
145
 
144
146
  valid_pixels = float(numpy.ma.count(data[b]))
145
147
  masked_pixels = float(numpy.ma.count_masked(data[b]))
146
- valid_percent = round((valid_pixels / data[b].size) * 100, 2)
148
+ valid_percent = round(min(valid_pixels / coverage_pixels, 1) * 100, 2)
147
149
 
148
150
  if categorical:
149
151
  out_dict = dict(zip(keys.tolist(), counts.tolist()))
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: rio-tiler
3
- Version: 7.2.2
3
+ Version: 7.3.0
4
4
  Summary: User friendly Rasterio plugin to read raster datasets.
5
5
  Project-URL: Homepage, https://cogeotiff.github.io/rio-tiler/
6
6
  Project-URL: Documentation, https://cogeotiff.github.io/rio-tiler/
@@ -37,17 +37,19 @@ License: BSD 3-Clause License
37
37
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
38
38
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39
39
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
+ License-File: AUTHORS.txt
41
+ License-File: LICENSE
40
42
  Keywords: COGEO,Cloud Optimized Geotiff,STAC,rasterio,slippy-map
41
43
  Classifier: Intended Audience :: Information Technology
42
44
  Classifier: Intended Audience :: Science/Research
43
45
  Classifier: License :: OSI Approved :: BSD License
44
- Classifier: Programming Language :: Python :: 3.8
45
46
  Classifier: Programming Language :: Python :: 3.9
46
47
  Classifier: Programming Language :: Python :: 3.10
47
48
  Classifier: Programming Language :: Python :: 3.11
48
49
  Classifier: Programming Language :: Python :: 3.12
50
+ Classifier: Programming Language :: Python :: 3.13
49
51
  Classifier: Topic :: Scientific/Engineering :: GIS
50
- Requires-Python: >=3.8
52
+ Requires-Python: >=3.9
51
53
  Requires-Dist: attrs
52
54
  Requires-Dist: cachetools
53
55
  Requires-Dist: color-operations
@@ -1,4 +1,4 @@
1
- rio_tiler/__init__.py,sha256=dShDwRuOOASdRz5UvqGC61lqPzE1q00kVIkNIEJK6m0,192
1
+ rio_tiler/__init__.py,sha256=3yPtQUY6hUBWtEbFnbqu1Zh46mGK9Ch3eiEi72aJy7g,192
2
2
  rio_tiler/colormap.py,sha256=Ale0ToTrEKwP3JOhrySYKuQsfeeTgJT1YGBcmdssJ0k,11411
3
3
  rio_tiler/constants.py,sha256=55i-7JZDupTXZdLgxL03KsgM4lAzuGuIVP1zZKktzp0,426
4
4
  rio_tiler/errors.py,sha256=4I3i0e1FtkLX5sIX6dfhUMUj3SWWoKqkjCkSG7k5i2M,1901
@@ -10,7 +10,7 @@ rio_tiler/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  rio_tiler/reader.py,sha256=FiDQQU_v8mDk2JTxBpLmsTqaCQFOsjOw0LocasLeXjk,22721
11
11
  rio_tiler/tasks.py,sha256=tiQo24rZHBVxids40QkNInuMzDFEei08zYW3I_pkSVE,3157
12
12
  rio_tiler/types.py,sha256=wrGiiGBQ-WdzHf-lEypiH3cub7Knu_rXJw7EWZ2FAS8,1632
13
- rio_tiler/utils.py,sha256=X3gV8UJGP1LNvFbmFvuNjqeGVV0Iwsgw7-zbCPJwXec,29796
13
+ rio_tiler/utils.py,sha256=okDKTIKitoDMefhpz3XiAZeR1JWcw9Br9BrVMlmmzxM,29858
14
14
  rio_tiler/cmap_data/__init__.py,sha256=8FtVmfpTjXlvhxQ5QesN0UC1m_B3MuF3LbGbhMC5Rw4,1039
15
15
  rio_tiler/cmap_data/accent.npy,sha256=Qde1ldOoXghe4L05v1QbVvnMA1ldwNjKWPf5xCBbmI4,1152
16
16
  rio_tiler/cmap_data/accent_r.npy,sha256=ba-GWSMSPRAcm9CGzlXJeNG4ABbBHDCV602hAWV2idc,1152
@@ -233,8 +233,8 @@ rio_tiler/mosaic/reader.py,sha256=_YBwTJwHvXOzKwpNpOmmh0F4yicyxgWo9vHyof3w_Do,96
233
233
  rio_tiler/mosaic/methods/__init__.py,sha256=tgkXM9skaTLXIm5QFoheOEznQXM97KGflcAWHfkrt1g,612
234
234
  rio_tiler/mosaic/methods/base.py,sha256=9YZJWVRwH5Fk9KO9q5CW52Q8Mf60tAJ21oM4ixEDXBo,1424
235
235
  rio_tiler/mosaic/methods/defaults.py,sha256=z34lna2wGXnAPwculjk_6hDrloqS8wzer68FFoIo7pg,6744
236
- rio_tiler-7.2.2.dist-info/METADATA,sha256=jbfLAj3UTICL7Kr3ax_ow29V_5z_rtMwmW1b6iZ4xnw,12202
237
- rio_tiler-7.2.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
238
- rio_tiler-7.2.2.dist-info/licenses/AUTHORS.txt,sha256=FCVd4Tjg-8syl0ZugCunpXER8X2-XonW2ZfllyTnRvE,158
239
- rio_tiler-7.2.2.dist-info/licenses/LICENSE,sha256=vq8Tt4KoYQT9JxAjQ4yXMmmhFYRTsBRgrOj-ao-bC5o,1517
240
- rio_tiler-7.2.2.dist-info/RECORD,,
236
+ rio_tiler-7.3.0.dist-info/METADATA,sha256=DnzEcej-GfaW0oHvzCnVfGQ2SSKgMfXe4ogrhmpyJJw,12251
237
+ rio_tiler-7.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
238
+ rio_tiler-7.3.0.dist-info/licenses/AUTHORS.txt,sha256=FCVd4Tjg-8syl0ZugCunpXER8X2-XonW2ZfllyTnRvE,158
239
+ rio_tiler-7.3.0.dist-info/licenses/LICENSE,sha256=vq8Tt4KoYQT9JxAjQ4yXMmmhFYRTsBRgrOj-ao-bC5o,1517
240
+ rio_tiler-7.3.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any