This project was created on MacOS and the guide below is therefore for MacOS only. Additional steps may be required for other operating systems.
git clone https://github.com/qu-b/solar
cd solarCreate a Conda environment and install the required packages.
conda create -n solar python=3.11
conda activate solar
pip install -r requirements.txtSet up the necessary environment variables. Replace your_google_maps_api_key with your actual API key.
export GOOGLE_MAPS_API_KEY=your_google_maps_api_keyThe data can be downloaded here: https://opendata.swiss/de/dataset/eignung-von-hausdachern-fur-die-nutzung-von-sonnenenergie/resource/2446ce7b-8709-42a1-b293-49b48129a5b4
brew install postgresql
brew install gdalbrew services start postgresqlcreatedb solardbbrew install postgispsql -d solardb -c "CREATE EXTENSION IF NOT EXISTS postgis;"Download the data from the provided link and import it into the PostGIS database.
ogr2ogr -f "PostgreSQL" PG:"dbname=solardb host=localhost" "/path/to/your/SOLKAT_DACH.gpkg"psql -d solardb -c "CREATE USER solar WITH PASSWORD 'solar';"
psql -d solardb -c "GRANT ALL PRIVILEGES ON DATABASE solardb TO solar;"
psql -d solardb -c "GRANT SELECT ON TABLE solkat_ch_dach TO solar;"python app.pyWe welcome contributions and suggestions to improve this project. If you have any ideas or issues, please feel free to open an issue or create a pull request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
