Menu

Possible DMS bug or anomaly in GEOD

2012-08-21
2012-09-22
  • Richard Lemay

    Richard Lemay - 2012-08-21

    I recently downloaded the library's source code and successfully compiled it
    using Ms Visual C++.
    While experimenting with GEOD.EXE I encountered the following anomaly.
    The direct function accepts most (probably all) formats specified in the
    documentation. However, the inverse function appears to have problems with
    some. For instance the following command under Windows XP resulted in an
    error:
    for /L %a in (0,1,0) do @echo %a000000 | geod -l 40d48'17.3" 073:46:44W
    003:18:30.1
    while this one worked correctly:
    for /L %a in (0,1,0) do @echo %a000000 | geod -l 40.639dN 073:46:44W
    003:18:30.1
    The difference is in the latitude format. A fix might facilitate copy/paste
    operations at the Windows command prompt.

     
  • Charles Karney

    Charles Karney - 2012-08-21

    The problem is that Geod -l looks for three distinct arguments for the
    latitude, longitude, and azimuth at the starting position. However the
    interaction between the command prompt and the C++ runtime means that

    Geod -l 40d48'17.3" 073:46:44W 003:18:30.1

    results in Geod only seeing one argument after the -l. The following
    provide ways to invoke Geod to give you the desired result:

    Geod -l 40d48'17.3 073:46:44W 003:18:30.1
    Geod -l "40d48'17.3""" 073:46:44W 003:18:30.1
    Geod -l "40d48'17.3\"" 073:46:44W 003:18:30.1
    Geod -l 40:48:17.3 073:46:44W 003:18:30.1
    Geod -l 40:48:17.3N 073:46:44W 003:18:30.1

    Unfortunately the command prompt is inconsistent in the way it does
    quoting, so I recommend using the : separator which needs no special
    treatment.

    I'll try to improve the documentation, currently available as

    GeoConvert --help

    (under the section "QUOTING") to make this clearer.

     

Anonymous
Anonymous

Add attachments
Cancel