Skip to content

Instantly share code, notes, and snippets.

@ddd1600
Last active January 18, 2016 21:39
Show Gist options
  • Save ddd1600/a0fb563fef4d25da4bd3 to your computer and use it in GitHub Desktop.
Save ddd1600/a0fb563fef4d25da4bd3 to your computer and use it in GitHub Desktop.
script that takes the latest csv export of costar data in the downloads directory, converts to kml, and opens. see costar_vrt.vrt for the file necessary here. Must be hard-coded to to work in a different path.
latest_download = Dir.glob("/Users/daviddouglas/Downloads/Export*.csv").max do |a,b|
File.ctime(a) <=> File.ctime(b)
end
puts "latest download is #{latest_download}"
`cp #{latest_download} /Users/daviddouglas/sikuli_scripts`
basename = File.basename(latest_download)
`mv #{basename} costar_data.csv`
`ogr2ogr -f KML costar_data.kml costar_vrt.vrt`
`open costar_data.kml`
`say "save the KML somewhere else to prevent from being overwritten"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment