Skip to content

Consider unit-mismatch warning for aspect() planar path #2782

@brendancol

Description

@brendancol

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions