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
78f9e06b
Commit
78f9e06b
authored
1 year ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
update: server json response
parent
40b7c081
No related branches found
Branches containing commit
No related tags found
2 merge requests
!9
Clhp map
,
!8
Clhp map
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/lib/data_classes.dart
+0
-3
0 additions, 3 deletions
app/lib/data_classes.dart
server/map/__pycache__/get_markers.cpython-311.pyc
+0
-0
0 additions, 0 deletions
server/map/__pycache__/get_markers.cpython-311.pyc
server/map/get_markers.py
+3
-3
3 additions, 3 deletions
server/map/get_markers.py
with
3 additions
and
6 deletions
app/lib/data_classes.dart
+
0
−
3
View file @
78f9e06b
...
...
@@ -9,7 +9,6 @@ class Measurement {
String
bodyOfWater
;
LatLng
center
;
List
<
SubDiv
>
subDivs
;
List
<
LatLng
>
corners
;
Measurement
({
required
this
.
measurementID
,
...
...
@@ -18,7 +17,6 @@ class Measurement {
required
this
.
bodyOfWater
,
required
this
.
center
,
required
this
.
subDivs
,
required
this
.
corners
,
});
factory
Measurement
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
...
...
@@ -29,7 +27,6 @@ class Measurement {
bodyOfWater:
json
[
'BodyOfWater'
]
??
'nil'
,
center:
LatLng
(
json
[
'CenterLat'
],
json
[
'CenterLon'
]),
subDivs:
(
json
[
'Subdivisions'
]
as
List
<
dynamic
>)
.
map
((
data
)
=
>
SubDiv
.
fromJson
(
data
))
.
toList
(),
corners:
(
json
[
'Corners'
]
as
List
<
dynamic
>)
.
map
((
corner
)
=
>
LatLng
(
corner
[
0
],
corner
[
1
]))
.
toList
(),
);
}
}
...
...
This diff is collapsed.
Click to expand it.
server/map/__pycache__/get_markers.cpython-311.pyc
+
0
−
0
View file @
78f9e06b
No preview for this file type
This diff is collapsed.
Click to expand it.
server/map/get_markers.py
+
3
−
3
View file @
78f9e06b
...
...
@@ -38,7 +38,8 @@ def get_all_markers(self, cursor, waterBodyName):
'
AvgThickness
'
:
row
[
11
],
'
CenLatitude
'
:
row
[
12
],
'
CenLongitude
'
:
row
[
13
],
'
Accuracy
'
:
row
[
14
]
'
Accuracy
'
:
row
[
14
],
'
Color
'
:
calculateColor
(
row
[
11
])
# NB color calculated based on average thickness, should be minimum
}
# Check if measurement ID already exists in measurement_data
...
...
@@ -60,7 +61,6 @@ def get_all_markers(self, cursor, waterBodyName):
'
Active
'
:
bool
(
row
[
6
])
},
'
Subdivisions
'
:
[
sub_division
],
# Array of sub_division objects
'
Corners
'
:
[],
# NB remove value if not used
}
# Convert dictionary values to list of measurements
...
...
@@ -85,6 +85,7 @@ def get_all_markers(self, cursor, waterBodyName):
# Write marker data to response object
self
.
wfile
.
write
(
marker_data
.
encode
(
'
utf-8
'
))
def
calculateColor
(
thickness
:
int
):
# NB not final colors nor ranges
if
0
<
thickness
<
4
:
return
0xFFff0000
# Red
...
...
@@ -96,4 +97,3 @@ def calculateColor(thickness: int): # NB not final colors nor ranges
return
0xFF00d6ff
# Blue
else
:
return
0xFF939393
# Gray
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