Here is a quick overview of how to install and work with this code
- Install ArcGIS Pro 2.3+ (version needed for advanced conda package management)
- Clone this repository to your desired location
- Copy FloodMitigation/local_settings_template.py to local_settings.py and configure parameters in local_settings.py as needed.
- Set up a conda environment within ArcGIS Pro. ArcGIS' documentation
includes the best way to handle this, but in brief:
- Open ArcGIS Pro
- Go to Settings, then switch to the Python tab
- Clone the default conda environment
- Activate the new environment and restart ArcGIS Pro
- Install dependencies within the new conda environment:
Django
scikit-learn
arrow
- Create a new scratch geodatabase (may need to happen by default - Nick to flesh out)
- Run
python manage.py migrate
from the command line with the appropriate conda environment activated (or use the path topropy
instead of callingpython
). This will create and populate the local data structures. - Can now load data and run the model (see functions in
relocation/management/load.py
)
-
Install ArcGis Pro, log in, and upgrade to version 1.3
-
Clone the repository to a desired location.
-
You need to obtain a secrets.py and local_settings.py from Nick and copy it into the FloodMitigation folder
-
Set up a conda environment. Instructions are at: http://help.watershed.ucdavis.edu/setting-up-your-own-conda-env-with-arcgis-pro-1-3-switching-from-virtualenv/
-
In the installation folder run act.bat to switch to the created conda environment and then run install_dependencies.bat. The directories used are installation defaults and need to be changed if you installed ArcGis Pro elsewhere.
-
Create a folder in the project folder called "scratch" and create a gdb in ArcGis in that location
-
You can now run the project. You can do this by: a. Activating the virtual environment by running: "C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\activate.bat" myenv b. Running python manage.py runserver c. Opening a browser and going to 127.0.0.1:8000
Note: Some packages may install into C:\Program Files\ArcGIS\Pro\bin\Python\Lib\site-packages instead of your conda environment. If you are missing dependencies copy the module folder from that location into your conda environment.