Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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