On 7/18/19 9:28 AM, Oliver Eichler wrote:
> Hi Harry,
>
> it's very likely that there are a couple of bugs in unit conversion when
> using imperial units. This is not really in the focus of development as none
> of the developers really uses it. And so far no one really using imperial
> units is willing to debug and fix.
>
> Oliver
>
>> Gesendet: Mittwoch, 17. Juli 2019 um 16:08 Uhr
>> Von: "Harry G McGavran Jr" <[email protected]>
>> An: qlandkarte <[email protected]>
>> Betreff: [Qlandkartegt-users] qmapshack - Clone Waypoint
>>
>> I'm using Qmapshack - developer version from the repository
>> on Ubuntu Xenial.
>>
>> If I right click a waypoint and select
>>
>> "Clone waypoint and move clone a given distance and angle"
>>
>> I get a popup window that has entries for "ft" and "degrees".
>>
>> I have Qmapshack configured for feet and decimal degrees.
>>
>> However when I invoke that popup window it moves the clone
>> a distance as if the "feet" I entered were METERS.
>>
>> If I change that entry to be in METERS instead, it works
>> correctly.
>>
>> I haven't checked other versions of Qmapshack for this bug.
>>
>>
>>
>> _______________________________________________
>> Qlandkartegt-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users
>>
>
>
Hi Oliver --
I finally decided to try to fix this myself with the latest repository
qmapshack. There seems to be only one function in the current code for
converting distances that are input by the user to meters, and that
is "elevation2meters". The problem here is not with elevation, but
instead with moving a waypoint a specified distance. However, that
function does the correct conversion, so rather than writing a new
"distance2meters" function, I just used elevation2meters, as that
is only a 1 line change to the code. The patch file is
attached and included below in case the attachment gets stripped.
====================================================
*** ./qmapshack/src/qmapshack/gis/wpt/CProjWpt.cpp.orig 2019-06-23
09:25:45.815261251 -0600
--- ./qmapshack/src/qmapshack/gis/wpt/CProjWpt.cpp 2019-08-01
19:26:10.143652676 -0600
***************
*** 76,82 ****
void CProjWpt::accept()
{
! qreal dist = lineDist->text().toDouble();
qreal bearing = lineBearing->text().toDouble();
if((dist <= 0) || (bearing > 180) || (bearing < -180))
--- 76,82 ----
void CProjWpt::accept()
{
! qreal dist = IUnit::self().elevation2meter(lineDist->text());
qreal bearing = lineBearing->text().toDouble();
if((dist <= 0) || (bearing > 180) || (bearing < -180))
==============================================================
I tested this using my imperial units default and it seems to work
just fine. I'm guessing, given the code structure, that the other
units systems will work too since they do in the other
"elevation2meters" contexts used in the code. Hopefully this
will be helpful in gettomg the fix into the code.
Harry
*** ./qmapshack/src/qmapshack/gis/wpt/CProjWpt.cpp.orig 2019-06-23 09:25:45.815261251 -0600
--- ./qmapshack/src/qmapshack/gis/wpt/CProjWpt.cpp 2019-08-01 19:26:10.143652676 -0600
***************
*** 76,82 ****
void CProjWpt::accept()
{
! qreal dist = lineDist->text().toDouble();
qreal bearing = lineBearing->text().toDouble();
if((dist <= 0) || (bearing > 180) || (bearing < -180))
--- 76,82 ----
void CProjWpt::accept()
{
! qreal dist = IUnit::self().elevation2meter(lineDist->text());
qreal bearing = lineBearing->text().toDouble();
if((dist <= 0) || (bearing > 180) || (bearing < -180))
_______________________________________________
Qlandkartegt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users