Re: [Viking-devel] Confusion about convert_dms_to_dec()

2020-04-09 Thread Robert Norris


> Subject: [Viking-devel] Confusion about convert_dms_to_dec()

NB There is already some test code for this in the test directory:

degrees_convertor.c + check_degrees_convertors.sh

Although the test script itself is not very robust.

I don't think trying to input "120.20.30" is a good idea (I don't think this is 
common angle format description), so if you get back a slightly unexpected 
result then so be it.

The dms format is meant to have separators like spaces and quotes and so forth, 
like  E120°12'18.

It could check the string to see if there are multiple '.' or ',' and try to 
interpret it better, but it's more effort to write code to try and best guess 
more input format options (e.g. hello regexps!).

The idea behind convert_dms_to_dec() is that it accepts both "E120°12'18." 
and normal "N.N" decimals, for the kinds of text angle input one might write 
(or copy in from elsewhere)  
Perhaps the function name and (the lack of) comments don't communicate this 
very well.
One needs to dig into the source code history to get that extra understanding.

HTH.

--
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.


___
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/


Re: [Viking-devel] Calculating UTM coordinate from screen position

2020-04-09 Thread Greg Troxel
Robert Norris  writes:

> The projection is done based on the zone at the center position.
>
> The zone is for the east<->west, whereas the designation letter is the 
> latitude band, being 8 degrees wide, which Viking currently shows as part of 
> the UTM readout.
>
> This use of the from screen position is most likely for the UTM
> position readout of the mouse pointer location, so when viewing on a
> sufficiently zoomed out manner (e.g. around country / US state levels)
> the coverage will cross these bands.

What I meant is that looking at projected coordinates (screen position)
in a scheme like this, one will get values in the same zone as the
center.  These are valid, but are not necessarily the values that would
be obtained by converting to geodetic and back, choosing a zone anew.

Either approach seems legitimate in terms of display.


___
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/