[Openstreetmap-dev] again issues with server rounding

Immanuel Scholz immanuel.scholz at gmx.de
Fri Feb 10 13:42:07 GMT 2006


Hi,

I have a problem with the thing, that the server does not save the full
double precision of a coordinate but round it to some "DECIMAL(2,6)".

Is the rounding procedure specified somewhere? Is this specification exact
and deterministic? So if different computers do the algorithm seperatly,
can the result be compared with double-equal?

(No, the algorithm seems to be NEITHER "just truncate all parts after the
6'th decimal position after point" NOR "rounding the value to 6 digits
after point using classic rounding algorithm")

And will the algorithm be the same when OSM switch to postgresql?


My concrete problem:
- User enters a new node in JOSM
- save the data to disk
- upload the data.
Now the node location is rounded in the server.
- User restart JOSM without saving
- reload the data from disk.
(Without server communication, JOSM must think that the node was not
uploaded before.)
- User upload the node again.
Now it is currently impossible for JOSM to detect, that there is already a
node on the same location, except if JOSM can perform the rounding
algorithm exactly as the server does (or use a server function to round,
which is silly) and do a auto-download prior to the upload.

This makes it impossible to warn the user that his data has been already
uploaded at the same location.
I think this issue is not academic and could effect the server if not
dealt with! (The whole reason to use "offline" editors is to save the work
to disk without server communication)


Solutions:
- Ignore the issue. Improve the offline clients to merge double nodes
later. This could lead to many senseless histories for created and deleted
nodes.
- Exact specification of the rounding procedure enables offline clients to
compare nodes by their lat/lon location and warn users about already
specified nodes.
- A server function to round input values and return the rounded one. This
seems inperformant to me and I suspect it can not be implemented efficient
in the server.
- Higher level access routines in the server which are dedicated for
offline editors. As example a function to upload a list of new nodes which
return all nodes (with their ids) which are on the same rounded position.
Again, I think this is inperfomant to implement.


NOT A SOLUTION:
- Disallow nodes on the same location in general. There may be reasons for
putting nodes on the same location twice.
- Force offline clients to round all nodes more than the server would
round them to prevent futher modification of the server. I think the
current rounding is hard on the limit for some applications (e.g.
roundabouts or complex crossings).


Ciao, Imi.






More information about the dev mailing list