Skip to content

Instantly share code, notes, and snippets.

@kkodev kkodev/gengpx.rb
Created Jul 25, 2016

Embed
What would you like to do?
lat = ARGV[0].to_f
lon = ARGV[1].to_f
lat = (lat * 1000).to_i / 1000.0
lon = (lon * 1000).to_i / 1000.0
puts <<STR
<?xml version="1.0"?>
<gpx version="1.1">
STR
(0..200).each do |i|
latd = rand(-999..999).to_f
lond = rand(-999..999).to_f
nlat = lat + (latd / 10e6)
nlon = lon + (lond / 10e6)
puts <<STR
<wpt lat="#{nlat}" lon="#{nlon}"></wpt>
STR
end
puts '</gpx>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.