Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG2900
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Savanovic Djordjevic
PROG2900
Commits
37b5fb5b
Commit
37b5fb5b
authored
1 year ago
by
Hoa Ben The Nguyen
Browse files
Options
Downloads
Patches
Plain Diff
change: format the new data to meter instead of offset of offset
parent
7aad3202
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/data_processing/process_lidar_data.py
+8
-4
8 additions, 4 deletions
server/data_processing/process_lidar_data.py
server/map/input_new_data.py
+3
-3
3 additions, 3 deletions
server/map/input_new_data.py
with
11 additions
and
7 deletions
server/data_processing/process_lidar_data.py
+
8
−
4
View file @
37b5fb5b
...
...
@@ -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
'
])
...
...
This diff is collapsed.
Click to expand it.
server/map/input_new_data.py
+
3
−
3
View file @
37b5fb5b
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment