MAAP-Project / get-dem

A wrapper around `https://github.com/scottstanie/sardem` for use with the MAAP project.
Apache License 2.0
0 stars 1 forks source link

Some bbox inputs raise numpy.linalg.LinAlgError: Singular matrix #7

Closed chuckwondo closed 6 months ago

chuckwondo commented 7 months ago

The do_computations function attempts to compute the multiplicative inverse of a square matrix. When the matrix is not invertible (i.e., its determinant is 0), the following error is raised: numpy.linalg.LinAlgError: Singular matrix

The fix for this is to simply compute the pseudo-inverse, which does not require the matrix to be invertible.