Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong coordinates written by SimpleWriter #83

Closed
ruzhytskyi opened this issue Nov 26, 2018 · 2 comments
Closed

Wrong coordinates written by SimpleWriter #83

ruzhytskyi opened this issue Nov 26, 2018 · 2 comments

Comments

@ruzhytskyi
Copy link

Node coordinates written to file by SimpleWriter() differ from location I've passed when creating Node() instance.

from osmium import SimpleWriter
from osmium.osm.mutable import Node

n = Node(location=(30.46, 50.37), id=1)
writer = SimpleWriter('osm.xml')
writer = SimpleWriter('osm.xml')
writer.add_node(n)
writer.close()

Result:

$ cat osm.xml 
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="libosmium/2.14.2">
  <node id="1" lat="50.3699989" lon="30.4599991"/>
</osm>

Osmium version: osmium==2.14.3
Python: 3.5.2
OS: Ubuntu 16.04.5

@lonvia lonvia closed this as completed in e285dd6 Nov 26, 2018
@lonvia
Copy link
Member

lonvia commented Nov 26, 2018

The conversion of the location coordinates didn't keep sufficient precision. Fixed on master.

@ruzhytskyi
Copy link
Author

Thank you! It works in master now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants