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

Use distance unit from project's CRS for Stakeout panel #2826

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

iiLubos
Copy link
Contributor

@iiLubos iiLubos commented Oct 3, 2023

CU-861nbagwq
https://wishlist.merginmaps.com/p/yards-as-unit-for-stakeout

In case of distance in feet:
image

@iiLubos iiLubos requested a review from tomasMizera October 3, 2023 10:08
app/inpututils.cpp Outdated Show resolved Hide resolved
app/inpututils.cpp Outdated Show resolved Hide resolved
app/inpututils.cpp Outdated Show resolved Hide resolved
@iiLubos iiLubos requested a review from PeterPetrik October 3, 2023 13:29
@PeterPetrik
Copy link
Contributor

For testing @jozef-budac

map canvas crs in meters
override to feets in qgis project settings

image

@jozef-budac
Copy link

jozef-budac commented Oct 4, 2023

Everything works well. I just verified, that changing units for distance in project preferences changes also units in staking in input

@PeterPetrik
Copy link
Contributor

unrelated test failures

@PeterPetrik
Copy link
Contributor

@iiLubos can you an unit tests here https://github.com/MerginMaps/input/blob/897285b166a56d47af6c935d96aaa278ad48641f/app/test/testutilsfunctions.cpp#L170

I suggest
1/ Create function (not Q_INVOCABLE) String InputUtils::formatDistanceInDistanceUnit( const double distanceInMeters, int precision, Qgis::DistanceUnit distUnit ).
2/ Only test this new function formatDistanceInDistanceUnit, so tests are not dependent on all QgsProject

@tomasMizera
Copy link
Collaborator

@iiLubos We will merge this one, please add the test in another PR

@tomasMizera tomasMizera merged commit c1fe78e into master Oct 5, 2023
9 of 11 checks passed
@tomasMizera tomasMizera deleted the master_distanceUnits branch October 5, 2023 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants