4 The first pass will unserialize the pbf in memory, namely will build the following data
7 - An array of ways. The ids of the way nodes (called references in this context) are
8 resolved to their pointers in the array of nodes. Missing nodes get a 0 pointer.
9 - An array of relations. In this case though, the ids of relation members are not resolved
10 to pointers yet, only the ids are stored, pointer resolution will happen in the 2nd pass,
11 since we could have references to not yet parsed relations, see below.
14 The second pass will resolve the ids in the unserialized relations to pointers. Namely based
15 on the type of the relation member, the right index (nodes/ways/relations) will be selected
16 and search for a pointer. If we have a missing node/way/relation, we store the 0 pointer.
19 The third pass will select the features based on the zoom level and compute their
20 intersections with the tiles from user provided bounding box. Each feature intersecting a
21 tile will be fully copied there, there is no "smart" feature clipping to the tile
22 boundaries. The database format is braindead.