Skip to content

Instantly share code, notes, and snippets.

@perliedman
Created April 22, 2016 06:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perliedman/44ea458607fba4f121314628c9cee978 to your computer and use it in GitHub Desktop.
Save perliedman/44ea458607fba4f121314628c9cee978 to your computer and use it in GitHub Desktop.
#!/bin/bash
LL="31 70"
P0=`echo $LL | cs2cs +proj=longlat +datum=WGS84 +no_defs +to +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs`
for I in `seq 1 10`;
do
P=`echo $LL | cs2cs +proj=longlat +datum=WGS84 +no_defs +to +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs`
LL=`echo $P | cs2cs -I +proj=longlat +datum=WGS84 +no_defs +to +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs`
done
P0=`echo $P0 | cut -d" " -f1,2`
P=`echo $P | cut -d" " -f1,2`
echo "var p0 = '$P0'.split(' ').map(Number), p = '$P'.split(' ').map(Number), dx = p[0]-p0[0], dy=p[1]-p0[1]; console.log(Math.sqrt(dx*dx+dy*dy));" | node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment