Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r.path: Support bitmask encoding CW from East #4943

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

HuidaeCho
Copy link
Member

This PR adds support for the power-of-two encoding CW from East (e.g., r.terraflow, ArcGIS).
image

The default bitmask encoding starts CW from NE, some programs use a 45-degree rotated (one bit shifted) version of the bitmask encoding (e.g. r.terraflow, ArcGIS). The new -e (East) flag uses y=2^((log2(x)+1)%8) to convert the latter encoding to the default one before tracing.

The PR also adds -b flag to avoid breaking lines unnecessarily for single-direction paths.

How to test in the NC sample dataset

r.terraflow elevation direction=dir -s
r.path dir vec=path scoor=638317.91,220399.94 -be
image

@HuidaeCho HuidaeCho self-assigned this Jan 12, 2025
@github-actions github-actions bot added raster Related to raster data processing C Related code is in C module labels Jan 12, 2025
@HuidaeCho HuidaeCho added enhancement New feature or request C Related code is in C and removed C Related code is in C module labels Jan 12, 2025
@HuidaeCho HuidaeCho merged commit 0c59bbc into OSGeo:main Jan 15, 2025
26 checks passed
@HuidaeCho HuidaeCho deleted the r_path_bitmask_east branch January 15, 2025 20:10
@petrasovaa petrasovaa added this to the 8.5.0 milestone Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C enhancement New feature or request module raster Related to raster data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants