Skip to content

Commit da79a76

Browse files
committed
Merge pull request #35 from ResearchSoftwareInstitute/develop
Merge develop into master to reflect currently running demo code
2 parents a85a0b9 + 587bb72 commit da79a76

File tree

2 files changed

+108
-96
lines changed

2 files changed

+108
-96
lines changed
Lines changed: 103 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# GI Notebook User Scenario: Stormwater Engineer
1+
# GI Designer User Scenario: Stormwater Engineer
22

33
## Introduction
4-
Goal: Use GI Notebook to design green infrastructure stormwater
4+
Goal: Use GI Designer to design green infrastructure stormwater
55
management practices in a watershed, and to test the performance of
66
these practices using ecohydrologic, cost, and co-benefit models.
77

@@ -13,116 +13,123 @@ Sam Stormwater Engineer
1313

1414
## Scenario
1515

16-
### Watershed selection
16+
### Watershed selection
1717
Sam Stormwater Engineer (Sam; the user) wishes to use the *GI
18-
Notebook* to design green infrastructure stormwater management
18+
Designer* to design green infrastructure stormwater management
1919
practices (GI) in a watershed, and to test the performance of these
2020
practices using ecohydrologic, cost, and co-benefit models (models).
2121

22-
Sam starts by loading the *GI Notebook* website. After logging in
22+
Sam starts by loading the *GI Designer* website. After logging in
2323
(which may including signing up for an account), Sam is presented with
24-
the *Watershed chooser*, which shows, using list and map view
25-
interfaces, the set of watersheds for which models have been
26-
developed.
27-
28-
The *Watershed chooser* allows Sam to view information about each
29-
watershed (e.g. name, description, watershed area, types of GI
30-
available to place in this watershed, etc. metadata). The *Watershed
31-
chooser* also lists, for each watershed, any previous *GI Edit
32-
Sessions*, allowing the user to re-open previous sessions, and to
33-
create/view a *GI performance report* for each session. Additionally,
34-
the *Watershed chooser* allows the user to create a new *GI Edit
35-
Session*. The list of available watersheds in the *Watershed chooser*
36-
is determined by the watershed models that have been added to the *GI
37-
Notebook* by the system administrators (a future release could allow
38-
users to create new watershed models).
39-
40-
When Sam chooses to view an existing or to create a new *GI Edit
41-
Session* for a particular watershed, Sam is redirected to the *GI
42-
Bird's-eye Editor*, a web-based GIS that loads the geospatial data for
43-
the selected watershed zoomed to the maximum extent of the
44-
watershed. The base layer of the map is high-resolition
45-
satellite/aerial photography, with the following GIS layers overlaid:
46-
watershed boundary (drawn as a polygon with no fill); and the
47-
landcover data as defined in the ecohydrology model (drawn with
48-
transparency so that the underlying imagery is present). Optionally,
49-
the user can change the base layer to one of the following: hillshade;
50-
or flow accumulation map. The location of previously placed GI (for
51-
existing edit sessions) or newly placed GI will be indicated on the
52-
plan-view map using the polygons that define the GI area; these
53-
polygons will be filled with the 2D overhead view icons associated
54-
with each green infrastructure type.
24+
the *Region chooser*, which shows, using list and map view interfaces,
25+
the set of regions for which watershed models are available. Upon
26+
choosing a region, the *Region viewer* for the chosen region is
27+
loaded. The *Region view*, which is essentially a web-based GIS
28+
interface, allows Sam to overlay GIS layers available for the
29+
particular region. These layers (e.g. soils, elevation, environmental
30+
hazard vulnerability), can be used to decide watersheds to prioritize
31+
for GI implementation. The *Region viewer* also allows Sam to load
32+
custom GIS datasets, either by uploading vector or raster data, or by
33+
associating a WMS, WCS, or WFS web service URL.
34+
35+
In addition to allowing the visualization of GIS data, the *Region
36+
Viewer* also contains the *Watershed chooser*, which displays, using
37+
list and map view interfaces, the watersheds for which *GI evaluator*
38+
models are available. For each watershed, the *Watershed chooser*
39+
allows Sam to view information about each watershed (e.g. name,
40+
description, watershed area, types of GI available to place in this
41+
watershed, etc. metadata). The list of available watersheds in the
42+
*Watershed chooser* is determined by the watershed models that have
43+
been added to the *GI Notebook* by the system administrators (a future
44+
release could allow users to create new watershed models).
45+
46+
When Sam selects particular watershed, Sam is redirected to the *GI
47+
designer* interface [TODO: Add figure], which loads the *Bird view
48+
editor* for the watershed. The *Bird view editor* is a web-based GIS
49+
that loads the geospatial data for the selected watershed zoomed to
50+
the maximum extent of the watershed. The base layer of the map is
51+
OpenStreetMap data, with the following GIS layers overlaid: watershed
52+
boundary (drawn as a polygon with no fill); and the landcover data as
53+
defined in the ecohydrology model (drawn with transparency so that the
54+
underlying imagery is present). Optionally, the user can change the
55+
base layer to one of the following: elevation contours; flow
56+
accumulation map; flow direction; soils; baseline modeling results.
57+
58+
The *Bird view editor*, and by extension *GI designer*, allows Sam to
59+
create new *GI scenarios*, which represents the implementation of one
60+
or more *GI instances* in a watershed; *GI scenarios* are identified
61+
by a unique name chosen by Sam. The user can choose to edit *GI
62+
scenarios* that have not yet been run in the *GI evaluator*, or to
63+
create new *GI scenarios* based on previously run scenarios. *GI
64+
scenarios* can also be deleted (which will result in all results
65+
associated with the instance being deleted.
66+
67+
The location of previously placed GI (for existing edit sessions) or
68+
newly placed GI will be indicated on the plan-view map using the
69+
polygons that define the GI area; these polygons will be filled with
70+
the 2D overhead view icons associated with each green infrastructure
71+
type.
5572

5673
![Bird's-eye view editor](images/GIEditor_v3.png)
57-
Figure 1. Bird's-eye view editor.
74+
Figure 1. Bird's-eye view editor. [OBSOLETE]
5875

59-
### Placing green infrastructure in bird's-eye view
60-
Within the bird's-eye view (Figure 1) Sam can use "slippy map" controls
61-
(i.e. panning and zooming) to navigate to the sub region of the watershed
62-
in which Sam would like to place green infrastructure storm water
63-
management practices. Once the user finds the sub region they would
64-
like to work in, they can place green infrastructure (GI) elements in
65-
the watershed as follows:
76+
### Placing green infrastructure in Bird view editor
77+
Within the *Bird view editor* (Figure 1) Sam can use "slippy map"
78+
controls (i.e. panning and zooming) to navigate to the sub region of
79+
the watershed in which Sam would like to place green infrastructure
80+
storm water management practices. Once the user finds the sub region
81+
they would like to work in, they can place green infrastructure (GI)
82+
elements in the watershed as follows:
6683

67-
1. Tap or click on the *Select patches* button;
84+
1. Tap or click on the *Add new infrastructure* button;
6885

69-
2. Draw a polygon outlining the model patches where the GI will be
70-
placed (each GI edit will be associated with a single polygon);
86+
2. Choose the desired GI type from the menu that appears, and then
87+
click on the *Place green infrastructure* button;
7188

72-
3. Select the GI type to place in this polygon;
89+
3. Draw a polygon describing where the GI will be placed (each GI edit
90+
will be associated with a single polygon);
7391

74-
4. Adjust the GI properties (e.g. name, vegetation density);
92+
Once the polygon for the new GI instance has been completed, it will
93+
automatically be saved to the *GI scenario*, and the instance will
94+
appear in the list of *GI edits*; when an element of this list is
95+
selected, the GI polygon associated with the edit will be highlighted
96+
on the GIS map. If the polygon does not entirely lie within the
97+
current viewport, the GI editor will gracefully pan to ensure that the
98+
entire polygon is in view (plus a small area just beyond the polygon
99+
so that it is clear to the user that the entire polygon is in view).
75100

76-
5. Tap or click on the *Place Green Infrastructure* button (or tap or
77-
click on the *Cancel* button, which will erase the polygon). This
78-
results in the GI being saved by the *GI Notebook*.
101+
The *GI edits* listing will also allow the user to select one or more
102+
GI edits, which will highlight them on the map (with necessary
103+
panning, as above, and zooming to ensure all edits are visible in the
104+
viewport). Once selected, the user can delete the edits by tapping or
105+
clicking on the *Delete GI* button in the *GI edits* listing.
79106

80-
Once the new GI has been placed, it will appear under its user-chosen
81-
name in the list of *Green Infrastructure edits*; when an element of
82-
this list is selected, the GI polygon associated with the edit will be
83-
highlighted. If the polygon does not entirely lie within the current
84-
viewport, the GI editor will gracefully pan to ensure that the entire
85-
polygon is in view (plus a small area just beyond the polygon so that
86-
it is clear to the user that the entire polygon is in view).
87-
88-
The *Green Infrastructure edits* listing will also allow the user to
89-
select one or more GI edits, which will highlight them on the map
90-
(with necessary panning, as above, and zooming to ensure all edits are
91-
visible in the viewport). Once selected, the user can delete the
92-
edits by tapping or clicking on the *Delete Green Infrastructure*
93-
button in the *Green Infrastructure edits* listing.
94-
95-
### Placing green infrastructure in street view
107+
### Viewing green infrastructure in street view
96108

97109
![street view editor](images/street_view_editor.jpg)
98-
Figure 2. street view editor.
99-
100-
In the street view editor(Figure 2), users can place green infrastructure
101-
objects in the street view as follows:
102-
103-
1. Select *Native vegetation* in the *Category* drop-down menu.
104-
105-
2. Choose the type of native vegetation by clicking on its image.
106-
107-
3. Click on the *Add to scene* button or drag and drop.
108-
109-
4. Place the tree in the right place of street view.
110-
To navigate to the target area where users would like to place green
111-
infrastructure objects, users could click and drag their mouse to orient
112-
the street view and scroll with their mouse to zoom in and out. After this,
113-
users could click and drag the objects to there.
114-
115-
5. Adjust the vegetation parameters (e.g. diameter, height, name etc.);
116-
117-
6. Click on the *Send to GI Notebook* button to save the GI in the GI
118-
Notebook (or hit the *delete* key, which will delete it).
119-
120-
All placed green infrastructure objects will appear in the list of
121-
*GI elements*. When an element of this list is selected, the associated
122-
3D model will be highlighted in a cuboid mesh.
123-
124-
The *GI elements* list also allows users to select multiple GI
125-
elements and do editing for multiple elements simultaneously.
110+
Figure 2. street view editor. [OBSOLETE]
111+
112+
For each GI instance created in the *Bird view editor*, Sam will have
113+
the option to view the GI from the *Street viewer*. The *Street
114+
viewer* uses Google Street View data to provide a 3D simulation of how
115+
the GI will look in the context of a neighborhood streetscape. To
116+
enter the *Street viewer* Sam can click on the *Street view* button
117+
that is enabled when a single GI instance is selected in the *GI
118+
edits* list.
119+
120+
When the *Street viewer* loads, the default view will be centered on
121+
the GI instance that was selected in the *GI edits* list. However,
122+
Sam will be able to change the view angle (in X and Y directions), as
123+
well as to move the position of the street view camera along the
124+
street using controls familiar to Google Street View.
125+
126+
When in *Street viewer*, a small map will appear in the lower left
127+
corner of the screen showing an overhead view of the region of the
128+
watershed the user is in, indicated the GI instance that was selected
129+
when *Street viewer* was selected*. There will also be a *Return to
130+
Bird view* button under this map that will allow Sam to return to the
131+
*Bird view editor*, with the viewport centered over the previously
132+
selected GI instance.
126133

127134
### Creating a green infrastructure performance report
128135
TBD

gidb/views/rest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from rest_framework import authentication, permissions, viewsets
22

3+
from rest_framework_gis.filters import DistanceToPointFilter
4+
35
from ..models import Watershed
46
from ..serializers import WatershedSerializer
57
from ..models import WatershedBoundary
@@ -65,6 +67,9 @@ class GIInstanceViewSet(DefaultsMixin, viewsets.ModelViewSet):
6567

6668
queryset = GIInstance.objects.all()
6769
serializer_class = GIInstanceSerializer
70+
distance_filter_field = 'placement_poly'
71+
filter_backends = (DistanceToPointFilter,)
72+
distance_filter_convert_meters = True
6873

6974

7075
class HumanPrefImageViewSet(DefaultsMixin, viewsets.ModelViewSet):

0 commit comments

Comments
 (0)