Created
May 13, 2014 10:36
-
-
Save sverhoeven/0dccaca0ea29e0ee58b0 to your computer and use it in GitHub Desktop.
Script to convert route around nemo to around nakko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
import csv | |
nemo = {'lat': 52.374253,'lon': 4.911687} | |
nakko = {'lat':52.330797,'lon':4.966013} | |
with open('in.csv', 'rb') as csvin: | |
with open('out.csv', 'wb') as csvout: | |
reader = csv.reader(csvin) | |
writer = csv.writer(csvout) | |
for row in reader: | |
if (len(row) < 3): | |
pass | |
elif row[0] == 'ts': | |
writer.writerow(row) | |
else: | |
row[1] = float(row[1]) - (nemo['lon'] - nakko['lon']) | |
row[2] = float(row[2]) - (nemo['lat'] - nakko['lat']) | |
writer.writerow(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment