Skip to content

Commit

Permalink
* changed remaining code for new street category NH
Browse files Browse the repository at this point in the history
  • Loading branch information
eserte committed Jan 9, 2010
1 parent 8c75d4d commit 83d681c
Show file tree
Hide file tree
Showing 23 changed files with 69 additions and 28 deletions.
9 changes: 6 additions & 3 deletions BBBikeDraw.pm
Expand Up @@ -554,8 +554,9 @@ sub set_category_colors {
my $code = "package $pkg;\n" . <<'EOF';
%color = (B => $red,
H => $yellow,
HH => $yellow,
H => $yellow,
NH => $white,
N => $white,
NN => $lightgreen,
S => $darkgreen,
Expand Down Expand Up @@ -619,8 +620,9 @@ sub set_category_outline_colors {
my $code = "package $pkg;\n" . <<'EOF';
%outline_color = (B => $black,
H => $black,
HH => $black,
H => $black,
NH => $darkgrey,
N => $darkgrey,
NN => $darkgrey,
W => $darkblue,
Expand Down Expand Up @@ -666,8 +668,9 @@ sub set_category_widths {
my $code = "package $pkg;\n" . <<'EOF';
%width = (B => 3*$m,
H => 3*$m,
HH => 3*$m,
H => 3*$m,
NH => 2*$m,
N => 2*$m,
NN => 2*$m,
S => 2*$m,
Expand Down
2 changes: 1 addition & 1 deletion BBBikeDraw/SVG.pm
Expand Up @@ -113,7 +113,7 @@ sub cat2svgrgb {
sub set_category_styles {
my($self) = @_;
%style = ();
for my $cat (qw(B HH H N NN
for my $cat (qw(B HH H NH N NN
S SA SB SC S0 SBau
R RA RB RC R0 RBau RG RP
U UA UB U0 UBau
Expand Down
1 change: 1 addition & 0 deletions Strassen/CoreHeavy.pm
Expand Up @@ -754,6 +754,7 @@ sub default_cat_stack_mapping {
'B' => 20,
'HH' => 15,
'H' => 10,
'NH' => 7,
'N' => 5,
'NN' => 1,
'Pl' => 0,
Expand Down
2 changes: 2 additions & 0 deletions Strassen/MapInfo.pm
Expand Up @@ -465,6 +465,7 @@ sub create_mif_mid_from_data_directory {
(B => $rgb->(255,0,0), # red
HH => $rgb->(255,255,0),
H => $rgb->(255,255,0),
NH => $rgb->(120,120,120),
N => $rgb->(120,120,120),
NN => $rgb->(0,200,0),

Expand All @@ -486,6 +487,7 @@ sub create_mif_mid_from_data_directory {
B => 4,
HH => 4,
H => 3,
NH => 3,
N => 3,
NN => 3,

Expand Down
5 changes: 3 additions & 2 deletions babybike/standard.desc
@@ -1,7 +1,8 @@
#XXX from bbbike:
%category_color =
('N' => 'grey98',
'NN' => '#bdffbd',
('NN' => '#bdffbd',
'N' => 'grey98',
'NH' => '#ffffc0',
'H' => 'yellow',
'HH' => 'yellow2',
'BAB' => 'DarkBlue',
Expand Down
9 changes: 5 additions & 4 deletions ext/BBBikeXS/t/base.t
Expand Up @@ -146,10 +146,11 @@ SKIP: {

use vars qw(%str_outline %category_color);
$str_outline{"s"} = 1;
my @restr = ('HH', 'H', 'N', 'NN');
my $category_width = {'HH' => 6, 'H' => 4, 'N' => 2, 'NN' => 1};
%category_color = ('N' => 'grey99',
'NN' => '#bdffbd',
my @restr = ('HH', 'H', 'NH', 'N', 'NN');
my $category_width = {'HH' => 6, 'H' => 4, 'NH' => 3, 'N' => 2, 'NN' => 1};
%category_color = ('NN' => '#bdffbd',
'N' => 'grey99',
'NH' => '#ffffc0',
'H' => 'yellow',
'HH' => 'yellow2',
);
Expand Down
4 changes: 2 additions & 2 deletions ext/BBBikeXS/t/miscdata.t
Expand Up @@ -48,8 +48,8 @@ plan tests => 17;
$mw->geometry("+10+10");
$mw->Button(-text => "Close", -command => sub { $mw->destroy })->pack(-side => "bottom");
my $c = $mw->Scrolled("Canvas")->pack(qw(-fill both -expand 1));
my @restr = ('HH', 'H', 'N', 'NN');
my $category_width = {'HH' => 6, 'H' => 4, 'N' => 2, 'NN' => 1};
my @restr = ('HH', 'H', 'NH', 'N', 'NN');
my $category_width = {'HH' => 6, 'H' => 4, 'NH' => 3, 'N' => 2, 'NN' => 1};

# Incomplete line (no category)
{
Expand Down
4 changes: 2 additions & 2 deletions ext/BBBikeXS/t/utf8.t
Expand Up @@ -46,8 +46,8 @@ plan tests => 7;
$mw->geometry("+10+10");
$mw->Button(-text => "Close", -command => sub { $mw->destroy })->pack(-side => "bottom");
my $c = $mw->Scrolled("Canvas")->pack(qw(-fill both -expand 1));
my @restr = ('HH', 'H', 'N', 'NN');
my $category_width = {'HH' => 6, 'H' => 4, 'N' => 2, 'NN' => 1};
my @restr = ('HH', 'H', 'NH', 'N', 'NN');
my $category_width = {'HH' => 6, 'H' => 4, 'NH' => 3, 'N' => 2, 'NN' => 1};

{
my $datafile = write_data(<<'EOF');
Expand Down
3 changes: 3 additions & 0 deletions html/bbbike.css
Expand Up @@ -106,6 +106,9 @@ a.ms:visited { color:#333333; }
.catH {
background-color:#ffff40;
}
.catNH {
background-color:#ffffc0;
}
.catN {
background-color:#ffffff; /* slightly different */
}
Expand Down
2 changes: 2 additions & 0 deletions java/BBBike.java
Expand Up @@ -118,6 +118,8 @@ else if (ret.Category.equals("HH"))
prop.put(CanvasProp.FILL, new Color(238,238,0));
else if (ret.Category.equals("NN"))
prop.put(CanvasProp.FILL, Color.green);
else if (ret.Category.equals("NH"))
prop.put(CanvasProp.FILL, Color.white);
else
prop.put(CanvasProp.FILL, Color.white);
prop.put(CanvasProp.WIDTH, new Integer(5));
Expand Down
2 changes: 1 addition & 1 deletion mapserver/brb/brb-ipaq.map-tpl
Expand Up @@ -893,7 +893,7 @@ LAYER
SIZE 1
END
CLASS
EXPRESSION 'N'
EXPRESSION /^NH?$/
[%# IF p.legend -%]
NAME "Nebenstra�e"
[%# END -%]
Expand Down
2 changes: 1 addition & 1 deletion mapserver/brb/brb.map-tpl
Expand Up @@ -1220,7 +1220,7 @@ LAYER
[% xxx_is_first = 0 -%]
[% END -%]
CLASS
EXPRESSION 'N'
EXPRESSION /^NH?$/
[% IF p.legend -%]
NAME "Nebenstra�e"
[% END -%]
Expand Down
4 changes: 4 additions & 0 deletions mapserver/brb/help.html-tpl
Expand Up @@ -104,6 +104,10 @@ Der Ma
<td><a name="H">H</a></td>
<td>Hauptstraße</td>
</tr>
<tr>
<td><a name="NH">NH</a></td>
<td>wichtige Nebenstraße</td>
</tr>
<tr>
<td><a name="N">N</a></td>
<td>Nebenstraße</td>
Expand Down
4 changes: 2 additions & 2 deletions mapserver/brb/sternfahrt2003/sternfahrt2003.map-tpl
Expand Up @@ -606,7 +606,7 @@ LAYER
SIZE 6
END
CLASS
EXPRESSION 'N'
EXPRESSION /^NH?$/
COLOR 210 210 210
SYMBOL 'width'
SIZE 6
Expand Down Expand Up @@ -778,7 +778,7 @@ LAYER
SIZE 4
END
CLASS
EXPRESSION 'N'
EXPRESSION /^NH?$/
NAME "Nebenstra�e"
LABEL
# MINFEATURESIZE 200
Expand Down
1 change: 1 addition & 0 deletions miscsrc/SRTShortcuts.pm
Expand Up @@ -1653,6 +1653,7 @@ sub real_street_widths {
my %cat_to_width = ('B' => 6 * LANE_WIDTH + PEDESTRIAN_PATHS_WIDTH + MEDIAL_STRIP_WIDTH,
'HH' => 6 * LANE_WIDTH + PEDESTRIAN_PATHS_WIDTH + MEDIAL_STRIP_WIDTH,
'H' => 6 * LANE_WIDTH + PEDESTRIAN_PATHS_WIDTH,
'NH' => 4 * LANE_WIDTH + PEDESTRIAN_PATHS_WIDTH,
'N' => 4 * LANE_WIDTH + PEDESTRIAN_PATHS_WIDTH,
'NN' => 2 * LANE_WIDTH,
);
Expand Down
3 changes: 2 additions & 1 deletion miscsrc/bbbikedraw.pl
Expand Up @@ -112,8 +112,9 @@
my @extra_args;
if ($ipaq) {
push @extra_args, CategoryWidths => {B => 2,
H => 2,
HH => 2,
H => 2,
NH => 1,
N => 1,
NN => 1,
};
Expand Down
1 change: 1 addition & 0 deletions miscsrc/bbd2osm
Expand Up @@ -75,6 +75,7 @@ my %speed0;
my %cat_to_highway = ('B' => 'primary',
'HH' => 'primary',
'H' => 'secondary',
'NH' => 'tertiary',
'N' => 'residential',
'NN' => 'cycleway', # XXX
);
Expand Down
3 changes: 2 additions & 1 deletion miscsrc/bbd2polish
Expand Up @@ -144,7 +144,7 @@ Elevation=m
Levels=@{[ $levels + 1 ]}
; with Pl, POI etc.
Level0=24
; with NN/N
; with NN/N/NH
Level1=22
; with H
Level2=20
Expand Down Expand Up @@ -451,6 +451,7 @@ sub cat2type {
# normal street categories
return 2 if $cat =~ m{^B$anyquality$} || $cat =~ m{^HH$anyquality$}; # Principal HWY-thick
return 3 if $cat =~ m{^H$anyquality$}; # Principal HWY - medium
return 4 if $cat =~ m{^NH$anyquality$}; # Arterial Road - medium
return 4 if $cat =~ m{^N$anyquality$}; # Arterial Road - medium
return 6 if $cat =~ m{^NN$anyquality$}; # Road - thin

Expand Down
13 changes: 8 additions & 5 deletions miscsrc/tkzincbbbike
Expand Up @@ -67,8 +67,9 @@ my $z = $mw->Scrolled("Zinc",
}

my %category_color =
('N' => 'grey98',
'NN' => '#bdffbd',
('NN' => '#bdffbd',
'N' => 'grey98',
'NH' => '#ffffc0', # noch blasseres gelb
'H' => '#ffffa0', # blassgelb
'HH' => '#fff800', # kräftiges gelb
'BAB' => 'DarkBlue',
Expand All @@ -94,6 +95,7 @@ my %category_color =
my %category_priority =
(NN => 10,
N => 11,
NH => 11,
H => 12,
HH => 13,
B => 14,
Expand All @@ -106,12 +108,13 @@ my %category_priority =
);

my %line_width =
('s-H' => [1, 2, 3, 4, 6, 10],
('s-NN' => [1, 1, 2, 2, 4, 7],
's-N' => [1, 1, 2, 2, 4, 7],
's-NH' => [1, 1, 2, 3, 5, 8],
's-H' => [1, 2, 3, 4, 6, 10],
's-HH' => [1, 2, 3, 4, 6, 10],
's-B' => [1, 2, 3, 4, 6, 10],
's-BAB' => [1, 2, 3, 4, 6, 10],
's-N' => [1, 1, 2, 2, 4, 7],
's-NN' => [1, 1, 2, 2, 4, 7],
);

my $last_c;
Expand Down
1 change: 1 addition & 0 deletions miscsrc/winter_optimization.pl
Expand Up @@ -142,6 +142,7 @@

my $cat_num = {NN => 1,
N => 3,
NH => 4,
H => 5,
HH => 6,
B => 6,
Expand Down
10 changes: 10 additions & 0 deletions t/strassen-kreuzungen.t
Expand Up @@ -175,11 +175,21 @@ for my $kr ($kr1, $kr2) {
{
my %situation = situation_at_point_inorder($kr, qw(12891,12008 13066,11854 13217,11936));
is($situation{action}, 'left', "Ruedersdorfer/Wedekindstr");
local $TODO = "situation_at_point_inorder needs Vorfahrt detection based on street categories";
if ($kr == $kr2) {
is($situation{traffic_rule}, 'bent_right_of_way', "Ruedersdorfer/Wedekindstr.: bent right of way");
}
}

# Bergmannstr./Südstern
{
my %situation = situation_at_point_inorder($kr, qw(10123,9233 10547,9233 10564,9292));
is($situation{action}, 'left', "Bergmannstr/Suedstern");
if ($kr == $kr2) {
is($situation{traffic_rule}, 'bent_right_of_way', "Bergmannstr/Suedstern: bent right of way");
}
}

# Bergmannstr., Kopfsteinpflaster
if ($kr == $kr2) {
{
Expand Down
11 changes: 8 additions & 3 deletions vbbbike/vbbbikecnv.cpp
Expand Up @@ -16,13 +16,17 @@ inline int vbbbikeCanvasPane::getCategory(char* catStr) {
case 'H':
switch (catStr[1]) {
case 0: cat = Hitem; break;
case 'H': cat = HHitem; break;
case 'H': cat = HHitem; break; // HH
default: cat = Xitem;
}
break;
case 'N':
if (catStr[1] == 0) cat = Nitem;
else cat = NNitem;
switch (catStr[1]) {
case 0: cat = Nitem; break;
case 'H': cat = NHitem; break; // NH
case 'N': cat = NNitem; break; // NN
defailt: cat = Xitem;
}
break;
case 'B':
cat = BABitem;
Expand Down Expand Up @@ -318,6 +322,7 @@ printf("%d %d %d %d\n", x, xx, y, yy);
case BABitem: SetPen(bluePen); break;
case HHitem: SetPen(darkYellowPen); break;
case Hitem: SetPen(yellowPen); break;
case NHitem: SetPen(whitePen); break;
case Nitem: SetPen(whitePen); break;
case NNitem: SetPen(greenPen); break;
case SAitem:
Expand Down
1 change: 1 addition & 0 deletions vbbbike/vbbbikecnv.h
Expand Up @@ -134,6 +134,7 @@ class vbbbikeCanvasPane : public vCanvasPane

NNitem,
Nitem,
NHitem,
Hitem,
HHitem,
BABitem,
Expand Down

0 comments on commit 83d681c

Please sign in to comment.