die if $prs2region{$prs};
$prs2region{$prs} = $rn;
}
-
- # bodgery for the sea and land
- $prs2region{'NZ | L'} = 'NZ';
- $prs2region{'L | NZ'} = 'NZ';
}
our $sre = qr{(?:(\")|(?=\w))(.*)\1$}; # 2 captures, $2 is the name
-sub prs2r ($) { $prs2region{$_[0]} // confess "@_ ?" }
+sub prs2r ($) {
+ # bodgery for the sea and land
+ return 'NZ' if m/ \| / && !grep { !m{^(?:NZ|L2?)$} } split / \| /, $_[0];
+ $prs2region{$_[0]} // confess "@_ ?"
+}
sub prs2rr ($) { $region{prs2r($_[0])} }
#----- file reader for plag output -----
my $last_ai;
if ($rr->{Name} eq 'NZ') {
# We combined L and NZ; now we must split them again
- # in fact, we just throw away L entirely.
+ # in fact, we just throw away L and L2 entirely.
# Here, when processing NZ, we keep only vertices that
# are part of NZ.
@edges = grep {
}
$process_rr->();
- $region{$_}{Special} = 1 foreach qw(NZ L);
+ $region{$_}{Special} = 1 foreach qw(NZ L L2);
}
#----- geometry mangling -----
sub fill_faces() {
o("clippath ", facepscolour('land'), " fill\n");
foreach my $rr (values %region) {
- next if $rr->{Name} eq 'L';
+ next if $rr->{Name} =~ m/^L2?$/;
face_path($rr);
o(" ", facepscolour($rr->{Colour}), " eofill\n");
}
sub some_edge_faces (@) {
o("5 setlinewidth 1 setlinejoin 0 setgray\n");
foreach my $rr (@_) {
- next if $rr->{Name} eq 'L';
+ next if $rr->{Name} =~ m/^L2?$/;
face_path($rr);
o(" stroke\n");
}
some_edge_faces($region{'NZ'});
afsluitdijk();
some_edge_faces(grep {
- my $n = $_->{Name};
- !($n eq 'L' || $n eq 'NZ' || $n eq 'ZZ')
+ $_->{Name} !~ m{^(?:L2?|NZ|ZZ)$}
} values %region);
}