From 293e9ae5f8d8e596385228d10c0d01553c070abd Mon Sep 17 00:00:00 2001 From: Shawn Laffan Date: Wed, 7 Aug 2019 17:57:49 +1000 Subject: [PATCH] export additional hash lists Updates #161 --- lib/Biodiverse/Cluster.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Biodiverse/Cluster.pm b/lib/Biodiverse/Cluster.pm index de2d8ca85..4bd1ccc7a 100644 --- a/lib/Biodiverse/Cluster.pm +++ b/lib/Biodiverse/Cluster.pm @@ -497,17 +497,16 @@ sub export_shapefile { my @data_for_gdal_layer; if ($list_name) { - my %list_data = $branch->get_list_values ( - #element => $branch_name, - list => $list_name, - ); + my $list_data = $branch->get_list_ref (list => $list_name) // {}; # write a separate shape for each label - foreach my $key (natsort keys %list_data) { + foreach my $key (natsort keys %$list_data) { + # skip text vals for now + next if !looks_like_number ($list_data->{$key} // $nodata); my %data = ( BRANCH => $branch_name, KEY => $key, - VALUE => ($list_data{$key} // $nodata), + VALUE => ($list_data->{$key} // $nodata), ); push @data_for_gdal_layer, \%data; }