-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerate.py
43 lines (30 loc) · 855 Bytes
/
generate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import numpy as np
import pandas as pd
import os
import math
file_=r'/home/zsolt/DATA/msc_100k.csv'
msck = pd.read_csv(file_, sep = ',', names = ["TAC","Type","timestamp","unix","latitude","longitude"])
print(msck.head())
def isInBudapest(lati,longi):
#bafelso
ax = 47.517559
ay = 19.052176
#jobbalso
dx = 47.478452
dy = 19.106307
inX = False
inY = False
if(lati > dx and lati < ax):
inX = True
if(longi > dy and longi < ay):
inY = True
return (inX and inY)
# print(isInBudapest(47.499620, 19.058110))
for index,row in msck.iterrows():
lati = row['latitude']
longi = row['longitude']
content = 'new google.maps.LatLng(' + str(lati) + ',' + str(longi) + '),'
if (content != 'new google.maps.LatLng(nan,nan),'):
if (isInBudapest(lati,longi)):
with open('./output.txt', 'a') as f1:
f1.write(content + os.linesep)