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

osm_object_primitive.to_dict() does not process relations' members #10

Closed
osm3421839 opened this issue May 2, 2023 · 2 comments
Closed

Comments

@osm3421839
Copy link

Given e is a relation, invoke e.to_dict() gives:

e.to_dict()
{'id': 12270672, 'visible': True, 'version': 2, 'changeset_id': 122818285, 'timestamp': '2022-06-24T20:42:22Z', 'user_id': 3421839, 'tags': {'name': '29 路', 'network': '肇庆公交', 'network:wikidata': 'Q111736572', 'network:zh': '肇庆公交', 'ref': '29', 'route_master': 'bus', 'type': 'route_master'}, 'members': [Member(element=Relation(id=12270671, visible=None, version=None, changeset_id=None, timestamp=None, user_id=None, tags={}, members=[]), role=''), Member(element=Relation(id=12270670, visible=None, version=None, changeset_id=None, timestamp=None, user_id=None, tags={}, members=[]), role='')], 'type': 'Relation'}

Notice that e's members is still in Member type, which is not python primitive. That is to say, serialization is not complete.
This prevents deserialization with ast.literal_eval from string.

@docentYT
Copy link
Owner

docentYT commented May 3, 2023

I will look into it.

docentYT added a commit that referenced this issue May 3, 2023
@docentYT
Copy link
Owner

docentYT commented May 3, 2023

https://github.com/docentYT/osm_easy_api/releases/tag/v0.4.0

@docentYT docentYT closed this as completed May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants