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
0cd1b498
Commit
0cd1b498
authored
1 year ago
by
Hoa Ben The Nguyen
Browse files
Options
Downloads
Patches
Plain Diff
change: add new lidar data to actual file
parent
37b5fb5b
No related branches found
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
+4
-3
4 additions, 3 deletions
server/data_processing/process_lidar_data.py
server/map/input_new_data.py
+8
-1
8 additions, 1 deletion
server/map/input_new_data.py
with
12 additions
and
4 deletions
server/data_processing/process_lidar_data.py
+
4
−
3
View file @
0cd1b498
...
...
@@ -124,7 +124,7 @@ def calculate_area_data(center, body_of_water):
min_point
=
min
(
ice_points
)
# define all the sub-areas within the area, local coordinates
grid_area_heights
=
define_gridareas
(
60
,
10
,
(
cell_x
,
cell_y
),
4
)
grid_area_heights
=
define_gridareas
(
60
,
10
,
(
cell_x
,
cell_y
),
4
)
# find the heights of each sub-area => area-heights
for
sub_area
in
grid_area_heights
:
...
...
@@ -145,7 +145,8 @@ def calculate_area_data(center, body_of_water):
sub_center
=
((
xs
+
xe
)
/
2
,
(
ys
+
ye
)
/
2
)
if
len
(
map_data
)
>
0
:
current_map_zone
=
closest_points
(
sub_center
,
map_data
,
taken_coords
)
taken_coords
.
append
((
current_map_zone
[
'
properties
'
][
'
sub_div_center
'
][
0
][
0
],
current_map_zone
[
'
properties
'
][
'
sub_div_center
'
][
0
][
1
]))
sub_center
=
current_map_zone
[
'
properties
'
][
'
sub_div_center
'
][
0
]
taken_coords
.
append
(
sub_center
)
else
:
return
[
0
]
...
...
@@ -158,5 +159,5 @@ def calculate_area_data(center, body_of_water):
return
area_heights
print
(
calculate_area_data
((
61
,
11
),
0.04
,
'
mjosa
'
))
print
(
calculate_area_data
((
61
,
11
),
0.04
,
'
mjosa
'
))
This diff is collapsed.
Click to expand it.
server/map/input_new_data.py
+
8
−
1
View file @
0cd1b498
import
json
import
os.path
from
datetime
import
datetime
from
server.data_processing.process_lidar_data
import
calculate_area_data
,
about_laz_file
...
...
@@ -85,10 +86,17 @@ def input_new_Lidar_data(self, cursor, bodyOfWater):
self
.
send_header
(
'
Content-type
'
,
"
application/json
"
)
self
.
end_headers
()
file_path
=
"
../lake_relation/newest_lidar_data.json
"
content
=
None
if
len
(
lidar_json_data
)
>
0
:
if
os
.
path
.
exists
(
file_path
):
os
.
remove
(
file_path
)
# convert list of lidar data to json
content
=
json
.
dumps
(
lidar_json_data
)
with
open
(
file_path
,
"
w
"
)
as
file
:
file
.
write
(
content
)
else
:
print
(
'
No data found
'
)
content
=
json
.
dumps
([])
...
...
@@ -96,7 +104,6 @@ def input_new_Lidar_data(self, cursor, bodyOfWater):
# Write content data to response object
self
.
wfile
.
write
(
content
.
encode
(
'
utf-8
'
))
# error handling
except
Exception
as
e
:
print
(
"
An error occurred
"
,
e
)
...
...
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