yirgacheffe 1.8.0__py3-none-any.whl → 1.8.1__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.
Potentially problematic release.
This version of yirgacheffe might be problematic. Click here for more details.
- yirgacheffe/__init__.py +1 -0
- yirgacheffe/_backends/enumeration.py +20 -0
- yirgacheffe/layers/vectors.py +29 -29
- yirgacheffe/window.py +3 -1
- {yirgacheffe-1.8.0.dist-info → yirgacheffe-1.8.1.dist-info}/METADATA +1 -1
- {yirgacheffe-1.8.0.dist-info → yirgacheffe-1.8.1.dist-info}/RECORD +10 -10
- {yirgacheffe-1.8.0.dist-info → yirgacheffe-1.8.1.dist-info}/WHEEL +0 -0
- {yirgacheffe-1.8.0.dist-info → yirgacheffe-1.8.1.dist-info}/entry_points.txt +0 -0
- {yirgacheffe-1.8.0.dist-info → yirgacheffe-1.8.1.dist-info}/licenses/LICENSE +0 -0
- {yirgacheffe-1.8.0.dist-info → yirgacheffe-1.8.1.dist-info}/top_level.txt +0 -0
yirgacheffe/__init__.py
CHANGED
|
@@ -15,5 +15,6 @@ except ModuleNotFoundError:
|
|
|
15
15
|
from ._core import read_raster, read_rasters, read_shape, read_shape_like, constant, read_narrow_raster
|
|
16
16
|
from .constants import WGS_84_PROJECTION
|
|
17
17
|
from .window import Area, MapProjection, Window
|
|
18
|
+
from ._backends.enumeration import dtype as DataType
|
|
18
19
|
|
|
19
20
|
gdal.UseExceptions()
|
|
@@ -41,6 +41,26 @@ class operators(Enum):
|
|
|
41
41
|
ISNAN = 36
|
|
42
42
|
|
|
43
43
|
class dtype(Enum):
|
|
44
|
+
"""Represents the type of data returned by a layer.
|
|
45
|
+
|
|
46
|
+
This enumeration defines the valid data types supported by Yirgacheffe, and is
|
|
47
|
+
what is returned by calling `datatype` on a layer or expression, and can be
|
|
48
|
+
passed to `astype` to convert values between types.
|
|
49
|
+
|
|
50
|
+
Attributes:
|
|
51
|
+
Float32: 32 bit floating point value
|
|
52
|
+
Float64: 64 bit floating point value
|
|
53
|
+
Byte: Unsigned 8 bit integer value
|
|
54
|
+
Int8: Signed 8 bit integer value
|
|
55
|
+
Int16: Signed 16 bit integer value
|
|
56
|
+
Int32: Signed 32 bit integer value
|
|
57
|
+
Int64: Signed 64 bit integer value
|
|
58
|
+
UInt8: Unsigned 8 bit integer value
|
|
59
|
+
UInt16: Unsigned 16 bit integer value
|
|
60
|
+
UInt32: Unsigned 32 bit integer value
|
|
61
|
+
UInt64: Unsigned 64 bit integer value
|
|
62
|
+
"""
|
|
63
|
+
|
|
44
64
|
Float32 = gdal.GDT_Float32
|
|
45
65
|
Float64 = gdal.GDT_Float64
|
|
46
66
|
Byte = gdal.GDT_Byte
|
yirgacheffe/layers/vectors.py
CHANGED
|
@@ -333,36 +333,36 @@ class VectorLayer(YirgacheffeLayer):
|
|
|
333
333
|
self._anchor = anchor
|
|
334
334
|
self._envelopes = envelopes
|
|
335
335
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
336
|
+
if projection is not None:
|
|
337
|
+
# Get the area, but scale it to the pixel resolution that we're using. Note that
|
|
338
|
+
# the pixel scale GDAL uses can have -ve values, but those will mess up the
|
|
339
|
+
# ceil/floor math, so we use absolute versions when trying to round.
|
|
340
|
+
abs_xstep, abs_ystep = abs(projection.xstep), abs(projection.ystep)
|
|
341
|
+
|
|
342
|
+
# Lacking any other reference, we will make the raster align with
|
|
343
|
+
# (0.0, 0.0), if sometimes we want to align with an existing raster, so if
|
|
344
|
+
# an anchor is specified, ensure we use that as our pixel space alignment
|
|
345
|
+
x_anchor = anchor[0]
|
|
346
|
+
y_anchor = anchor[1]
|
|
347
|
+
left_shift = x_anchor - abs_xstep
|
|
348
|
+
right_shift = x_anchor
|
|
349
|
+
top_shift = y_anchor
|
|
350
|
+
bottom_shift = y_anchor - abs_ystep
|
|
351
|
+
|
|
352
|
+
area = Area(
|
|
353
|
+
left=(floor((min(x[0] for x in envelopes) - left_shift) / abs_xstep) * abs_xstep) + left_shift,
|
|
354
|
+
top=(ceil((max(x[3] for x in envelopes) - top_shift) / abs_ystep) * abs_ystep) + top_shift,
|
|
355
|
+
right=(ceil((max(x[1] for x in envelopes) - right_shift) / abs_xstep) * abs_xstep) + right_shift,
|
|
356
|
+
bottom=(floor((min(x[2] for x in envelopes) - bottom_shift) / abs_ystep) * abs_ystep) + bottom_shift,
|
|
357
|
+
)
|
|
358
|
+
else:
|
|
359
359
|
# If we don't have a projection just go with the idealised area
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
360
|
+
area = Area(
|
|
361
|
+
left=floor(min(x[0] for x in envelopes)),
|
|
362
|
+
top=ceil(max(x[3] for x in envelopes)),
|
|
363
|
+
right=ceil(max(x[1] for x in envelopes)),
|
|
364
|
+
bottom=floor(min(x[2] for x in envelopes)),
|
|
365
|
+
)
|
|
366
366
|
|
|
367
367
|
super().__init__(area, projection)
|
|
368
368
|
|
yirgacheffe/window.py
CHANGED
|
@@ -72,7 +72,9 @@ class Area:
|
|
|
72
72
|
def __hash__(self):
|
|
73
73
|
return (self.left, self.top, self.right, self.bottom).__hash__()
|
|
74
74
|
|
|
75
|
-
def __eq__(self, other) -> bool:
|
|
75
|
+
def __eq__(self, other: object) -> bool:
|
|
76
|
+
if not isinstance(other, Area):
|
|
77
|
+
return False
|
|
76
78
|
return math.isclose(self.left, other.left, abs_tol=1e-09) and \
|
|
77
79
|
math.isclose(self.right, other.right, abs_tol=1e-09) and \
|
|
78
80
|
math.isclose(self.top, other.top, abs_tol=1e-09) and \
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
yirgacheffe/__init__.py,sha256=
|
|
1
|
+
yirgacheffe/__init__.py,sha256=OOzfXtafPoDpAsNRC08BXjmwv0hBp-mNFCjwplGs9lY,668
|
|
2
2
|
yirgacheffe/_core.py,sha256=AU6tlqovBV_l1dNZs6AlHSw59Z0U6pStUaQZvJGiLhM,5721
|
|
3
3
|
yirgacheffe/_operators.py,sha256=OiR4pCVILmdXDmG37YILJuYjcxZlRussrJC7DeyoOts,36070
|
|
4
4
|
yirgacheffe/constants.py,sha256=uCWJwec3-ND-zVxYbsk1sdHKANl3ToNCTPg7MZb0j2g,434
|
|
5
5
|
yirgacheffe/operators.py,sha256=nw-BpnAwTjCwFtjosa8wKd2MGUuC0PJR5jACFdLhqCg,412
|
|
6
6
|
yirgacheffe/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
yirgacheffe/rounding.py,sha256=ZNuAaxsWfzYETC_G9H5weY1ZOci2pihEKTVrUiIqfZw,2257
|
|
8
|
-
yirgacheffe/window.py,sha256
|
|
8
|
+
yirgacheffe/window.py,sha256=WTCqX4Tw24siD0l13Pxl-GPufiC5M1OwZfhrNmJe_Gg,8986
|
|
9
9
|
yirgacheffe/_backends/__init__.py,sha256=jN-2iRrHStnPI6cNL7XhwhsROtI0EaGfIrbF5c-ECV0,334
|
|
10
|
-
yirgacheffe/_backends/enumeration.py,sha256=
|
|
10
|
+
yirgacheffe/_backends/enumeration.py,sha256=9bcCXz9Ssrh8Oh1iazodkx6Gm2kQBi9HQ9z9zehS4AE,1806
|
|
11
11
|
yirgacheffe/_backends/mlx.py,sha256=U1gl1lK1mZXLEET6ylF1TNs6WJ0PBEvfSk7ppn28n8w,6203
|
|
12
12
|
yirgacheffe/_backends/numpy.py,sha256=Gxx49JJH79GFEkKIpV6IyjCUcdtN5-qLlzRfylzKhS4,4142
|
|
13
13
|
yirgacheffe/layers/__init__.py,sha256=mYKjw5YTcMNv_hMy7a6K4yRzIuNUbR8WuBTw4WIAmSk,435
|
|
@@ -18,10 +18,10 @@ yirgacheffe/layers/group.py,sha256=yaqf-ra_Vh59yrWcz7-OvJ1fBnTcBXZd18AfRDN5Ymo,1
|
|
|
18
18
|
yirgacheffe/layers/h3layer.py,sha256=Rq1bFo7CApIh5NdBcV7hSj3hm-DszY79nhYsTRAvJ_g,9916
|
|
19
19
|
yirgacheffe/layers/rasters.py,sha256=zBE9uXm6LvAQF2_XdQzcOgJQOQWGmuPflY5JNDrUf3k,13527
|
|
20
20
|
yirgacheffe/layers/rescaled.py,sha256=gEFbXeYxX1nVn7eQYmbGww90_yc5ENmgQrD_WxXxpQE,3352
|
|
21
|
-
yirgacheffe/layers/vectors.py,sha256=
|
|
22
|
-
yirgacheffe-1.8.
|
|
23
|
-
yirgacheffe-1.8.
|
|
24
|
-
yirgacheffe-1.8.
|
|
25
|
-
yirgacheffe-1.8.
|
|
26
|
-
yirgacheffe-1.8.
|
|
27
|
-
yirgacheffe-1.8.
|
|
21
|
+
yirgacheffe/layers/vectors.py,sha256=A27kuTr0C9BZhHG0-cplNEa7aSNcse37Pm9xTjEzv-c,19990
|
|
22
|
+
yirgacheffe-1.8.1.dist-info/licenses/LICENSE,sha256=dNSHwUCJr6axStTKDEdnJtfmDdFqlE3h1NPCveqPfnY,757
|
|
23
|
+
yirgacheffe-1.8.1.dist-info/METADATA,sha256=iPbaENoRBTey7wYvg3OUTKjkulgoFS0wcwJoRJ2HcYQ,23797
|
|
24
|
+
yirgacheffe-1.8.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
25
|
+
yirgacheffe-1.8.1.dist-info/entry_points.txt,sha256=j4KgHXbVGbGyfTySc1ypBdERpfihO4WNjppvCdE9HjE,52
|
|
26
|
+
yirgacheffe-1.8.1.dist-info/top_level.txt,sha256=9DBFlKO2Ld3hG6TuE3qOTd3Tt8ugTiXil4AN4Wr9_y0,12
|
|
27
|
+
yirgacheffe-1.8.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|