Follow-up from #2764 / PR #2777.
slope() now warns when the planar path sees degree (lat/lon) coordinates with meter elevation. The review noted aspect() has a related footgun.
The case is weaker for aspect than for slope: aspect returns the direction of steepest descent (an atan2 of gradients), so a uniform degree-to-meter scale on both axes mostly cancels out. The planar aspect dispatch does not even read the coordinate resolution. Where it does matter is anisotropy: at non-equatorial latitudes the degree-to-meter ratio differs between the x and y axes, which skews the computed direction.
Worth deciding whether aspect() should call warn_if_unit_mismatch (xrspatial/utils.py:781) on its planar branch, or whether the anisotropy effect is small enough to leave alone. Filing separately so PR #2777 stays scoped to slope.
Follow-up from #2764 / PR #2777.
slope()now warns when the planar path sees degree (lat/lon) coordinates with meter elevation. The review notedaspect()has a related footgun.The case is weaker for aspect than for slope: aspect returns the direction of steepest descent (an atan2 of gradients), so a uniform degree-to-meter scale on both axes mostly cancels out. The planar aspect dispatch does not even read the coordinate resolution. Where it does matter is anisotropy: at non-equatorial latitudes the degree-to-meter ratio differs between the x and y axes, which skews the computed direction.
Worth deciding whether
aspect()should callwarn_if_unit_mismatch(xrspatial/utils.py:781) on its planar branch, or whether the anisotropy effect is small enough to leave alone. Filing separately so PR #2777 stays scoped to slope.