Skip to content

hmoyen/current-maps

Repository files navigation

Overview

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.

Setting Up with venv or in Local Machine with PIP

Prerequisites

  • Python installed on your system. Ensure you have Python 3.8 or later.

Steps

  1. Create a Virtual Environment:

    python -m venv .venv
  2. Activate the Virtual Environment:

    • On Windows:

      .venv\Scripts\activate
    • On macOS/Linux:

      source .venv/bin/activate
  3. Install Dependencies:

    pip install numpy pyproj GDAL
  4. 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 *

Setting Up with Conda

Prerequisites

  • Conda installed on your system. You can install Conda by downloading and installing Miniconda or Anaconda.

Steps

  1. Clone the Repository:

    git clone [email protected]:hmoyen/current-maps.git
    cd current-maps
  2. Create a Conda Environment:

    conda create --name myenv python=3.8
  3. Activate the Conda Environment:

    conda activate myenv
  4. Install Dependencies:

    conda install numpy pyproj gdal
  5. 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

Verifying Installation

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!")

Running the scripts

read.py

This script reads a .p3d file and extract the vector field that to .txt files.

gdal_geotiff

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages