Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 1.16 KB

README.md

File metadata and controls

3 lines (2 loc) · 1.16 KB

This repository is split into 3 sections. The parent folder contains only one relevant file, index.html, that specifies the rules by which the homepage is constructed. The data folder contains a few files. The first, gis_process.py, accepts a config file as an argument, and parses GIS DEM .img files and outputs a geojson file that contains the relevant gradient information. The .geojson files are just example outputs of gis_process.py and the xxx_config files are examples of the config file format. The cgi-bin folder has two relevant files. The first, calculate_path.py, is executed when the HTML form in index.html is submitted. It in turn calls check_roads.py which calculates the maximum gradient along the specified pathway.

To run this program, simply run the command "python3 -m http.server --cgi" while in the parent folder and then go to localhost:8000 in your web browser. In order for the code to work, one needs to have both python2, python3, and osgeo.gdal downloaded. Due to an installation error, the path to the osgeo.gdal installation is hardcoded into gis_process.py and check_roads.py so those lines should also be edited to fit with your particular installation.