Skip to content

[POC] add metrics from demcompare #602

Closed
@adebardo

Description

Context

The purpose of this ticket is to implement the demcompare metrics into geoutils. We have decided not to include them in xdem because these measurements apply specifically to rasters.

Code

We propose first to copy the metric directory from demcompare into geoutils.

Example script:

import geoutils as gu  
from geoutils.metric import Metric  
  
filename_rast = gu.examples.get_path("exploradores_aster_dem")  
rast = gu.Raster(filename_rast)  
  
metric_obj = Metric("pdf")  
output = metric_obj.compute_metric(rast.data)  
  
print(output)

To do:

  • Remove the matrix_2d_metrics file and open a ticket to move the SVF to the terrain attributes in xdem (also check the init file).
  • Recode the compute_surface_normal and remove_nan_and_flatten functions in geoutils.

Tests

For testing, you can retrieve and adapt the following files:

Documentation

A section should be added inspired by the demcompare documentation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions