GRI-Earthquake is an example project used to develop the work-in-progress Geospatial Web Framework developed in the Geospatial Research Institute Toi Hanagarau. This application is used to visualise the location, magnitude, and depth of earthquakes within New Zealand.
This project consists of two parts, a client web app in client/
, and a web server REST API in server/
.
- Python3
- pip (Pip Installs Packages - Python package manager)
- Node.JS / npm (Node Package Manager)
- Here API Freemium Project (Project Registration for API for OSM tile data for harp.gl)
- Here XYZ API Access Management Token (Free API for map data for harp.gl)
-
Begin by installing required software
python3
,pip
andnpm
. -
Install server dependencies:
- Create virtual environment:
# From the root directory of the project cd server/ # Create and activate virtual environment pip install virtualenv virtualenv venv
-
Activate virtual environment:
- Windows:
venv\Scripts\activate
- Linux:
source venv/bin/activate
-
Install Python packages:
pip install -r requirements.txt
-
Install client dependencies:
# From the root directory of the project cd client/ # Install node packages from package.json npm install # Build decoder bundle npm run build:harp-gl-decoder
At this stage you must also have an access token for mapping. This can be created for free by first creating a freemium project with the Here API.
After this you must retrieve a Here XYZ API Access Management Token by visiting this link and selectingGenerate Token
under theAccess Management
tab and selecting all features.Then create a local environment file
proj_root/client/.env.local
and fill it with the token copied from the site above.# proj_root/client/.env.local VUE_APP_HEREAPI=enter_your_access_token_here
-
Running development app:
- Server:
# From project root cd server/src/server/ flask run
- Client (in a new terminal window or with server running in background):
# From project root cd client/ npm run serve
- Server:
-
Opening app:
Open the client web address in your browser. The address will be listed in the terminal used for starting the client.
If you wish to remove excessive warnings about source maps from the dev console in your browser, then disable JavaScript
source maps.
To do this in Chrome go to dev tools Settings > Preferences > Sources
and disable Enable JavaScript source maps
.
We use docker-compose
to deploy to the server, so see docker-compose docs
for installation instructions.
With docker-compose
installed, a docker
daemon service running on your server, and ports 5000 and 80 open, follow
these instructions:
- Find your Here API token by following the instructions for creating an access token above.
- Add the Here API token to your shell environment variables.
echo "export HERE_MAPS_TOKEN=enter_your_access_token_here" >> ~/.bashrc
source ~/.bashrc
- Enter the folder you wish to store the source and clone the repository.
git clone https://github.com/GeospatialResearch/gri-earthquake.git
- Build the application.
cd gri-earthquake
docker-compose build
- Deploy the application.
docker-compose up
gri-earthquake
└───client # files used in the client-side application, run in the user's browser
└───server # files used in the server-side application, used to store data and perform intensive tasks
See also: client README and server README
Please see our Issue Tracker for details on coming features and additions to the software.
There is no current expectations of contributions to this project. We accept input in code reviews now. If you would
like to be involved in the project, please contact the maintainer.
The Geospatial Web Framework that is being created alongside this project will be opened to the public in the coming
months. We will accept contributions to that project in the future.
Maintainer: Luke Parkinson @LukeParky [email protected]