weiji14 / zen3geo

The 🌏 data science library you've been waiting for~
http://zen3geo.rtfd.io/en/latest/walkthrough.html
GNU Lesser General Public License v3.0
77 stars 3 forks source link

:bug: Fix DatashaderRasterizer to allow N:1 instead of just 1:1 #98

Closed weiji14 closed 1 year ago

weiji14 commented 1 year ago

Used the wrong boolean operator (should be and, not or) which meant DatashaderRasterizer didn't work when the vector_datapipe was length 1 and canvas_datapipe was length 2 or more. This prevents false errors like ValueError: Unmatched lengths for the canvas datapipe (XarrayCanvasIterDataPipe) and vector datapipe (PyogrioReaderIterDataPipe). The vector datapipe's length (1) should either be (1) to allow for broadcasting, or match the canvas datapipe's length of (2).

Patches the bugfix at #39 from zen3geo v0.3.0. Also updated a unit test to use a 2:1 canvas:vector ratio to prevent regression.