Skip to content

Error when one or both datasets has no trees #1

@forestanalysis

Description

@forestanalysis

I am running "match_trees" on the large tree plot separately from the small tree plot. In some cases, there are no trees (either field measured or MLS detected) on the small tree plot. This causes an error in match_trees.
I'm attaching the field measured trees (inventory.csv) and the MLS detected trees (measure.csv).
The last line of the following code generated the error.

inventory_STP <- standardize(inventory[inventory$Plotsize=="Small",], "Field_Xpj", "Field_Ypj", "Ht", zunits = "m", crs = 2959, idname = "Tree")
measure_STP <- standardize(measure[measure$Plotsize=="Small",], "X", "Y", "Ht", zunits = "m", crs = 2959, idname = "treeID")
center <- c(as.numeric(inventory$Easting[1]), as.numeric(inventory$Northing[1]))
smallmap <- make_mapmatching(inventory_STP, measure_STP, center = center, radius = 4, buffer = 0.5)
match_trees(smallmap, lsap_matching,dxymax = 2, dzmax = 40, zrel = 40, unmatch_cost = 1000 )

inventory.csv

measure.csv

Thank you for any help on resolving the issue.

Metadata

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