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
ab034eb1
Commit
ab034eb1
authored
1 year ago
by
Hoa Ben The Nguyen
Browse files
Options
Downloads
Patches
Plain Diff
change: adapt to changes
parent
34b11515
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
+9
-11
9 additions, 11 deletions
server/data_processing/process_lidar_data.py
server/map/get_markers.py
+12
-10
12 additions, 10 deletions
server/map/get_markers.py
with
21 additions
and
21 deletions
server/process_lidar_data.py
→
server/
data_processing/
process_lidar_data.py
+
9
−
11
View file @
ab034eb1
...
...
@@ -57,21 +57,19 @@ def find_height(points):
height_differences
.
append
(
difference
)
groupss
.
append
(
groups
)
return
min
(
height_differences
)
return
height_differences
print
(
lazData_path
[
0
])
# Refactor data format
iceOver
=
laspy
.
read
(
lazData_path
[
0
])
iceUnder
=
laspy
.
read
(
lazData_path
[
1
])
# areas
def
height_in_area
(
area
):
# Refactor data format
iceOver
=
laspy
.
read
(
lazData_path
[
0
])
iceUnder
=
laspy
.
read
(
lazData_path
[
1
])
ice_points
=
list
(
zip
(
iceOver
.
X
,
iceOver
.
Y
,
iceOver
.
Z
))
+
list
(
zip
(
iceUnder
.
X
,
iceUnder
.
Y
,
iceUnder
.
Z
))
ice_points
=
list
(
zip
(
iceOver
.
X
,
iceOver
.
Y
,
iceOver
.
Z
))
+
list
(
zip
(
iceUnder
.
X
,
iceUnder
.
Y
,
iceUnder
.
Z
))
area_heights
=
[]
area_heights
=
[]
# areas
for
area
in
areas
:
ice_points
=
list
(
filter
(
lambda
position
:
inArea
(
position
,
area
),
ice_points
))
area_heights
.
append
(
find_height
(
ice_points
))
print
(
area_heights
)
\ No newline at end of file
return
area_heights
This diff is collapsed.
Click to expand it.
server/map/get_markers.py
+
12
−
10
View file @
ab034eb1
import
json
from
datetime
import
datetime
from
server.data_processing.process_lidar_data
import
height_in_area
# get_markers requests all marker data or valid markers, converts the data to json, and writes
# the data to the response object
...
...
@@ -105,7 +106,6 @@ def get_all_markers(self, cursor, valid: bool):
def
input_new_Lidar_data
(
self
,
cursor
,
sensorId
,
bodyOfWater
):
try
:
cursor
.
execute
(
'''
INSERT INTO Measurement( SensorID, TimeMeasured, WaterBodyName) VALUES
(?,?,?);
...
...
@@ -115,19 +115,21 @@ def input_new_Lidar_data(self, cursor, sensorId, bodyOfWater):
measurement_id
=
cursor
.
lastrowid
cursor
.
execute
(
'''
SELECT
Corn
erLatitude, C
orn
erLongitude
FROM
Cursor
SELECT
DISTINCT Cent
erLatitude, C
ent
erLongitude
FROM
SubDivision
where MeasurementID = ?;
'''
)
cursor
_data
=
cursor
.
fetchall
()
position
_data
=
cursor
.
fetchall
()
if
(
cursor_data
):
for
row
in
cursor_data
:
longitude
,
latitude
=
row
if
(
position_data
):
for
row
in
position_data
:
latitude
,
longitude
=
row
heights
=
height_in_area
((
latitude
,
longitude
))
average
=
sum
(
heights
)
/
len
(
heights
)
cursor
.
execute
(
'''
INSERT INTO
Data
(MeasurementID, Latitude, Longitude,
IceTop, IceBottom, CalculatedThickness
) VALUES
(?,?,?,?);
'''
,(
measurement
I
d
,
))
INSERT INTO
SubDivision
(MeasurementID,
SubDivisionID, GroupID, MinimumThickness, AverageThickness, Center
Latitude,
Center
Longitude,
Accuracy
) VALUES
(?,?,?,?
,?,?,?,?
);
'''
,(
measurement
_i
d
,
1
,
1
,
min
(
heights
),
average
,
latitude
,
longitude
,
1
))
cursor
.
connection
.
commit
()
...
...
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