pyrosm icon indicating copy to clipboard operation
pyrosm copied to clipboard

Wrong OSM id for relations

Open chourmo opened this issue 3 years ago • 3 comments

The osm id for relations is not the value from OpenStreetMap.

from pyrosm import OSM, get_data

filepath = get_data("Marseille")  
osm_ref = OSM(filepath)  

parks = osm_ref.get_data_by_custom_criteria(
    custom_filter={"leisure": ["park"]},
    filter_type="keep",
    keep_ways=True,
    keep_relations=True,
)  
parks = parks.loc[parks.osm_type == "relation"]  

Results has 2 rows with id 1428478507 and 19033931325.

There is no relation id with these values in openstreetmap www.openstreetmap.org/relation/1428478507 and www.openstreetmap.org/relation/19033931325

The right osm ids are 3048922 and 11959147

chourmo avatar Jan 18 '22 10:01 chourmo

I am encountering the same issue as well. After loading NewYorkCity, the way IDs seem to be correct, but all of the relation IDs seem to be incorrect.

From 'newyorkcity.osm.pbf':

wikipedia,id en:4 World Trade Center,9494583065 en:5 Beekman Street,9513062783 en:Alexander Hamilton U.S. Custom House,9498278818 en:Castle Clinton,9505670327

All of these IDs are incorrect. The way IDs are however correct. I cannot find any documentation that would suggest that the relation IDs are given differently than the way IDs.

I can trace this issue to the pyrosm package and not the files themselves. Using osmium with greenland-latest.osm.pbf, I get normal relation IDs, however the relation IDs from pyrosm are nonsensical.

dhodcz2 avatar Apr 19 '22 01:04 dhodcz2

Any news on this issue?

hbruch avatar May 22 '23 14:05 hbruch

Any news on this issue?

I've managed to implement a fix for this and have opened a pull request. It seems to be working for me so far: https://github.com/HTenkanen/pyrosm/pull/234

AnBowell avatar Apr 12 '24 09:04 AnBowell