I have the following data file which has coordinate and value records that describe (1)longitude, (2)latitude and (3)z value :
-86.01550275487955,30.25826049996856,1.940,"","",""
-86.01541483202962,30.25795435801949,1.940,"","",""
-86.01442916957223,30.25524060127955,1.940,"","",""
-86.01430263935629,30.2549438807364,1.940,"","",""
-86.01417295763825,30.25464834091519,1.940,"","",""
-86.01550275487955,30.25826049996856,1.940,"","",""
,
-85.86228165145894,30.16609243732004,1.940,"","",""
-85.86192277623512,30.1660439417975,1.940,"","",""
-85.86156323910302,30.16599856697423,1.940,"","",""
-85.86120312202782,30.16595596294161,1.940,"","",""
-85.86084249683309,30.16591582825442,1.940,"","",""
-85.86048142645623,30.16587790466031,1.940,"","",""
-85.8601199660488,30.16584197258433,1.940,"","",""
-85.85975816394029,30.16580784728976,1.940,"","",""
-85.85939606248309,30.16577537564809,1.940,"","",""
-85.85903369879279,30.16574443346163,1.940,"","",""
-85.85867110539695,30.16571492329202,1.940,"","",""
-85.86228165145894,30.16609243732004,1.940,"","",""
,-86.01550275487955,30.25826049996856,1.940,"","",""
-86.01541483202962,30.25795435801949,1.940,"","",""
-86.01442916957223,30.25524060127955,1.940,"","",""
-86.01430263935629,30.2549438807364,1.940,"","",""
-86.01417295763825,30.25464834091519,1.940,"","",""
-86.01550275487955,30.25826049996856,1.940,"","",""
,
-85.86228165145894,30.16609243732004,1.940,"","",""
-85.86192277623512,30.1660439417975,1.940,"","",""
-85.86156323910302,30.16599856697423,1.940,"","",""
-85.86120312202782,30.16595596294161,1.940,"","",""
-85.86084249683309,30.16591582825442,1.940,"","",""
-85.86048142645623,30.16587790466031,1.940,"","",""
-85.8601199660488,30.16584197258433,1.940,"","",""
-85.85975816394029,30.16580784728976,1.940,"","",""
-85.85939606248309,30.16577537564809,1.940,"","",""
-85.85903369879279,30.16574443346163,1.940,"","",""
-85.85867110539695,30.16571492329202,1.940,"","",""
-85.86228165145894,30.16609243732004,1.940,"","",""
,
I want to be able to decimate or interpolate a new coordinate long/lat value based on a user input feet/meters value for new distance between points. I am not sure how to convert lat/longs into unprojected xys in order to do this.
I also always want to keep the first and last point of each group.
Here is my current awk script to reformat the raw data into a better format.
If anyone can help me with this additional function, I would much appreciate it.
Thanks again.
BEGIN {FS=","
segid=1;segid_seq=1
}
{
if (match($0, "^,")) { segid++;segid_seq=1;next}
printf("%-25s %9.6f %10.6f %10d %10d\n",$3,$2,$1,segid,segid_seq);
segid_seq++
}
END {
print "EOF"
}
-86.01550275487955,30.25826049996856,1.940,"","",""
-86.01541483202962,30.25795435801949,1.940,"","",""
-86.01442916957223,30.25524060127955,1.940,"","",""
-86.01430263935629,30.2549438807364,1.940,"","",""
-86.01417295763825,30.25464834091519,1.940,"","",""
-86.01550275487955,30.25826049996856,1.940,"","",""
,
-85.86228165145894,30.16609243732004,1.940,"","",""
-85.86192277623512,30.1660439417975,1.940,"","",""
-85.86156323910302,30.16599856697423,1.940,"","",""
-85.86120312202782,30.16595596294161,1.940,"","",""
-85.86084249683309,30.16591582825442,1.940,"","",""
-85.86048142645623,30.16587790466031,1.940,"","",""
-85.8601199660488,30.16584197258433,1.940,"","",""
-85.85975816394029,30.16580784728976,1.940,"","",""
-85.85939606248309,30.16577537564809,1.940,"","",""
-85.85903369879279,30.16574443346163,1.940,"","",""
-85.85867110539695,30.16571492329202,1.940,"","",""
-85.86228165145894,30.16609243732004,1.940,"","",""
,-86.01550275487955,30.25826049996856,1.940,"","",""
-86.01541483202962,30.25795435801949,1.940,"","",""
-86.01442916957223,30.25524060127955,1.940,"","",""
-86.01430263935629,30.2549438807364,1.940,"","",""
-86.01417295763825,30.25464834091519,1.940,"","",""
-86.01550275487955,30.25826049996856,1.940,"","",""
,
-85.86228165145894,30.16609243732004,1.940,"","",""
-85.86192277623512,30.1660439417975,1.940,"","",""
-85.86156323910302,30.16599856697423,1.940,"","",""
-85.86120312202782,30.16595596294161,1.940,"","",""
-85.86084249683309,30.16591582825442,1.940,"","",""
-85.86048142645623,30.16587790466031,1.940,"","",""
-85.8601199660488,30.16584197258433,1.940,"","",""
-85.85975816394029,30.16580784728976,1.940,"","",""
-85.85939606248309,30.16577537564809,1.940,"","",""
-85.85903369879279,30.16574443346163,1.940,"","",""
-85.85867110539695,30.16571492329202,1.940,"","",""
-85.86228165145894,30.16609243732004,1.940,"","",""
,
I want to be able to decimate or interpolate a new coordinate long/lat value based on a user input feet/meters value for new distance between points. I am not sure how to convert lat/longs into unprojected xys in order to do this.
I also always want to keep the first and last point of each group.
Here is my current awk script to reformat the raw data into a better format.
If anyone can help me with this additional function, I would much appreciate it.
Thanks again.
BEGIN {FS=","
segid=1;segid_seq=1
}
{
if (match($0, "^,")) { segid++;segid_seq=1;next}
printf("%-25s %9.6f %10.6f %10d %10d\n",$3,$2,$1,segid,segid_seq);
segid_seq++
}
END {
print "EOF"
}