[Openstreetmap-dev] Streets in GPX

nick at hogweed.org nick at hogweed.org
Fri Sep 23 17:43:25 BST 2005


> >
> > Bus 219 route
> > StreetID     Startnode Endnode
> > 286            50             63
> > 287            1               3
> > 90281       12             1
> > 2131          54             42
> > etc?
>
> Now you are starting to introduce structure. A new data type: bus route.
> May be you are able to share that datatype and label it "route". Still the
> resulting structure is more complex than the simple "tracks=routes=streets
> are vectors of street segments".

That's true, bus routes represented this way would probably have to go in some 
other data format, not GPX (an argument for a custom data format in the 
long-term?)

> If a part of a track segment has to be shared among different tracks, you
> could split up the segment into 3 pieces: The piece before the common
> track, the common track and the piece after the common track:
>
> Example: (enable fixed sized font)
>
> bus 13
> --------\
>          \                  Baker street
> -----A----+------B-------+-----C--------
> Baker street              \
>                            \ bus 13
>                             \
>
> If the track segment was former composed of a single track segment ABC, it
> is now split into A, which only belongs to "Baker Street", B which is
> assigned to both, the street and the bus route and C, which is only in
> "Baker Street" too.

How would one explicitly link a bus route to a street? I'm guessing it will be 
as follows (but I'm probably wrong...) 

Presumably the nodes (=trkpts) in the GPX will be tagged with an ID which 
incorporates the street ID?

node ID = (Street ID * n) + node position within street

where n is some large number.

 e.g. in the above example, how can we find out the bus goes along Baker 
Street?

Baker Street: route ID 10
Baker Street segment A: nodes 10n to 10n+1
Baker Street segment B: nodes 10n+1 to 10n+2
Baker Street segment C: nodes 10n+2 to 10n+3

Bus route: incorporates nodes 10n+1 to 10n+2 (amongst others)

divide by n and we get 10, and we know this is a Baker Street segment, i.e. 
the bus follows Baker Street.

Or will it just be the lat/long of the nodes?

I know I must be missing something though, as I am still puzzled as to the 
necessity of the multiple two-point segments; the above can be done by 
treating both streets and routes as (possibly multiple) segments of multiple 
single points. 

Even the "streets with gaps" scenario does not necessitate the two-point 
segments; for example (as I said in another message) the A34 has a gap 
between Oxford and Birmingham; it could be treated as two segments each of 
many points.

Nick




More information about the dev mailing list