[OSM-talk] JOSM update / why does API return GPS points in descending order?
Raphael Mack
ramack at raphael-mack.de
Fri Mar 28 17:38:23 GMT 2008
Am Freitag, 28. März 2008 schrieb Frederik Ramm:
> Hi,
>
> > mh, I guess this cannot be fixed in josm, since the the server returns
> > the stored gps points in arbitrary order. I would even suggest not to
> > draw any direction arrows for gps data from the server.
>
> But they can't be too arbitrary since drawing lines in between the
> points would reveal a completely chaotic picture otherwise. I think
> David Earl is right about sorting by timestamp since this is what's in
> the API source:
>
> points = Tracepoint.find_by_area(min_lat, min_lon, max_lat, max_lon,
>
> :offset => offset, :limit => TRACEPOINTS_PER_PAGE, :order => "timestamp
>
> DESC" )
>
> ... and the "DESC" nicely explains the observation that all arrows are
> in the wrong direction! I wonder why it is there. TomH?
Oh, this sounds nice. I expected, that the timestamps are not even stored
in the db, since they are not included in the delivered gpx. Maybe one
could implement this, when touching the code to change to ascending
order? - This would allow to split the track into track segments which
would help to draw arrows only if the time difference is less than some
threshold...
Rapha
More information about the talk
mailing list