Next: links | Previous: bbbike_internals |  | [Index]

# bbd

- NAME
- DESCRIPTION
  - Coordinate lines (data lines)
  - Directive lines
    - Global directives
    - Line/block directives
  - Comment lines
- CATEGORIES
  - STREETS
  - BLOCKINGS
  - CYCLE PATHS (RADWEGE)
  - RAILROADS
  - QUALITY
  - COMMENTS
  - AREAS
  - CITIES AND PLACES
  - MISC
  - OTHER STANDARD FILES
- ATTRIBUTES
- EXAMPLES
- CAVEATS
- AUTHOR
- SEE ALSO

## NAME

bbd - bbbike data format description

## 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 ...

### Coordinate lines (data lines)

Name
  A descriptive name, for example the street name, or (for attribute layers) a description of the attribute category. This field must not contain any TAB characters.

  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).

Category
  The category of this point or polyline. If the category matches `#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.

x,y
  A coordinate. x and y should be integer or float values. The datum and grid of the coordinates should be handled by the software. It is recommended that x and y should denote the easting and northing in meters (as in GKK or UTM). A record may contain an unlimited number of coordinates, though there may be limitations in the interpreting software (currently the maximum number of points is hardcoded in BBBikeXS and checked in the rule `check-line-lengths` of `data/Makefile`). See also below for the map directive in Directive lines.

### 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.

#### Global directives

`type: bbd_type`
  This global directive sets the type of the bbd file. If given then it should be put into the first line to serve as a kind of "magic". A possible type would be `bbr` or `bbbike route`, once I get rid of the .bbr format.
`map: maptype`
  This global directive sets the coordinate system of the bbd file. If no `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`
  This global directive sets the title or some descriptive text for the file.
`version: RCS or CVS identifier string`
  This global directive introduces an RCS/CVS Id string.
`encoding: encoding name`
  Treat this file as encoded in the given encoding (all names accepted by Perl/Encode may be used). If not set, then iso-8859-1 is assumed.
`listing_sort`: sort_method>
  Define a sorting method for street/point listings. Normally listings will be sorted alphabetically (sort method alphabetic). If the listing should appear as in the bbd file, specify unsorted. natural should be used for "natural" sorting (see Sort::Naturally).

#### Line/block directives

`by: source`
`according_to: source`
  Denotes that the information in the next block or line was provided by source. This may be an email address or full name of an author, an URL providing more information, a Message-Id of a mail or posting, a date, or a combination of all. `according_to:` is an alias for `by:`.
`corrected_by: source previous -> current`
  Used after a `by` directive for a correction. It is advisable to put the previous a small note of the previous and current entry after the source.
`unverified_by: source`
  Same as "by:" for unverified data. "Unverified" means that there's no communication channel back to the information provider.
`temporary:`
  The next block or line is just temporary. Typically the date information is included in the Name field of the data line, preferred in a ISO-date similar notation (e.g. YYYY-MM-DD - YYYY-MM-DD for a starting and an end date).
`unsure: why`
`XXX: why`
  The next block or line is unsure or unclear information. The why text specifies an additional comment. This note should not appear in the processed data. `XXX` is an alias for `unsure:`.
`alias: name`
  Define another known name for the next line.
`alias_wide: name`
  Special alias name to be used for "wide region" routings. In "inner city" routing the real name should be used instead.

  Examples:

          #: alias_wide: Oranienburg - Bernau (B273)
          Bernauer Str. (B273)	B ...,...

`name: lang: name`
  The name in another language, specified by lang in ISO 639 codes.
`oldname: when: name`
  An old name for the next line. when is a time specification (best: some kind of ISO dates, but this is not yet specified). Unknown dates in when should be marked with a question mark. Multiple oldname directives are allowed for one record.

  Examples:

          #: oldname: ?-20001001: Oldname street
          #: oldname: 20001001-2005: Not-so-old-name street

`section: section name`
  The next block is part of a named section. Sections may be nested.
`append_comment: comment`
  Useful for preprocessing bbd data files to add a comment to each record in the block.
`attributes: attribute, ...`
`attrs: attribute, ...`
  Define additional attributes for the following line or block. The attributes may be used in a preprocessing script to generate additional layers. `attrs` is an alias for `attributes`.
`note: string`
  A free text note, which shouldn't (but may) appear in the processed data.
`internal_note: string`
  A free text note, which must not appear in the processed data. It is just a note for editors.
`see_also: string`
  A free text note, which refers to more information. This should be typically a URL.
`add_fragezeichen: string`
  Some postprocessing code may add the following line with the descriptive text string to the `fragezeichen` file.

### Comment lines

If a line begins with a hash sign (`#`), then it is treated as a comment. Empty lines are ignored.

## CATEGORIES

Here's a list of special categories:

### STREETS

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`.

BAB
  Freeways (Bundesautobahn)
B
  Bundesstraßen
HH
  Important main streets (wichtige Hauptstraßen). Entspricht von der Kfz-Dichte meist Bundesstraßen.
H
  Main streets (Hauptstraßen)
N
  Nebenstraßen
NN
  Für Kfz gesperrte Straßen.
Pl
  Places (Plätze).
Br
  Bridges.

### BLOCKINGS

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, but not strictly for cyclists (means: it is non-legally possible to pass the street in the 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.

### CYCLE PATHS (RADWEGE)

Used in files: `radwege_exact`.

`RW0`
  Kein Radweg.
`RW1`
  Normaler nicht benutzungspflichtiger Radweg.
`RW2`
  Benutzungspflichtiger Radweg.
`RW3`
  Suggestivstreifen für Radfahrer.
`RW4`
  Radstreifen.
`RW5`
  Busspur (eventuell nur temporär), auch für Radfahrer frei.
`RW6`
  Verkehrsberuhigte Straße.
`RW7`
  Fahrradstraße.
`RW8`
  Benutzungspflichtiger Zweirichtungsradweg, Gegenrichtung.
`RW9`
  Nicht benutzungspflichtiger Zweirichtungsradweg, Gegenrichtung.
`RW10`
  Hauptstraße mit zusätzlichem Nebenstreifen, aber auch von Kfz nutzbar (Beispiele in Berlin: Heerstr., Unter den Eichen am Botanischen Garten).
`RW`
  Radweg vorhanden, aber nicht weiter kategorisiert.

### RAILROADS

Used in files: `ubahn`, `sbahn`, `rbahn`, `ubahnhof`, `sbahnhof`, `rbahnhof`.

`R`
  Regionalbahnen außerhalb des Stadtgebiets.
`RA`
  Regionalbahnen Zone A.
`RB`
  Regionalbahnen Zone B.
`RC`
  Regionalbahnen Zone C.
`R0`
  Regionalbahnen außer Betrieb oder ohne regelmäßigen Betrieb.
`RBau`
  Regionalbahnen in Bau.
`RG`
  Güterbahnen, Verbindungskurven.
`RP`
  Parkbahnen, Kleinbahnen.
`S`
  S-Bahnen außerhalb des Stadtgebiets.
`SA`
  S-Bahnen Zone A.
`SB`
  S-Bahnen Zone B.
`SC`
  S-Bahnen Zone C.
`S0`
  S-Bahnen außer Betrieb.
`SBau`
  S-Bahnlinien in Bau.
`U`
  U-Bahnen außerhalb des Stadtgebiets.
`UA`
  U-Bahnen Zone A.
`UB`
  U-Bahnen Zone B.
`UC`
  U-Bahnen Zone C.
`U0`
  U-Bahnen außer Betrieb.
`UBau`
  U-Bahnlinien in Bau.

### QUALITY

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`
  Beste Qualität, keine Einschränkungen.
`Q1`
  Gute Kopfsteinpflasterstrecken, mäßiger Asphalt, etwa 25 km/h Höchstgeschwindigkeit.
