$hstoredec = Pg::hstore::decode($row->{'tags'});
}
my $levels = fetchlastofhr(1, $hstoredec, 'levels', 'building:levels');
$hstoredec = Pg::hstore::decode($row->{'tags'});
}
my $levels = fetchlastofhr(1, $hstoredec, 'levels', 'building:levels');
- my $height = fetchlastofhr($height, $hstoredec, 'height', 'building:height');
- unless ($height =~ m/^[0-9.]+$/) { undef($height); }
+ my $height = fetchlastofhr(undef, $hstoredec, 'height', 'building:height');
+ unless ((defined($height)) && ($height =~ m/^[0-9.]+$/)) {
+ undef($height);
+ }
my $minlevel = fetchlastofhr(0, $hstoredec,
'min_levels', 'building:min_levels', 'min_level', 'building:min_level');
my $minlevel = fetchlastofhr(0, $hstoredec,
'min_levels', 'building:min_levels', 'min_level', 'building:min_level');
- my $minheight = fetchlastofhr($minheight, $hstoredec, 'min_height', 'building:min_height');
- unless ($minheight =~ m/^[0-9.]+$/) { undef($minheight); }
+ my $minheight = fetchlastofhr(undef, $hstoredec, 'min_height', 'building:min_height');
+ unless ((defined($minheight)) && ($minheight =~ m/^[0-9.]+$/)) {
+ undef($minheight);
+ }
my $shape = fetchlastofhr(undef, $hstoredec, 'building:shape');
my $material = fetchlastofhr(undef, $hstoredec,
'building:material', 'building:facade:material', 'building:cladding');
my $shape = fetchlastofhr(undef, $hstoredec, 'building:shape');
my $material = fetchlastofhr(undef, $hstoredec,
'building:material', 'building:facade:material', 'building:cladding');
}
if (defined($roofshape)) {
if ($roofshape eq 'pyramidal') { $roofshape = 'pyramid'; }
$roofshape = JSON->new->allow_nonref->encode($roofshape);
}
if (defined($roofshape)) {
if ($roofshape eq 'pyramidal') { $roofshape = 'pyramid'; }
$roofshape = JSON->new->allow_nonref->encode($roofshape);
}
if (defined($roofheight)) {
$roofheight = sprintf("%.1f", $roofheight);
}
if (defined($roofheight)) {
$roofheight = sprintf("%.1f", $roofheight);