SDFIdk / DHMQC

Processing suite for the Danish Digital Elevation Model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migrate to laspy 2.x

plimkilde opened this issue · comments

We should update to laspy 2.x, but this is currently blocked on the lack of LAZ backend packages on conda-forge.

Laspy 1.x handles LAZ files by piping them through the laszip executable in LAStools, but this is no longer supported in laspy 2.x. To use laspy 2.x, we need to either:

  • manually install a LAZ backend with Python bindings (LASzip or laz-rs) using pip in the environment. Kind of hack-ish.
  • await creation of a conda-forge package for one of those backends

Go with option 1. It's easy and not hackish at all. It's standard conda practice:

environment.yml:

name: dhmqc-dev
channels:
  - conda-forge
dependencies:
  - gdal
  - owslib
  - psycopg2
  - numpy
  - scipy
  - pandas
  - laspy=1.7
  - laszip
  - lastools
  # For testing only
  - nose
  - pip:
    - lazrs

Ah well, that was easy 😅 Strictly speaking, pip also needs to be added as a dependency, so lazrs is obtained by adding:

  - pip
  - pip:
    - lazrs

I'll get cracking on adapting DHMQC to the laspy 2.x API. Thanks!