@@ -1108,12 +1108,12 @@ def selection_to_geojson(self, selection: pd.DataFrame, name: int) -> dict:
1108
1108
if selection .iloc [0 ]['type' ] == 'range' :
1109
1109
calced_selection = self .range_to_lasso_points (selection )
1110
1110
calced_selection = pd .concat ([calced_selection , calced_selection .iloc [[0 ]]], ignore_index = True )
1111
- selection_coords = dict (type = "Feature" , properties = dict (name = name ), geometry = dict (dict (type = "Polygon" , coordinates = [calced_selection [['X' , 'Y' ]].values .tolist ()])))
1111
+ selection_coords = dict (type = "Feature" , properties = dict (name = name , type = 'range' ), geometry = dict (dict (type = "Polygon" , coordinates = [calced_selection [['X' , 'Y' ]].values .tolist ()])))
1112
1112
else :
1113
1113
selection = pd .concat ([selection , selection .iloc [[0 ]]], ignore_index = True )
1114
- selection_coords = dict (type = "Feature" , properties = dict (name = name ), geometry = dict (dict (type = "Polygon" , coordinates = [selection [['X' , 'Y' ]].values .tolist ()])))
1114
+ selection_coords = dict (type = "Feature" , properties = dict (name = name , type = 'lasso' ), geometry = dict (dict (type = "Polygon" , coordinates = [selection [['X' , 'Y' ]].values .tolist ()])))
1115
1115
else :
1116
- selection_coords = dict (type = "Feature" , properties = dict (name = name ), geometry = dict (dict (type = "Polygon" , coordinates = [])))
1116
+ selection_coords = dict (type = "Feature" , properties = dict (name = name , type = 'map' ), geometry = dict (dict (type = "Polygon" , coordinates = [current_map . perimeter [ current_map . perimeter [ 'type' ] == 'perimeter' ][[ 'X' , 'Y' ]]. values . tolist () ])))
1117
1117
return selection_coords
1118
1118
except Exception as e :
1119
1119
logger .error ('Could not create selection for task' )
@@ -1122,10 +1122,10 @@ def selection_to_geojson(self, selection: pd.DataFrame, name: int) -> dict:
1122
1122
1123
1123
def parameteres_to_gejson (self , parameters : pd .DataFrame , name : int ) -> dict :
1124
1124
try :
1125
- return dict (pattern = str (parameters .iloc [0 ]['pattern' ]), width = float (parameters .iloc [0 ]['width' ]),
1125
+ return dict (mowPattern = str (parameters .iloc [0 ]['pattern' ]), width = float (parameters .iloc [0 ]['width' ]),
1126
1126
angle = int (parameters .iloc [0 ]['angle' ]), distanceToBorder = int (parameters .iloc [0 ]['distancetoborder' ]),
1127
- mowArea = bool (parameters .iloc [0 ]['mowarea' ]), mowBorder = int (parameters .iloc [0 ]['mowborder' ]),
1128
- mowExclusions = bool (parameters .iloc [0 ]['mowexclusion' ]), mowBorderCcw = bool (parameters .iloc [0 ]['mowborderccw' ]))
1127
+ mowArea = bool (parameters .iloc [0 ]['mowarea' ]), borderLaps = int (parameters .iloc [0 ]['mowborder' ]),
1128
+ mowExclusionBorder = bool (parameters .iloc [0 ]['mowexclusion' ]), mowBorderCcw = bool (parameters .iloc [0 ]['mowborderccw' ]))
1129
1129
except Exception as e :
1130
1130
logger .error ('Could not create parameters for task' )
1131
1131
logger .error (f'{ e } ' )
0 commit comments