Giter Club home page Giter Club logo

pylusat's Introduction

PyLUSAT

PyPI version PyPI - Python version pytest license

Python Land-Use Suitability Analysis Toolkit

Introduction

PyLUSAT intends to provide users with tools that can be used to conduct land-use suitability analysis.

Please cite:

Chen, C., Judge, J., Hulse, D. (2022). PyLUSAT: An open-source Python toolkit for GIS-based land use suitability analysis. Environmental Modelling and Software. doi: https://doi.org/10.1016/j.envsoft.2022.105362

Available Geospatial Functions

  • Distance (point, line, raster)
  • Density (point, line)
  • Reclassify
  • Interpolation (inverse distance weighting)
  • Spatial Join
  • Zonal Statistics
  • Analytic Hierarchy Process

Install

PyLUSAT depends on the following packages.

  • geopandas
  • rasterio
  • rasterstats
  • scipy

pylusat's People

Contributors

agur avatar chjch avatar eidealex avatar korarsenault avatar

Stargazers

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

Watchers

 avatar

Forkers

agur

pylusat's Issues

Pip install fails on windows

Hi,
I'm trying to install in a conda virtual environment on Windows 10, but fails:
Are there any pre-requisites for using the package?
TIA,

$ pip install pylusat
Collecting pylusat
  Using cached pylusat-0.5.2-py3-none-any.whl (4.2 MB)
Requirement already satisfied: scipy in c:\users\********\miniconda3\envs\gisenv\lib\site-packages (from pylusat) (1.7.3)
Collecting geopandas
  Using cached geopandas-0.10.2-py2.py3-none-any.whl (1.0 MB)
