Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reminder about 'richdem' #191

Closed
1 of 2 tasks
michaeldorman opened this issue Sep 28, 2023 · 6 comments · Fixed by #192
Closed
1 of 2 tasks

Reminder about 'richdem' #191

michaeldorman opened this issue Sep 28, 2023 · 6 comments · Fixed by #192

Comments

@michaeldorman
Copy link
Collaborator

michaeldorman commented Sep 28, 2023

@michaeldorman
Copy link
Collaborator Author

michaeldorman commented Oct 7, 2023

  1. To look for GDAL-based alternative to 'richdem' in https://py.geocompx.org/03-spatial-operations#sec-focal-operations
  2. Implement the same solution for https://py.geocompx.org/05-raster-vector#raster-to-contours (?) - Done

@Robinlovelace
Copy link
Contributor

Great work Michael. In the meantime, I will explore other ways to install it in our image..

@Robinlovelace
Copy link
Contributor

I tried

run -it ghcr.io/geocompx/docker:python /bin/bash                                                                                      

Resulting in following error:

10/07/2023 09:27:00 pm
root@4c64d4844f2a:/# pip install richdem
Collecting richdem
  Downloading richdem-0.3.4.tar.gz (329 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 329.4/329.4 kB 3.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy<2,>=1.7 in /usr/local/lib/python3.11/site-packages (from richdem) (1.24.0)
Building wheels for collected packages: richdem
  Building wheel for richdem (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      Using RichDEM hash=Unknown, time=Unknown
      /usr/local/lib/python3.11/site-packages/setuptools/dist.py:771: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        warnings.warn(
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/richdem
      copying richdem/__init__.py -> build/lib.linux-x86_64-cpython-311/richdem
      copying richdem/cli.py -> build/lib.linux-x86_64-cpython-311/richdem
      running build_ext
      COMPILER unix
      COMPILER ARGUMENTS ['-std=c++11', '-g', '-fvisibility=hidden', '-O3', '-Wno-unknown-pragmas']
      building '_richdem' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/lib
      creating build/temp.linux-x86_64-cpython-311/lib/richdem
      creating build/temp.linux-x86_64-cpython-311/lib/richdem/common
      creating build/temp.linux-x86_64-cpython-311/src
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DDOCTEST_CONFIG_DISABLE -DRICHDEM_COMPILE_TIME=\"\\\"Unknown\\\"\" -DRICHDEM_GIT_HASH=\"\\\"Unknown\\\"\" -DRICHDEM_LOGGING -D_USE_MATH_DEFINES -Ilib/ -I/usr/local/include/python3.11 -c lib/richdem/common/random.cpp -o build/temp.linux-x86_64-cpython-311/lib/richdem/common/random.o -std=c++11 -g -fvisibility=hidden -O3 -Wno-unknown-pragmas
      error: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for richdem
  Running setup.py clean for richdem
Failed to build richdem
ERROR: Could not build wheels for richdem, which is required to install pyproject.toml-based projects

@Robinlovelace
Copy link
Contributor

As documented in comments here, I still can find no way to install it: r-barnes/richdem#65

Was hoping it would be fixed upstream but not sure it will be now..

@Robinlovelace
Copy link
Contributor

@Robinlovelace Robinlovelace linked a pull request Oct 8, 2023 that will close this issue
@Robinlovelace
Copy link
Contributor

I think xarray functions are strong here, e.g. https://xarray-spatial.org/user_guide/surface.html

I've tried that in #192 but it's not working for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants