Code Monkey home page Code Monkey logo

lsat's Introduction

LSAT

DOI

LSAT PM (Landslide Susceptibility Assessment Tools Project Manager Suite) was primarily developed to conduct landslide susceptibility analyses, it is not limited to this issue and applies to any other research dealing with supervised spatial binary classification. We tested LSAT on Windows and Linux (Ubuntu 20.04). LSAT uses Python3 and great packages like PyQt5, sklearn and GDAL.

LSAT aims to be an easy to use Toolkit. Giving the user more time to focus on their research instead of the inner workings of the tools they use.

How to run LSAT

The easiest way to run LSAT on Windows is to download the most recent installer here.

Running LSAT from source on Windows

  1. Make sure you have Python 3 installed (3.10 tested), if not you can get it from python.org/downloads.
  2. Download LSAT
  3. Navigate to the LSAT directory and open a PowerShell window (if you downloaded a zipped version you will need to unzip LSAT first).
  4. Create a virtual environment
python -m venv venv
  1. Activate the virtual environment (venv should appear in the command line, indicating you were successful)
.\venv\Scripts\activate
  1. Install the required packages
python -m pip install -r requirements.txt

Additionally to the packages listed in the requirements.txt you will need GDAL (3.6.1 tested). Unfortunately, GDAL can usually not simply be installed with a pip command. You can either download a .whl file from Christoph Gohlkes fantastic repository or build it yourself. Installing a .whl file:

python -m pip install *path to .whl file*
  1. Start LSAT PM
python startMenu_main.py

After the initial setup you just need to open the powershell window, activate the venv and start LSAT PM to run it.

Running LSAT from source on Linux (Ubuntu 20.04.3 tested)

  1. Download LSAT
  2. Navigate to the LSAT directory and open a Terminal (if you downloaded a zipped version you will need to extract LSAT first).
  3. Install Python packages (venv, pip, python development tools), gdal and libraries for Qt
sudo apt install python3-venv python3-pip gdal-bin libgdal-dev python3-dev '^libxcb.*-dev'
  1. Create a virtual environment
python3 -m venv venv
  1. Activate the virtual environment (venv should appear in the command line, indicating you were successful)
source venv/bin/activate
  1. Install the required packages
python3 -m pip install -r requirements.txt

Additionally to the packages listed in the requirements.txt you will need GDAL (3.0.4 tested). Unfortunately, GDAL can usually not simply be installed with the standard pip command. You need to specify the version based on the gdal version installed. To get the installed version run

ogrinfo --version

It will output something like: "GDAL $VERSION, released $RELEASEDATE". Now install that version

python3 -m pip install gdal==$VERSION
  1. Start LSAT PM
python3 startMenu_main.py

After the initial setup you just need to open a terminal, activate the venv and start LSAT PM to run it.

Documentation

All windows installers come with documentation. Alternatively you can find the current documentation and documentation for older releases (see releases) here. An online version of the documentation is available on readthedocs.io.

Test dataset

We offer a test dataset to try out LSAT here.

License

Distributed under the GPLv3 License, see LICENSE.txt.

Feedback

Bug reports are welcome! Please use GitHub issues to report bugs.

lsat's People

Contributors

bgr-egha avatar dependabot[bot] avatar luis4ever22 avatar nck00 avatar torizin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lsat's Issues

Error with ANN

Hi BGR,
I'm writing because I'm getting an error running the LSAT tool. I have run it multiple times without any problem, however, the last time that I used the app with the Analytic Neural Networks I'm getting this error :
[ERROR] 2022-11-17 15:12:33 Traceback (most recent call last): File "D:\LSAT_Susceptibility\LSAT-main\core\libs\Analysis\ann_calc.py", line 79, in run probab = model.predict_proba(stack_full.T)[:, 1] File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\site-packages\sklearn\neural_network_multilayer_perceptron.py", line 1243, in predict_proba y_pred = self._forward_pass_fast(X) File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\site-packages\sklearn\neural_network_multilayer_perceptron.py", line 167, in forward_pass_fast activation = safe_sparse_dot(activation, self.coefs[i]) File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\site-packages\sklearn\utils\extmath.py", line 153, in safe_sparse_dot ret = a @ b numpy.core._exceptions._ArrayMemoryError: Unable to allocate 24.3 GiB for an array with shape (65329200, 100) and data type float32

So, I don't know why this error appears when the raster type and the type of data are according to the tool request
regards
Daniel

LSAT crashes when importing raster

I'm running LSAT on Windows 11 with Python 3.10. I tried to get the software going via the installer and from source, but both times ran into issues with importing raster-files.

