Allow casting Image to QuadMesh
@@ -569,6 +569,11 @@ class QuadMesh(Raster):
def _process_data(self, data):
+ if isinstance(data, Image):
+ x = data.dimension_values(0, expanded=False)
+ y = data.dimension_values(1, expanded=False)
+ zarray = data.dimension_values(2, flat=False)
+ else:
data = tuple(np.array(el) for el in data)
x, y, zarray = data
ys, xs = zarray.shape
