[OSM-dev] Osmosis Replication Statistics
Robert (Jamie) Munro
rjmunro at arjam.net
Fri Aug 31 23:02:36 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Brett Henderson wrote:
> The only issue is that a polygon is defined by integer
> coordinates, not doubles. I guess I could fudge it by multiplying
> lat/lon by a fixed constant and losing some precision but it's not ideal ...
IMHO it /is/ ideal. Using floats for lat/lon is stupid - it just
means that you are more accurate at measuring places nearer the equator
and nearer the Greenwich meridian, and less accurate as you move further
away. Use 2^N/360 as your fixed constant, where N is the number of bits
you use in your integer. 32 bits gives a precision down to less than a
cm. If you are working in a sufficiently low level language, you can
ignore overflows and signed/unsigned issues because they cancel each
other out, and crossing the date line works by magic.
Robert (Jamie) Munro
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG2I/6z+aYVHdncI0RAkv5AJ94VA/bVLH5KTACaEjO3agEazvEOwCfSPny
8U24ruWL3dPJNtTWUnDyC0M=
=6G6d
-----END PGP SIGNATURE-----
More information about the dev
mailing list