Saudi Terria Map | Live demo
This is a catalog-based web geospatial visualisation platform built with TerriaMap using the TerriaJS library.
For more information about this platform, see the documentation.
- Clone this repository.
- Create an account at Cesium and create an ion access token to use it to render Cesium map.
- Copy the access token and navigate inside the project folder to
wwwroot/config.json
. You should findparameters
object. Add the acess token like that:
"parameters": {
...
"cesiumIonAccessToken": "Your token",
...
}
- Navigate to the directory
wwwroot/generateData
and create virutal environment by running:
virtualenv -p python3 env_name
source env_name/bin/activate
pip install -r requirements.txt
- Fetch the latest layers from the API endpoint by running:
python generate.py
- Navigate back to project main directory and run:
npm install && npm run gulp && npm start
- You should have the instance running at
http://localhost:3001
.
Note: These steps should be running on the server.
- Build the minified version of TerriaMap by running:
npm run gulp release
-
For sake of simplicity, we will use the already included TerriaJS-Server which is a Node.js-based webserver. Node.js +8.0 must be installed on the server in order to run terriajs-server.
-
In the project main directory, run:
./node_modules/.bin/pm2 start ecosystem-production.config.js --update-env --env production
- This will start the instance at
http://localhost:3030/
. If you want to change the port, you can modify theport
field in the file calledproductionserverconfig.json
.
-
It is usually a good idea to run another web server, such as NGINX on port 80 and then reverse-proxy to the Node.js server (running on port
3030
for our case), rather than running terriajs-server on port 80 directly. -
We need to update the data frequently, so we need to make a cron-job to execute the python file
generate.py
that's located at/saudiTerriaMap/wwwroot/generateData
like for example, twice a day.
- Make a crontab file by running:
crontab -e
- This will open a file in an editor, add the following line to update the data:
0 0,12 * * * /fullPathToProject/saudiTerriaMap/wwwroot/generateData/genJSON/bin/python /fullPathToProject/saudiTerriaMap/wwwroot/generateData/generate.py
Note: The previous step is done assuming that there's a created virtual environment which is mentioned in step 4 in the Quick Start section above.
For more information, see the deploying section in the documentation.