Collecting rasterio
  Using cached rasterio-1.2.10.tar.gz (2.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\********\Miniconda3\envs\gisenv\python.exe' 'C:\Users\********\Miniconda3\envs\gisenv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\********\AppData\Local\Temp\tmpb4umxeh5'
       cwd: C:\Users\********\AppData\Local\Temp\pip-install-wggztvbu\rasterio_805f398dafc749ffbe2842e9b17b14ad\
  Complete output (2 lines):
  INFO:root:Building on Windows requires extra options to setup.py to locate needed GDAL files. More information is available in the README.
  ERROR: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/44/5e/9f19e1e6fe980b59d8da8809f2e8f81eb7f0322c71914f077edcbcd9a110/rasterio-1.2.10.tar.gz#sha256=6062456047ba6494fe18bd0da98a383b6fad5306b16cd52a22e76c59172a2b5f (from https://pypi.org/simple/rasterio/) (requires-python:>=3.6). Command errored out with exit status 1: 'C:\Users\********\Miniconda3\envs\gisenv\python.exe' 'C:\Users\********\Miniconda3\envs\gisenv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\********\AppData\Local\Temp\tmpb4umxeh5' Check the logs for full command output.

Libs install fail w/ different errors on clean mac/linux python 3.9/3.10 envs

  • Getting failure on installation on python 3.9.13 on mac and 3.10.6 on linux (Ubuntu 22.04 LTS). And tried on fresh virtual envs on both mac and linux. Got different errors on either, and logged below.
  • Got a fix which I can send separately as a suggestion PR. It's a library update, w/ fixed versions (not dynamically getting latest, more stable), yet also added libs needed for running the jupyter notebooks.
    • Also was not using the setup.sh file, standard attempts to use it didn't work thus resorted to directly using requirements.txt.
  • Clean new virtualenv test command to predictably reproduce:
    • Test w/ virtualenvwrapper:
    • time { deactivate; rmvirtualenv lusa; mkvirtualenv lusa; python -m pip install --upgrade pip && pip install -r requirements.txt && pytest; }
  • Failure on linux:
    •         numpy/core/src/multiarray/scalartypes.c.src:3325:31: error: incompatible type for argument 1 of ‘_Py_HashDouble’
               3325 |     hashimag = _Py_HashDouble((double)
                    |                               ^~~~~~~~
                    |                               |
                    |                               double
               3326 |             (((PyC@name@ScalarObject *)obj)->obval).imag);
                    |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              In file included from /usr/include/python3.10/Python.h:77,
                               from numpy/core/src/multiarray/scalartypes.c.src:3:
              /usr/include/python3.10/pyhash.h:10:38: note: expected ‘PyObject *’ {aka ‘struct _object *’} but argument is of type ‘double’
                 10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
                    |                                      ^~~~~~~~~~
              numpy/core/src/multiarray/scalartypes.c.src:3325:16: error: too few arguments to function ‘_Py_HashDouble’
               3325 |     hashimag = _Py_HashDouble((double)
                    |                ^~~~~~~~~~~~~~
              In file included from /usr/include/python3.10/Python.h:77,
                               from numpy/core/src/multiarray/scalartypes.c.src:3:
              /usr/include/python3.10/pyhash.h:10:23: note: declared here
                 10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
                    |                       ^~~~~~~~~~~~~~
              numpy/core/src/multiarray/scalartypes.c.src: In function ‘half_arrtype_hash’:
              numpy/core/src/multiarray/scalartypes.c.src:3341:27: error: incompatible type for argument 1 of ‘_Py_HashDouble’
               3341 |     return _Py_HashDouble(npy_half_to_double(((PyHalfScalarObject *)obj)->obval));
                    |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    |                           |
                    |                           double
              In file included from /usr/include/python3.10/Python.h:77,
                               from numpy/core/src/multiarray/scalartypes.c.src:3:
              /usr/include/python3.10/pyhash.h:10:38: note: expected ‘PyObject *’ {aka ‘struct _object *’} but argument is of type ‘double’
                 10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
                    |                                      ^~~~~~~~~~
              numpy/core/src/multiarray/scalartypes.c.src:3341:12: error: too few arguments to function ‘_Py_HashDouble’
               3341 |     return _Py_HashDouble(npy_half_to_double(((PyHalfScalarObject *)obj)->obval));
                    |            ^~~~~~~~~~~~~~
              In file included from /usr/include/python3.10/Python.h:77,
                               from numpy/core/src/multiarray/scalartypes.c.src:3:
              /usr/include/python3.10/pyhash.h:10:23: note: declared here
                 10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
                    |                       ^~~~~~~~~~~~~~
              numpy/core/src/multiarray/scalartypes.c.src: In function ‘longdouble_arrtype_hash’:
              numpy/core/src/multiarray/scalartypes.c.src:3312:1: warning: control reaches end of non-void function [-Wreturn-type]
               3312 | }
                    | ^
              numpy/core/src/multiarray/scalartypes.c.src: In function ‘float_arrtype_hash’:
              numpy/core/src/multiarray/scalartypes.c.src:3312:1: warning: control reaches end of non-void function [-Wreturn-type]
               3312 | }
                    | ^
              numpy/core/            numpy/core/src/multiarray/scalartypes.c.src: In function ‘half_arrtype_hash’:
              numpy/core/src/multiarray/scalartypes.c.src:3342:1: warning: control reaches end of non-void function [-Wreturn-type]
               3342 | }
                    | ^
              error: Command "x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Ibuild/src.linux-x86_64-3.1/numpy/core/src/umath -Ibuild/src.linux-x86_64-3.1/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.1/numpy/core/src/common -Inumpy/core/include -Ibuild/src.linux-x86_64-3.1/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/home/vagrant/.virtualenvs/lusa/include -I/usr/include/python3.10 -Ibuild/src.linux-x86_64-3.1/numpy/core/src/common -Ibuild/src.linux-x86_64-3.1/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.1/numpy/core/src/common -Ibuild/src.linux-x86_64-3.1/numpy/core/src/npymath -c build/src.linux-x86_64-3.1/numpy/core/src/multiarray/scalartypes.c -o build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.1/numpy/core/src/multiarray/scalartypes.o -MMD -MF build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.1/numpy/core/src/multiarray/scalartypes.o.d" failed with exit status 1
              [end of output]
      
