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.
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. For example:
#: encoding: utf-8 #: map: polar #: ... data lines
Line directives are valid for the next line only:
#: add_fragezeichen: Is this really correct? Main street: bad cobblestone Q3 13.5,52.5 13.4,52.5
Block directives are valid for the specified block. Block directives are markes as such:
#: directive_name directive_arguments ... vvv ... data lines #: directive_name ^^^
The v
and ^
markers can be repeated an indefinite number of
times, but at least three times.
Directives have always at least the directive name (the first word token in the line) and zero, one or more directive values:
#: directive_name #: directive_name: val1 #: directive_name: val1 val2
The colon (:) after the directive name is optional. The following is equivalent:
#: encoding utf-8 #: encoding: utf-8
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
It is possible to localize the title by using the title.$lang
syntax, e.g.
title.en: English title title.de: deutscher Titel
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
Compatibility: category_color.category
is still recognized as an
alternative to line_color.category
. Maybe this will removed some
day.
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
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
Currently setting the line_arrow
directive (without category) to
last
has also the effect to center to the beginning of a feature
selected in the street list of the Perl/Tk application (otherwise the
default is the center of the feature).
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
.
line_directed_weight: boolean
line_directed_weight.category: boolean
line_do_offset: boolean
line_do_offset.category: boolean
A;B
) are plotted with an offset, but this
can be disabled by explicitely setting line_do_offset to a false
value.
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:
.
by[nocache]
: URL>
by[removed]
: URL>
corrected_by: source previous -> current
by
directive for a correction. It is advisable to put
the previous a small note of the previous and maybe also the current
entry after the source.
confirmed_by: source
source_id: id
by
directive where a formal id can be used.
Currently there are three id schemes in use: viz2021
(a pseudo id
for VIZ traffic reports), bvg2021
and bvg2024
(BVG traffic
reports: prefixed by the affected line, then a #
, then the id), and
scheme-less (a real VIZ id). Sometimes also other forms of pseudo ids
or even URLs are used here.
source_id[inactive]: id
valid: YYYYMMDD-YYYYMMDD
valid: YYYYMMDD-
valid: -YYYYMMDD
If the value is preceded by a !
, then the validation period is
inverted.
Note: in future Strassen::Core may deal automatically (or optional) with removal of non-valid records.
NOTE: Makefile rules don't cope well with the ability that source files are processed differently depending on time.
temporary:
next_check
directives to specify the
end date, so systems like "fragezeichen-nextcheck" can include these
entries in their lists.
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_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_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
ignore_oldname_file: yes
oldnames
data file.
This is useful if for example only a part of the street was renamed.
ignore_check_net: yes
section: section name
ignore
comments_misc-orig
are skipped when
creating comments_misc
.
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.
next_check_id: identifier
The bbbike emacs major mode generates buttons for these directives; clicking on these buttons would start a search for this identifier over all data files.
also_indoor: spec
search
term
traffic
url
url
webcam
url
Currently the script miscsrc/fragezeichen2org.pl
may handle
also_indoor
directives.
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.
Currently as_of
directives appear in data/comments_ferry-orig
for ferry timetable and fare information.
url: string
by:
directive.
add_fragezeichen: string
fragezeichen
file.
osm_watch: relation|way|node id="element_id" version="version"
osm_watch: note note_id comment_num
osm_watch[closed]: note note_id comment_num
relation
, way
, node
) or note. version or comment_num
specify the latest checked version. The [closed]
variant is used
for notes which are already closed.
osm_watch
directives cause links when editing .bbd
files using
emacs with bbbike-mode
. miscsrc/fragezeichen2org.pl
also
generates links. miscsrc/check-osm-watch-list.pl
may be used to
find changed OSM elements and notes (the watch list for this script is
created by miscsrc/bbd_to_osm_watch_list
).
complete: yes|no
priority: string
#A
(highest, use for features which are important for many
routings) and #D
(lowest, use for features which are not used at
all for routings, e.g. zebras).
linked: string
ortsschilder-orig
, where the linked name is to be used to do checks
against orte-orig
/orte2-orig
.
source_file: filename
source_file
directive would switch to a different source
file.
source_line: number
id: string
osm.highway: string
off: when comment
ampeln-orig
, needs to be decided on the exact
format and even on the directive name. Example entry:
#: off: night (seen 2001-12-25)
The comment part may be completely missing.
Currently the following labels are used in the when part: night
,
weekend
, holiday
, week day names, except_schooltime
,
except_event
, HH:MM-HH:MM.
internal_note: string
Currently I think the XXX_...
is better suited for this task, as it
can give more specific information.
historical_note: string
unverified_by: source
XXX_checklater: why
XXX
, and additionally attach the "checklater"
attribute.
This tag is not supported anymore. Instead, use just XXX
in
conjunction with next_check
or last_checked
. The current
infrastructure (supporting scripts etc.) have better support for this.
XXX_outdoor: why
XXX
, and scripts don't
support this type anymore.
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 (read "one hard"), and there's no possibility for a cyclist to use the street in wrong direction.
1no
:
Not a one way street. Use only if a former one way street got
temporarily opened in both directions, and a directive like XXX
or
next_check
needs to be attached. May be rendered with a double-head
arrow, and has no routing consequences.
2
:
Blocked street in both directions.
2s
:
Blocked street (read "two soft"), but not strictly for
cyclists (means: It is usually possible for bicyclists to pass the
street, maybe by pushing the bike. Typically an handicap addition like
2s:q4
or 2s:q3
should be specified).
:
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
Folgende Kategorien können in der "-orig"-Variante ein "?"
nachgestellt haben, um anzuzeigen, dass Informationen fehlen: RW3
,
RW4
(Benutzungspflicht unbekannt) und RW5
(Gültigkeitsdauer der
Busspur fehlt).
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
Vf::Tram
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
F:Cemetery|religion=muslim
or F:Cemetery|religion=jewish
.
Ae
Orchard
Sport
Industrial
Mine
The category interval span from to
6
where denotes city
parts,
1
villages and 6
metropolises.
radroute
Q
X
Inactive traffic lights are currently only available in the
ampeln-orig
file and not processed into the final ampeln
file.
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
, ubahn
, strassen_bab
, and wasser*
.
Note that not every BBBike renderer may render a tunnel specially. The Perl/Tk application has complete render support for all tunnel categories (see also the below ones). The PDFCairo renderer has simple support for tunnels (drawn as dashed lines). The PDF and GD renderers draw tunnels like normal lines, except for tunneled waterways, which are currently completely ignored. All other renderers (e.g. Mapserver) draw all tunnels like normal lines.
strassen_bab
.
Lines which are to be removed, but still should be kept as a kind of "historical documentation", may be turned into a comment with "REMOVED" as the first word. Multiple lines may be joined into one line, separated by a "---". For example:
# REMOVED --- #: confirmed_by: me --- old entry X 1234,5678 9876,5432
#: 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
And a detailed explanation...
Start of a directive v #: map: polar ^ Coordinate system of this file is defined as WGS84, DDD Start of a comment v # a comment
(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>
bbbike, Strassen, fragezeichen2org.pl, miscsrc/bbbike.el
.