[Proj] Re: wgs point (lat-lon 'NMEA' to N-E 'metric')

Massimo Di Stefano massimodisasha at yahoo.it
Wed Mar 28 13:21:16 PDT 2007


Hi Hamish

Hi Eric

thanks for your time !


sorry for my distraction :-(
i know that i must divide the minute /60

... i modified my string to :


var="4051.1749|01415.5317"; lat="`echo \"(${var:2:2}.${var:5:2}${var: 
7:2} /60)"|bc -l`" ;lon="`echo \"(${var:13:2}.${var:16:2}${var:18:2} / 
60)"|bc -l`";echo "${var:0:2}$lat  ${var:10:3}$lon"

40.85291500000000000000  014.25886166666666666666

- are this coordinates  good for a proj conversion ?

if it is ...
can you suggest me a proj string to change from degres to metric  
coordinates ?

again:
... the proj conversion produce as result
a   LAT  -  LON   point

but grass reads the points (v.in.ascii)
as
LON - LAT

so i need to revert the order  of coordinates ($Lat  $Lon) > ($Lon   
$Lat)
  (right?)

p.s.
i prefer do not use gpsd, so i can write a module without external  
dependencies.
i know that gpsd is a really good software for this purpose!



Il giorno 28/mar/07, alle ore 14:52,  Hamish  
<hamish_nospam at yahoo.com> ha scritto:

> as for
>> 4051.1749 N  --> 40 51.1749 N --> 40.852915 N
>
> if data is fixed width you might add "cut" to awk,
>
> lat_deg=`echo "$input" | cut -c1-2`
> lat_min=`echo "$input" | cut -c3-9`
> lat_hem=`echo "$input" | cut -c11`
>
> lat_dm="${lat_deg}d${lat_min}${lat_hem}"
>
> $ echo $lat_dm
> 40d51.1749N
>
>
> which proj might be happy with.




More information about the Proj mailing list