- Failure on Mac:
  - ```...
      Warning: Unused dummy argument 'itry' at (1) [-Wunused-dummy-argument]
      stat.h:8:35:
      
      Warning: Unused variable 't4' declared at (1) [-Wunused-variable]
      stat.h:8:39:
      
      Warning: Unused variable 't5' declared at (1) [-Wunused-variable]
      scipy/sparse/linalg/eigen/arpack/ARPACK/SRC/zneupd.f:520:17:
      
        520 |             jj = workl(bounds + ncv - j)
            |                 1
      Warning: Possible change of value in conversion from COMPLEX(8) to INTEGER(4) at (1) [-Wconversion]
      stat.h:8:19:
      
      Warning: Unused variable 't0' declared at (1) [-Wunused-variable]
      stat.h:8:23:
      
      Warning: Unused variable 't1' declared at (1) [-Wunused-variable]
      stat.h:8:27:
      
      Warning: Unused variable 't2' declared at (1) [-Wunused-variable]
      stat.h:8:31:
      
      Warning: Unused variable 't3' declared at (1) [-Wunused-variable]
      stat.h:8:35:
      
      Warning: Unused variable 't4' declared at (1) [-Wunused-variable]
      stat.h:8:39:
      
      Warning: Unused variable 't5' declared at (1) [-Wunused-variable]
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/iswap.f
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/second_NONE.f
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/zmout.f
      scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/second_NONE.f:17:27:
      
         17 |       REAL               T1
            |                           1
      Warning: Unused variable 't1' declared at (1) [-Wunused-variable]
      scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/second_NONE.f:20:36:
      
         20 |       REAL               TARRAY( 2 )
            |                                    1
      Warning: Unused variable 'tarray' declared at (1) [-Wunused-variable]
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/smout.f
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/icnteq.f
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/ivout.f
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/icopy.f
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/SRC/ssgets.f
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/cvout.f
      stat.h:8:27:
      
      Warning: Unused variable 't2' declared at (1) [-Wunused-variable]
      stat.h:8:31:
      
      Warning: Unused variable 't3' declared at (1) [-Wunused-variable]
      stat.h:8:35:
      
      Warning: Unused variable 't4' declared at (1) [-Wunused-variable]
      stat.h:8:39:
      
      Warning: Unused variable 't5' declared at (1) [-Wunused-variable]
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/zvout.f
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/svout.f
      gfortran:f77: scipy/sparse/linalg/eigen/arpack/ARPACK/UTIL/dmout.f
      gfortran:f77: /private/var/folders/1n/rm6tc95s6ng8_qwhc31w9t4h0000gn/T/pip-install-ez04p9wj/scipy_11564edbbb4848458838c09bc40640f2/scipy/_build_utils/src/wrap_dummy_g77_abi.f
      error: Command "/usr/local/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops -Iscipy/sparse/linalg/eigen/arpack/ARPACK/SRC -I/private/var/folders/1n/rm6tc95s6ng8_qwhc31w9t4h0000gn/T/pip-build-env-h37y_4mq/overlay/lib/python3.9/site-packages/numpy/core/include -c -c scipy/sparse/linalg/eigen/arpack/ARPACK/SRC/cnaup2.f -o build/temp.macosx-10.15-x86_64-cpython-39/scipy/sparse/linalg/eigen/arpack/ARPACK/SRC/cnaup2.o" failed with exit status 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for scipy
Failed to build scipy
ERROR: Could not build wheels for scipy, which is required to install pyproject.toml-based projects

How to use functions

Very helpful python package. Can you please provide some example code on how to use the functions of the package? Thanks

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.