Skip to content

cartologic/saudiTerriaMap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Saudi Terria Map | Live demo

Terria logo

Greenkeeper badge

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.

Quick Start:

  1. Clone this repository.
  2. Create an account at Cesium and create an ion access token to use it to render Cesium map.
  3. Copy the access token and navigate inside the project folder to wwwroot/config.json. You should find parameters object. Add the acess token like that:
"parameters": {
  ...
  "cesiumIonAccessToken": "Your token",
  ...
}
  1. 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
  1. Fetch the latest layers from the API endpoint by running:
python generate.py
  1. Navigate back to project main directory and run:
npm install && npm run gulp && npm start
  1. You should have the instance running at http://localhost:3001.

Deploying TerriaMap

Note: These steps should be running on the server.

  1. Build the minified version of TerriaMap by running:
npm run gulp release
  1. 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.

  2. In the project main directory, run:

./node_modules/.bin/pm2 start ecosystem-production.config.js --update-env --env production
  1. This will start the instance at http://localhost:3030/. If you want to change the port, you can modify the port field in the file called productionserverconfig.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.

  1. Make a crontab file by running:
crontab -e
  1. 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.

About

Catalog-based web geospatial visualisation platform.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published