-
Notifications
You must be signed in to change notification settings - Fork 157
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
Coordinates in Imposm dataset does not match those in original data #267
Comments
To make it even worse, you can't even use workaround like this reliably: |
I also see this, for example with OSM ID 130159445, Imposm produces (51.4182744347945, -0.178266358100899) compared to OpenStreetMap source of (51.4182745, -0.1782663) |
Maybe the pattern is that for lon, the result should be rounded down to the floor of 7th decimal, while for lat, it should be rounded up to the ceil of 7th decimal? |
not tested .. but probably imposm3/cache/binary/serialize.go Lines 5 to 14 in 53bb807
example: the 16.9660466 --> 16.966046541773153 >>> # CoordToInt in Python3
>>> int( (16.9660466 + 180.0) * 11930464.7083 )
2349896467
>>> # IntToCoord
>>> ( 2349896467.0 / 11930464.7083) - 180
16.966046541773153
>>> the 50.4243161 --> 50.424316086151975 >>> int( (50.4243161 + 180.0) * 11930464.7083 )
2749069171
>>> (2749069171.0 / 11930464.7083) - 180
50.424316086151975 |
@ImreSamu yep, I was actually looking at that line exactly I tried to fix it, but I am not Go programmer, so I used ubuntu VM and could not compile the project in reasonable time (there were un-googleable dependencies failures) so I gave up. |
Hello I second @rouen-sk initial issue, it causes harm when you intend to cut ways with nodes that finally aren't located on ways they are member of. Is there a willing to solve permanantly this issue or reviewing any contribution about it? |
I am using
imposm-0.11.1-linux-x86-64
along with Osmosis for the same dataset, and there is following issue with created geometries:It seems that Imposm import geometries with slightly changed coordinates. At first I thought this may be some rounding issue, but opposite is true: Imposm geometries have MORE decimal places than original data somehow?
For example, OSM node 1919896914 is part of administrative boundary of Czech Republic (way 302662933), and has coordinates
POINT(16.9740102 50.4177556)
(as seen on https://www.openstreetmap.org/node/1919896914) and also im my Osmosis-created postgis database.In Imposm dataset (created from the same PBF), I don't have this point as standalone feature, but it is part of the admin area polygon, and when I find it (by dumping points of exterior ring of that admin area polygon), it looks like this:
POINT(16.97401018797831 50.41775557053805)
This causes Imposm polygon to be a tiny bit "larger" on that side (country boundary is shifted few milimeters), but it is enough for some operations (like ST_Contains for some points) to give incorrect results.
Since I dont have tools to view raw PBF data right now, I can't know for sure, how the coordinates look like in source data. But OSM specification says coordinates should be 7-decimal places: https://wiki.openstreetmap.org/wiki/Node
Is there a way to force Imposm to use 7-decimal places for coordinates, so the resulting geometries would exactly match those imported with Osmosis (or other OSM-based datasets)?
The text was updated successfully, but these errors were encountered: