[OSRS-PROJ] Re: GEOD Quandary

Frank Warmerdam warmerdam at pobox.com
Wed Nov 29 22:28:57 EST 2000

> Alan Ramunas wrote:
> Hi Frank,
> Paul Morin and I are working on a project for Open Skies (arms control verification) that requires the interpolation of points along a great circle route.
> GEOD seems the ideal application but something about the dos prompt syntax has me bamboozled. I would very much appreciate any hints you can provide on this
> quandary:
> At the DOS prompt I enter:
> geod +ellps=WGS84 +lat_1=45d19'N +lon_1=075d34'W +lat_2=44d15'N +lon_2=76d34'W +n_S=20 > c:\output.txt
> The output file reads:
> 45d19'N 0dE
> 45d6'12.058"N 0dE
> 44d53'24.086"N 0dE
> 44d40'36.086"N 0dE
> 44d27'48.058"N 0dE
> 44d15'N 0dE
> I can't seem to get my brain around the reason for all longitudes being "0dE".


Are you really doing this at a DOS command window?  I found a similar problem
on Unix, but the problem went away when I removed the single quotes (the 
minutes markers).  This is because on Unix like shells the single quotes is
interpreted by the shell as containing a constant string, and so the following
+lon_1/2 is absorbed into the preceeding argument to the problem and lost.  
The single quotes can also be escaped with a backslash if necessary (for
instance, if you want to have seconds as well). 

However, I was unable to reproduce the same problem at the DOS prompt, since
DOS has very different (and generally simpler) quoting and commandline parsing
rules.  Perhaps you are using Cygwin?  If it really is DOS, perhaps you should
still drop the single quotes. 

On a related note, I discovered that with my version of the Microsoft C/C++
libraries, the strtod() function used to convert DMS values to decimal values
is treating strings like "44d15" as an expoential value (ie 44 x 10^15). 
This completely screws up results of course.  

How did you build your copy of geod.exe?  Are you using MSVC++?  What version?

I see that proj comes with a separate copy of strtod() though it doesn't
appear to be linked in by default.  I think I will change things to use it by
default, and to rename it to proj_strtod() or something similar.  

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerda
and watch the world go round - Rush    | Geospatial Programmer for Rent
PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.

More information about the Proj mailing list