`Q2`
  Gewöhnliche Kopfsteinpflasterstrecken, schlechter Asphalt, Waldwege, etwa 18 km/h Höchstgeschwindigkeit.
`Q3`
  Schlechte Kopfsteinpflasterstrecken, sandige Strecken, etwa 13 km/h Höchstgeschwindigkeit.

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`
  Keine.
`q1`
  Auf 25 km/h.
`q2`
  Auf 18 km/h.
`q3`
  Auf 13 km/h.
`q4`
  Auf Schrittgeschwidigkeit (z.B. in Fußgängerzonen).

### COMMENTS

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;`
  Only for records with three points. Comment is valid for point B if driving from A to C.
`CP`
  Same as `CP;`, but valid for both directions.
`CS;`
  Comment is valid for the whole route in this direction.
`CS`
  Comment is valid for the whole route in both directions.
`PI`
  Path instruction (genauere Wegbeschreibung).
`P0`
  Dieser Weg ist gesperrt (z.B. Abbiegen nicht möglich), aber eine Umfahrung ist möglich ... siehe auch Kategorie `3` in BLOCKINGS.
`-2` relativ ruhiger Kfz-Verkehr
`-1`
`+1`
`+2` relativ starker Kfz-Verkehr
  Relativ zu der Kategorie einer Straße (von Nebenstraße `NN` bis zur Bundesstraße `B`) kann das subjektive Empfinden der Kfz-Dichte mit `-2` bis `+2` angepasst werden.

### AREAS

Used in files: `flaechen`. Mostly prefixed with `F:`, see above.

`P`
  Parks.
`Forest`
  Forests.
`Cemetery`
  Cemeteries.
`Ae`
  Airports.
`Orchard`
  Orchards; especially allotments (Kleingärten).
`Sport`
  Sports fields.
`Industrial`
  Industrial area.
`Mine`
  Mining, surface mining (Tagebau).

### CITIES AND PLACES

The category interval span from `` to `6` where `` denotes city parts, `1` villages and `6` metropolises.

### MISC

`radroute`
  Haupt- oder Freizeitrouten.
`Q`
  Fähren.
`X`
  The category will not be used in this case.

### OTHER STANDARD FILES

ampeln
  File with point records for traffic lights (Ampeln). The category is set to B for railroad crossings, B0 for railroad crossing without frequent traffic, F for pedestrian-only traffic lights and Zbr for drawbridges, otherwise not used.
hoehe
  File with elevation points. The `Name` fields denotes the elevation in meters, the category is not used.

XXX To be continued

## ATTRIBUTES

inwork
  Marks the map item to be "in work". This could be rendered with an additional "in work" sign along the map item. This attribute is already handled in a couple of data files (`fragezeichen`, `gesperrt`, `handicap`, `strassen_bab`).
Tu
  The map item is in a tunnel. This is already handled in `sbahn`, `rbahn` and `strassen_bab`.
Tu_
  The map item is in a tunnel and a tunnel mound should only be drawn at the beginning of the map item.
_Tu
  The map item is in a tunnel and a tunnel mound should only be drawn at the end of the map item.
_Tu_
  The map item is in a tunnel and no tunnel mounds should be drawn at all.
Br
  The map item is on a bridge. This is already handled in `strassen_bab`.
Eb
  The map item is on an embankment (Bahn- oder Straßendamm). This means that the map item is typically over other map items. The attribute is not used yet.
Cu
  The map item is in a cutting (Einschnitt). This means that the map item is typically under other map items. The attribute is not used yet.

## EXAMPLES

        #: 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 comment

And 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)

## CAVEATS

Some category values may change. It is likely that either the blocking and/or city category values will change, as both use digits.

## AUTHOR

Slaven Rezic <slaven@rezic.de>

## SEE ALSO

bbbike, Strassen.

[Top] Generated by Marek::Pod::HTML 0.49 on Thu Jan 24 20:47:00 2008