Closed ruiwu1990 closed 8 years ago
You can add a comment like Fixes #7
. It will automatically close the issue when merged.
I still need to work on something. After that I will add "fixes" tag.
fixes #7 I moved Lisa's part to util.py and she will correct the camelCase thing.
Fixes #7
I have a few things that need to be fixed. Here's a checklist with more details on each task below.
parameters.nc
and data.nc
to the repository in a new directory app/static/data
visualize
Blueprint. Use main/views.py
for rendering the frontend and move data services to api/views.py
.I'm sure some of this won't be totally clear, so please either ask questions in this Pull Request thread or on Slack!
I'm currently getting an error whose traceback ends with
File "/Users/mturner/workspace/prms-fire-scenarios/app/visualize/views.py", line 35, in add_values_into_json
fileHandle = Dataset(file_full_path, 'r')
File "netCDF4.pyx", line 1466, in netCDF4.Dataset.__init__ (netCDF4.c:19738)
RuntimeError: No such file or directory
Looks like this is because you haven't included the parameters netCDF?
Here's how I'd like the directory structure to look:
prms-fire-scenarios
|-- app
|-- main
-- views.py
-- __init__.py
|-- api
-- views.py
-- __init__.py
|-- static
|-- data
-- parameter.nc
-- data.nc
|-- js
|-- templates
Since this is a single-page app we don't need a separate visualize
directory and blueprint. Please integrate your work into templates/index.html
. Also I want the base data, @Chao-Chen's most up-to-date parameter and data files, to be included in the github repository.
Please put the data services, as in here in visualize/views.py
line 115
@visualize.route('/visualize/veg_json', methods=['GET','POST'])
def hru_veg_json():
into api/views.py
and call this specific route /api/base-veg-map
:
@api.route('/api/base-veg-map', methods=['GET','POST'])
def hru_veg_json():
util.py
should then be moved to the app/api
directory.
After you've moved your work from the app/visualize
directory into these more appropriate places, please remove the app/visualize
directory.
I just updated my part. The folder schema is changed based on @mtpain request. I am confused why @mtpain met this bug
File "/Users/mturner/workspace/prms-fire-scenarios/app/visualize/views.py", line 35, in add_values_into_json
fileHandle = Dataset(file_full_path, 'r')
File "netCDF4.pyx", line 1466, in netCDF4.Dataset.__init__ (netCDF4.c:19738)
RuntimeError: No such file or directory
It runs without it in my computer. I will talk with @lisapalathingal tomorrow.
Adding map part. Users can add and remove overlays images. @mtpain It is strange that you met the bug "No such file or directory". Plz check this version, if you meet the same problem and there is a file named ''parameter.nc" in yout static/data folder, please inform me.
This is for #7. For current version, I add a new blueprint called visualize. The fontend enables users to choose an area by clicking on the canvas. The "reset polygon", "submit change to the map", and the "select box" work. I am working on the "submit change to the server" button and grabbing data from the server side by using get request.