Merge branch 'develop' into feature/mapcompare
This commit is contained in:
@@ -2049,30 +2049,25 @@ def leaflet_chart(lat,lon,name=""):
|
||||
|
||||
return script,div
|
||||
|
||||
def leaflet_chart_compare(workoutids,labeldict={},startenddict={}):
|
||||
def leaflet_chart_compare(course,workoutids,labeldict={},startenddict={}):
|
||||
data = []
|
||||
for id in workoutids:
|
||||
w = Workout.objects.get(id=id)
|
||||
rowdata = rdata(w.csvfilename)
|
||||
df = pd.DataFrame({
|
||||
'id':id,
|
||||
'latitude':rowdata.df[' latitude'],
|
||||
'longitude':rowdata.df[' longitude']
|
||||
'lat':rowdata.df[' latitude'],
|
||||
'lon':rowdata.df[' longitude']
|
||||
})
|
||||
data.append(f)
|
||||
data.append(df)
|
||||
|
||||
df = pd.concat(data,axis=0)
|
||||
|
||||
if lat.empty or lon.empty:
|
||||
return [0,"invalid coordinate data"]
|
||||
|
||||
latmean,lonmean,coordinates = course_coord_center(course)
|
||||
lat_min, lat_max, long_min, long_max = course_coord_maxmin(course)
|
||||
|
||||
# Throw out 0,0
|
||||
df = pd.DataFrame({
|
||||
'lat':lat,
|
||||
'lon':lon
|
||||
})
|
||||
|
||||
df = df.replace(0,np.nan)
|
||||
df = df.loc[(df!=0).any(axis=1)]
|
||||
df.fillna(method='bfill',axis=0,inplace=True)
|
||||
@@ -2082,8 +2077,6 @@ def leaflet_chart_compare(workoutids,labeldict={},startenddict={}):
|
||||
if lat.empty or lon.empty:
|
||||
return [0,"invalid coordinate data"]
|
||||
|
||||
latmean = lat.mean()
|
||||
lonmean = lon.mean()
|
||||
latbegin = lat[lat.index[0]]
|
||||
longbegin = lon[lon.index[0]]
|
||||
latend = lat[lat.index[-1]]
|
||||
@@ -5210,12 +5203,10 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
'workoutid']
|
||||
|
||||
datadf = dataprep.getsmallrowdata_db(columns,ids=ids,doclean=False,compute=False)
|
||||
|
||||
datadf.dropna(axis=1,how='all',inplace=True)
|
||||
datadf.dropna(axis=0,how='any',inplace=True)
|
||||
|
||||
|
||||
|
||||
nrworkouts = len(ids)
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user