Next: links | Previous: bbbike_internals | [Index] |
bbd - bbbike data format description
Sorry - parts of this documentation are still in German...
bbd
is a simple format for describing points and polylines for
geographic information systems.
Bbd files consist of newline-terminated records in the format:
Name TAB Category SPACE x,y SPACE x,y ...
If there is a main name and a descriptive part, then the latter should
be separated by a |
character. This helps for intelligent
labelling, i.e. leaving out unimportant parts if necessary. Example:
Ringenwalde|(Uckermark) could be labelled as Ringenwalde or
Ringenwalde (Uckermark).
#rrggbb
(where rr
, gg
and bb
are hexadecimal values), then
this denotes a color for the representation in the Perl/Tk interface.
A prefix of F:
denotes that the polyline should be treated as a
polygon and filled with a solid color. Note that the polygon is always
closed, but it is optional to make the first and last the same.
If the category matches forwardcat;
backwardcat, then
forwardcat applies to the street in forward direction and
backwardcat applies to the street in backward direction. Either
forwardcat or backwardcat may be empty; in this case the
category applies only to the other direction.
The X category should be used if there is no category.
Other predefined categories are listed below. The category should not contain any spaces.
DRAFT (not yet in use!): Change the category format to: <cat> = <onewaycat> ; <onewaycat> | <onewaycat> <onewaycat> = F=? <basiccat> (: <attrkey> (= <attrval>)?)* <basiccat> = [^:;]+ <attrkey> = [^:;=]+ <attrval> = [^:;=]+ Changes for data files: F:cat becomes F=cat ?::inwork becomes ?:inwork F:SW|IMG:church.gif|ANCHOR:s becomes F=SW:IMG=church.gif:ANCHOR=s Maybe (no, too much typing): #rrggbb becomes X:COLOR=#rrggbb cat is now really attr. Reflect in description, maybe also in variable names.
check-line-lengths
of
data/Makefile
). See also below for the map directive in
Directive lines.
If a line begines with a hash sign followed by a color (#:
), then
the line is treated as a directive. There are global directives, line
directives and block directives. Global directives should be specified
at top of the file before the first data line and should be separated
by the data lines with an empty directive line. Line directives are
valid for the next line only. Block directives are valid for the
specified block. Block directives are markes as such:
#: directive_name directive_arguments ... vvv ... data lines #: directive_name ^^^
XXX make directive_name before ^^^ optional? XXX
The v
and ^
markers could be repeated an indefinite number of
times, but at least three times.
An colon (:) after the directive_name is always optional.
type: bbd_type
bbr
or bbbike
route
, once I get rid of the .bbr format.
map: maptype
map
directive is specified, then the proprietary bbbike
coordinate system is used. For WGS84 coordinates specified as DDD use
the maptype polar.
title: title string
version: RCS or CVS identifier string
encoding: encoding name
The degree of support for encodings in bbbike.cgi and the Perl/Tk implementation differs. iso-8859-1 is supported best. utf-8 is considered to work in most, if not all places of the code. Other encodings are at least known to NOT work with the XS implementation for the fast street and point plotting. The pure perl implementation is fine.
listing_sort: sort_method
Plotting hint directives are used to control plotting of items. The directives can only be set as global directives. The directives explained below exist in two forms:
directive: ...
directive.category: ...
The list of plotting hint directives:
line_color: color
line_color.category: color
#rrggbb
.
Example:
#: line_color: #808080 #: line_color.cat: #ff8080
XXX: The category-less form is NYI!. XXX: currently category_color.category is used instead of line_color.category
XXX: Maybe use item_color
instead of line_color
, because colors
apply also to points and areas!
XXX: Hmmm, it seems that str_color is (also?) in use, see tmp/streets-accurate.bbd
line_width: width
line_width.category: width
XXX: The form with category is NYI!
line_length: length
line_length.category: length
XXX: The form with category is NYI!
XXX: Maybe this should make it possible to define lengths for specific zoom levels, like in the bbbike standard definitions.
line_dash: x, y, ...
line_dash.category: x, y, ...
Example:
#: line_dash: 1,1 #: line_dash: 2,4
Compatibility: category_dash.category
was formerly used instead
of line_dash.category
and is still recognized, but will be
removed some day.
line_capstyle: capstyle
line_capstyle.category: capstyle
butt
,
projecting
, or round
(see Tk::Canvas).
XXX: Currently category_capstyle.category
is used instead of
line_capstyle.category
.
line_arrow: arrowspec
line_arrow.category: arrowspec
none
, last
, first
, or both
(see Tk::Canvas).
Example:
#: line_arrow: last #: line_arrow.cat: both
line_shorten: boolean
line_shorten.category: boolean
XXX: Currently category_line_shorten.category
is used instead of
line_shorten.category
.
line_shorten_end: boolean
line_shorten_end.category: boolean
XXX: Currently category_line_shorten_end.category
is used instead
of line_shorten_end.category
.
item_size: integer
item_size.category: integer
XXX: The category-less form is NYI!
XXX: Currently category_size.category
is used instead
item_size.category
.
item_image: image_name
item_image.category: image_name
XXX: The category-less form is NYI!
XXX: Currently category_image.category
is used instead
item_image.category
.
item_stipple: image_name
item_stipple.category: image_name
XXX: The category-less form is NYI!
XXX: Currently category_stipple.category
is used instead item_stipple.category
.
layer_stack: how:tag
above
or below
and tag is another layering tag used
in bbbike (some examples are s
for the street layer or w
for the
water layer --- consult the bbbike source, variable
@normal_stack_order
for more tags).
XXX This is experimental and likely to change!
by: source
according_to: source
according_to:
is an alias for
by:
.
corrected_by: source previous -> current
by
directive for a correction. It is advisable to put
the previous a small note of the previous and current entry after the
source.
confirmed_by: source
unverified_by: source
temporary:
XXX: why
Earlier versions also defined unsure
as an alias for XXX
(or
even the other way around), but in reality unsure
was almost never
used and also never considered in supporting scripts, so its use is
now deprecated.
XXX_checklater: why
XXX
, and additionally attach the "checklater"
attribute.
NOTE: Currently it's not recommended to use this tag. It is better to
use just XXX
in conjunction with next_check
or last_checked
,
because the current infrastructure (supporting scripts etc.) have
better support for this.
XXX_prog: why
For example this can be used if stacking information has to be given using ordering in the data file, but bbbike should really have a layer_stack attribute.
In the past it was also used for the cyclepath layer, because of suboptimal rendering in points with large angles (more than 45° or so). Here the layer item has to be broken into two items to fix the rendering problem. But this is solved in bbbike since July 2009.
XXX_indoor: why
XXX_outdoor: why
XXX
.
XXX_osm: why
alias: name
alias_wide: name
Examples:
#: alias_wide: Oranienburg - Bernau (B273) Bernauer Str. (B273) B ...,...
name: lang: name
oldname: when: name
Examples:
#: oldname: ?-20001001: Oldname street #: oldname: 20001001-2005: Not-so-old-name street
section: section name
append_comment: comment
attributes: attribute, ...
attrs: attribute, ...
attrs
is an alias for attributes
.
note: string
see_also: string
last_checked: date
last_checked: date (by: name)
XXX
or add_fragezeichen
directives, to generate automatic list of streets to be surveyed
again.
next_check: date
For generating survey lists, it could also be useful to generate
synthetic next_check
directives out of last_checked
value, e.g.
one month after the last check. The default interval could be set by
the check_frequency
directive.
check_frequency
: daysd
next_check
directives. If not set, then the default could be one month or so.
as_of: date
The difference between last_checked
and as_of
is subtle; it is
expected that last_checked
-tagged entries should be actively
checked for changes, and as_of
-tagged entries only passively.
url: string
add_fragezeichen: string
fragezeichen
file.
internal_note: string
Currently I think the XXX_...
is better suited for this task, as it
can give more specific information.
If a line begins with a hash sign (#
), then it is treated as a
comment. Empty lines are ignored.
Here's a list of special categories:
Used in files: strassen
, landstrassen
, landstrassen2
.
Usually strassen
is used for city streets, landstrassen
for
streets in the region around the city, and landstrassen2
for
streets in the wider region. But it is also possible to work only with
one file strassen
.
Used in files: gesperrt
, gesperrt_car
. gesperrt
is usually
used for blocked streets relevant for cyclists, while gesperrt_car
is for blocked streets for motorized vehicles.
1
:
One way street. The blocking is in the direction of the polyline.
1s
:
One way street (read "one soft"), but not strictly for
cyclists (means: It is non-legally possible to pass the street in the
wrong direction. Typically this will cause the routing to add a
handicap of class q4
for the wrong direction.).
1h
:
One way street 8read "one hard"), and there's no possibility for a cyclist to use the street in wrong direction.
2
:
Blocked street in both directions.
:
The bicycle has to be carried. An optional penalty parameter expressed
in seconds of lost time may be added after the category, with a :
as separator. Example: 0:30
for a penalty of 30 seconds. This is
only for point records.
3
:
A blocked route (gesperrte Wegführung). This means that the whole path specified by the coordinates of this record are blocked, but parts of the path are not.
3nocross
:
Mark a street or street section which cannot be crossed. This category
is currently only used by the miscsrc/convert2hafas
conversion
script (the preprocessor of the *-orig
files to the real bbd
files). The conversion script generates a couple of blocked routes
with the category 3
.
BNP
:
A narrow passage ("Drängelgitter" etc.). An optional
penalty parameter may be added, like for the category.
Used in files: radwege_exact
.
RW0
RW1
RW2
RW3
RW4
RW5
RW6
RW7
RW8
RW9
RW10
RW
Used in files: ubahn
, sbahn
, rbahn
, ubahnhof
, sbahnhof
,
rbahnhof
.
R
RA
RB
RC
R0
RBau
RG
RP
S
SA
SB
SC
S0
SBau
U
UA
UB
UC
U0
UBau
Qualität der Wege (Fahrbahnbeschaffenheit).
Used in files: quality_s
, quality_l
. quality_s
is usually
used for city streets, while quality_l
is for streets in the region
around the city.
Q0
Q1
Q2
Q3
Es ist möglich, eine Tendenz mit einem angehängten -
(besser) oder
+
(schlechter) anzugeben, also beispielsweise Q2+
für eine
mäßige Qualität mit Tendenz zur guten Qualität. Diese Tendenzen werden
bislang nur bei der Erfassung verwendet, aber (noch) nicht beim
Routing oder der Kartendarstellung.
Andere, nicht fahrbahnbezogene Handicaps, zum Beispiel Beeinträchtigungen
durch Fußgänger oder enge Kurven. Used in files: handicap_s
(used
for city streets), handicap_l
(used for streets in the region
around the city).
q0
q1
q2
q3
q4
Vf
Kz
Used in files: comments_cyclepath
(alternative way to attribute
cyclepaths), comments_ferry
(e.g. time-tables or fares of ferries),
comments_kfzverkehr
(categorized amount of motorized traffic -
Abschätzung des Kfz-Verkehrs), comments_misc
(other comments),
comments_mount
(mounts with grades - Steigungen), comments_path
(path instructions), comments_route
(numbered cycle routes -
ausgeschilderte Fahrradrouten), comments_tram
(tramway on street).
CP;
CP2;
CP
CP;
, but valid for both directions.
CP2
CP2;
, but valid for both directions.
CS;
CS
PI;
CP2;
allowing more than two points)
P0
3
in BLOCKINGS.
NB: Diese Kategorie wird bislang noch nicht verwendet und bedarf deswegen einer Überprüfung.
-2
relativ ruhiger Kfz-Verkehr
-1
+1
+2
relativ starker Kfz-Verkehr
NN
bis zur
Bundesstraße B
) kann das subjektive Empfinden der Kfz-Dichte mit
-2
bis +2
angepasst werden.
Used in files: flaechen
. Mostly prefixed with F:
, see above.
P
Forest
Cemetery
Ae
Orchard
Sport
Industrial
Mine
The category interval span from to
6
where denotes city
parts,
1
villages and 6
metropolises.
radroute
Q
X
Name
fields denotes the elevation
in meters, the category is not used.
SW
Shop
The category has usually an image attribute. The following standard images are available in bbbike:
museum
theater
church
synagogue
mosque
airport
hospital
monument
touristinfo
px_1t
may be used for invisible areas.
In area records, it is advisable to use the main entrance as the first point.
XXX To be continued
fragezeichen
, gesperrt
, handicap
, strassen_bab
).
sbahn
,
rbahn
and strassen_bab
.
strassen_bab
.
#: map: polar # a comment Dudenstr. H 13.3857982559056,52.4850047136888 13.3822671967909,52.4849893166144 13.3765591649622,52.4849797043717 13.3721313913775,52.4849830887141 13.3708964575072,52.4850055627098 Viktoriapark F:P 13.3770529147335,52.4891642850551 13.376956820767,52.4876188211697 13.3778829456197,52.4875997186591 Start of a directive v #: map: polar ^ Coordinate system of this file is defined as WGS84, DDD Start of a comment v # a commentAnd a detailed explanation...
(Note that spaces are insignificant in the following examples, but
<TAB>
and <SPACE>
should be inserted)
List of coordinates (x,y pairs) v Dudenstr. <TAB> H <SPACE> 13.3857982559056,52.4850047136888 13.3822671967909,52.4849893166144 13.3765591649622,52.4849797043717 13.3721313913775,52.4849830887141 13.3708964575072,52.4850055627098 ^ ^ Street name Category (H = main street) List of coordinates for a polygon v Viktoriapark <TAB> F:P <SPACE> 13.3770529147335,52.4891642850551 13.376956820767,52.4876188211697 13.3778829456197,52.4875997186591 ^ ^ Name of a park Category (F = area (polygon, Fläche), P = park) Category (S = S-Bahn, A = Tariff area A) v S1,S2,S25 <TAB> SA::Tu_ <SPACE> coordinates ... ^ Attribute (Tunnel, only draw tunnel entrance at beginning)
Some category values may change. It is likely that either the blocking and/or city category values will change, as both use digits.
Slaven Rezic <slaven@rezic.de>