Skip to content
Snippets Groups Projects
Commit 37b5fb5b authored by Hoa Ben The Nguyen's avatar Hoa Ben The Nguyen
Browse files

change: format the new data to meter instead of offset of offset

parent 7aad3202
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ def about_laz_file():
# check if lidar points is within range of the area selected
def inArea(position, areaRange):
y, x, _ = position
y, x, _ = position # position to be checked
if (abs(areaRange[0][0]) > x > abs(areaRange[1][0])) and (abs(areaRange[0][1]) > abs(y) > abs(areaRange[1][1])):
return True
else:
......@@ -46,14 +46,14 @@ def distance(point1, point2):
# find the closest point in json list
def closest_points(point, list, coords_taken):
closest_point = None
closest_point_found = None
closest_dist = float('inf')
for current_point in list:
dist = distance(point, current_point['properties']['sub_div_center'][0])
if dist < closest_dist and current_point not in coords_taken:
closest_dist = dist
closest_point = current_point
return closest_point
closest_point_found = current_point
return closest_point_found
# Calculation of height in an area from las files
def find_height(points):
......@@ -98,10 +98,14 @@ def calculate_area_data(center, body_of_water):
# grid cell offset
cell_x, cell_y = map_data['tile_width'], map_data['tile_height']
# convert the offset to meter
cell_x = 111.320 * cell_x
cell_y = 111.320 * math.cos(60) * cell_y
# set the limit of the area compared to local coordinates
area_limit = calculate_corners(center[0], center[1], (cell_x, cell_y))
# grid data
map_data = map_data['features']
print(map_data[0]['properties']['sub_div_center'])
......
......@@ -39,9 +39,9 @@ def input_new_Lidar_data(self, cursor, bodyOfWater):
# lng and lat relative to map
map_lat, map_lng = area[2]
if(len(area[2]) != 0):
average = sum(area[2])/len(area[2])
minimum_thickness = min(area[2])
if(len(area[3]) != 0):
average = sum(area[3])/len(area[3])
minimum_thickness = min(area[3])
else:
average = 0
minimum_thickness = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment