https://github.com/gencat/ICGC-focalbosc
Foc al Bosc: Visor incendis forestals Catalunya 1986-2017
https://github.com/gencat/ICGC-focalbosc
icgc mapbox-gl-js mapping react reactjs
Last synced: 8 days ago
JSON representation
Foc al Bosc: Visor incendis forestals Catalunya 1986-2017
- Host: GitHub
- URL: https://github.com/gencat/ICGC-focalbosc
- Owner: gencat
- License: mit
- Created: 2018-07-27T11:46:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-10-23T06:45:28.000Z (over 2 years ago)
- Last Synced: 2023-10-23T07:33:47.543Z (over 2 years ago)
- Topics: icgc, mapbox-gl-js, mapping, react, reactjs
- Language: JavaScript
- Homepage: https://visors.icgc.cat/focalbosc
- Size: 5.69 MB
- Stars: 2
- Watchers: 8
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-catalunya - ICGC Foc al Bosc - focalbosc?style=flat-square&label=%E2%AD%90)](https://github.com/gencat/ICGC-focalbosc/stargazers) [](https://github.com/gencat/ICGC-focalbosc/commits/master) [](https://github.com/gencat/ICGC-focalbosc) [](https://github.com/gencat/ICGC-focalbosc/blob/master/LICENSE) [](https://www.icgc.cat/) - Visor de incendios forestales de Catalunya entre 1986 y 2017. (Cartografía y Territorio)
README
# Foc al Bosc
React based project to visualize the distribution and the territorial scope of fires in Catalonia from 1986 until now. You also can observe the subsequent evolution of the affected area.
## Link to live project
**[visors.icgc.cat/focalbosc](https://visors.icgc.cat/focalbosc)**
## Anual code updates
Anually, the last year is added to the project following these steps:
1. Update the PBF with the new fires and the layers name:
```
export const PBF_INCENDIS = "https://tilemaps.icgc.cat/tileserver/tileserver.php/incendis_v2/{z}/{x}/{y}.pbf";
export const VECTOR_LAYER_POL = "incendis_4326_poligons_v2";
export const VECTOR_LAYER_POINT = "incendis_4326_centroides_v2";
```
2. Add the new year in **constants.js**, in the following lists:
* mappingAnyLayer
* ortoLayersOptions
3. Copy the new CSV in the folder **src/scripts** and generate the new json of the fires executing the script:
```
npm run
```
and copy the result in **constants.js**:
* incendisList
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
### `npm run test-flow`
Runs the static type checks.
## Folder structure
__build:__ Contains the built files generated by the scripts (dev package, minified package and map)
__src:__ Contains an index file that requires all the modules that should be exported and all the source files that compound the package.
__src/components:__ Contains all the components used in the project
__src/resources:__ Images and resources to use inside the project
__src/scripts:__ Contains the files needed to update anually de data being used in the project
## Deploy
El deploy automatic es fa en una màquina amb les següents dependencies:
- Apache o nginx
- Nodejs
```
mkdir build
npm install
npm build
mv ./* /var/www/html/
```
### Crear directori web *"focalbosc"*
### Copiar
**index.html** i el directori **/dist** dins directori web
## License
Copyright (c) 2019 - Geostarters (MIT License) See LICENSE file for more info.