How to correctly represent relation members in Mysql DB? I see two variants:
For me second variant is preferable, but does it retain OSM semantics? asked 17 Jan '15, 22:26 ikoder |
Depends on what you want to achieve. Relations are ordered in OSM so if you ever plan to upload something again, or otherwise accurately represent OSM's data, you will have to retain the order of elements. In your #2, this would have to be implemented as a separate sequencing column. For most interpretation purposes, e.g. for the drawing of routes or multipolygons, the order does not matter. osm2pgsql, for example, uses a variant of your #1 schema but instead of a discriminator column, stores all member object IDs in a linear list - nodes first, then ways, then relations - and uses only two additional integers to point to the beginning of the way IDs and the beginning of the relation IDs in that list. answered 18 Jan '15, 01:38 Frederik Ramm ♦ |