﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5031	export .osm with consistent precision	HamishB <hamish_b@…>	team	"(copied to a new wish from #4445 comment 2)

Hello,

when opening .osm files downloaded then exported using JOSM, Merkaartor, and Xapi I have noticed some differences that, when mixed, cause the Validator to fail to detect duplicate nodes. It's an ascii representation + floating point precision issue.

    * JOSM seems to export with %.9g (~1cm)
    * Merkaartor seems to save with %.8f (~1mm)
    * Xapi seems to export with %.7f (~1cm) 


I would argue that %.9g is no good for JOSM as it changes the positional precision only for longitude, based on if you are 100 degrees east or west of England. %g maintains overall number of numbers, not number of decimal places. 

Latitude (which could plausibly accept reduced precision near the poles) is always <100 so except for by the equator (<10deg) is slightly more consistent. Longitude precision varies by 4 orders of magnitude depending on if you are <1 deg, <10 deg, or <100 deg.


I suggest for JOSM, Merkaartor, and Xapi to all agree on a single print format, and for that format to be %.8f (slightly beyond what survey grade RTK GPS will give you, but no more as to avoid cluttering everyone's disks with geo-noise). 

I take it the back-end database is PostGIS storing coords as sql type DOUBLE PRECISION?


(fwiw JOSM r3208 also fails to open the downloaded Merkaartor 0.14 .osm file due to missing version= tags in nodes, but I guess that is a Merk bug)


thanks,
Hamish
"	enhancement	closed	normal		Core	tested	invalid	export	