I installed it the first time via the installer and was able to create a new project based on raster boundaries, but had problems to import a DEM raster. The software wasn't responding, even after running it for a whole night. I also tried to split the raster into smaller pieces, but I still couldn't import it.
Today, I tried to install LSAT from source, but whenever I create a new project from raster boundaries, it crashes. The software just closes without any information.

Does this issue sound familiar to you?

error: subprocess-exited-with-error

Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [43 lines of output]
Partial import of sklearn during the build process.
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
Traceback (most recent call last):

Bug in a new project

Hi there, I'm trying to use the BGR/LSAT, I already installed all the libs needed for this script. However, when I try to create a new project, the python prompt cratch with this message FileNotFoundError: [Errno 2] No such file or directory: 'core\gdal_data\gcs.csv'. I looked for that file and it already exists.

Error: No module named 'osgeo'

Hello,
I was trying to explore the LSAT tool but encountered with an error at starting of start menue:
File "D:\LSAT-1.0.1\BGR-EGHA-LSAT-3fa695c\startMenu_main.py", line 3, in
from osgeo import gdal
ModuleNotFoundError: No module named 'osgeo'

Linear Regression

Hi BGR,
I have a question, when I used the Linear Regression analysis, I got a problem with the following error message:
Traceback (most recent call last):
File "D:\LSAT-main\core\libs\Analysis\LogisticRegressionAnalysis.py", line 49, in run
stack, labels, stack_full, noDataArray, nr_of_unique_parameters = rasterprepwork.prepareInputData(
File "D:\LSAT-main\core\libs\Rasterprepwork\rpw_main.py", line 39, in prepareInputData
stack_red, stack = self.getstackFromCategoricalData(
File "D:\LSAT-main\core\libs\Rasterprepwork\rpw_main.py", line 114, in getstackFromCategoricalData
value_array_red = value_array[noDataArray != raster.nodata]
numpy.core._exceptions.MemoryError: Unable to allocate 629. MiB for an array with shape (1, 15577, 21186) and data type int16

However, this error does not occur when my parameters are in discrete data. So, Do I have to input the data in discrete data? or is that a error? Can I solve that issue?

Creating project - Cannot find proj.db

Hi BGR,

I managed to install LSAT, but I'm having the following error when creating a new project:
(lsat) C:\Users\vcuer\Documents\LSAT-main>python C:\Users\vcuer\Documents\LSAT-main\LSAT-main\startMenu_main.py
ERROR 1: PROJ: proj_create_from_database: Cannot find proj.db
ERROR 1: PROJ: proj_create_from_database: Cannot find proj.db
(lsat) C:\Users\vcuer\Documents\LSAT-main>

Any thoughts about what the error might be?

  • My dem is in EPSG 32610 in tiff format. I tried with the testing dataset and got the same issue.
  • My GDAL file is in the same directory C:\Users\vcuer\Documents\LSAT-main\LSAT-main\GDAL-3.4.3-cp310-cp310-win_amd64.whl
    I attached the yml for reference.
    Thanks!
    lsat.zip

LSAT not work

Hi all.

I have tried to use this software, but it's not working on my PC. I have Windows 10, and specifically, I have problems with the extent (see screenshot). I installed this software with the installer and Python commands, but it's not working.

Please consider this issue. I'm Ph.D. student, and I'm very interesting to use this software for my landslide susceptibility research.

Best regards.

screenshot

New project error

when i click create project
ERROR 1: PROJ: proj_identify: C:\Program Files\GDAL\projlib\proj.db contains DATABASE.LAYOUT.VERSION.MINOR = 0 whereas a number >= 2 is expected. It comes from another PROJ installation.
resim_2023-01-05_125547042

please tell me how can i fix it?

Crash when importing raster.

I found LSAT crashing when importing a new raster, specifically around this area:

https://github.com/BGR-EGHA/LSAT/blob/main/core/widgets/ImportData/importData_importRaster.py#L109

issue: rasterNoDataLocation being called before assignment; this happens because of this if statement

  if raster.nodata:
      if np.isnan(raster.nodata):
          np.nan_to_num(rasterarray, copy=False, nan=-9999)
          rasterNoDataLocation = np.argwhere(rasterarray == -9999)
      else:
          rasterNoDataLocation = np.argwhere(rasterarray == raster.nodata)
  else:
      rasterNoData = ((),()) # tuple of two empty tuples to indicate absence of NoData

note the outer else statement sets a variable named rasterNoData instead of rasterNoDataLocation which means that if if raster.nodata is False then rasterNoDataLocation is never defined. Also the value of rasterNoData cannot be a tuple since rasterNoDataLocation is dealing with numpy arrays, hence a tuple would also fail later on line 114 (rasterNoDataLocation.shape) since tuples don't have the a property called shape (only numpy arrays do). I'm proposing this PR to fix both issues (tested locally, and now I can import my raster successfully)

Pull Request: #36
@BGR-EGHA

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.