This project requires the following dependencies:
You can set up the project using either a Python virtual environment (venv
) or Conda. Follow the instructions below to create the environment and install the dependencies.
- Python installed on your system. Ensure you have Python 3.8 or later.
-
Create a Virtual Environment:
python -m venv .venv
-
Activate the Virtual Environment:
-
On Windows:
.venv\Scripts\activate
-
On macOS/Linux:
source .venv/bin/activate
-
-
Install Dependencies:
pip install numpy pyproj GDAL
-
Install QGIS:
Download and install QGIS from the official QGIS website.
Obs: If you encounter errors like from qgis.core import * ModuleNotFoundError: No module named 'qgis'
, please refer to Issues. For .venv
, adding the following line before the import of qgis
should solve (in Ubuntu):
import sys
sys.path.insert(0,"/usr/lib/python3/dist-packages")
from qgis.core import *
- Conda installed on your system. You can install Conda by downloading and installing Miniconda or Anaconda.
-
Clone the Repository:
git clone [email protected]:hmoyen/current-maps.git cd current-maps
-
Create a Conda Environment:
conda create --name myenv python=3.8
-
Activate the Conda Environment:
conda activate myenv
-
Install Dependencies:
conda install numpy pyproj gdal
-
Install QGIS:
You can install QGIS through Conda by following the instructions on the QGIS website. Typically, this involves adding a specific channel and then installing QGIS:
conda install qgis --channel conda-forge
After installing the dependencies, you can verify the installation by running the following Python commands:
import numpy as np
import pyproj
import osgeo.gdal
import qgis
print("All dependencies are successfully installed!")
This script reads a .p3d
file and extract the vector field that to .txt
files.
This code will then read the .txt
files to create a .tif
file with all the data of the current field. The generated .tiff
can be used in the index.html
file in tornado-web
repo. Run in terminal (in the virtual environment, if you are using one):
python3 gdal_geotiff.py