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_Element_Metadata doesn't initialize its variables #530

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wiktorn
Copy link
Contributor

@wiktorn wiktorn commented May 28, 2019

Recently I've switched my minute diffs from http://download.openstreetmap.fr/replication/ to http://download.geofabrik.de/europe/.

And while openstreetmap.fr provides all the metadata information, Geofabrik provides only version information (and no values for attributes like changeset, user, uid). Using such diffs for update_database results in database "corruption", as random values land in changeset.

As I've checked source code node_start, way_start and relation_start they create OSM_Element_Metadata object but changeset, user_id and user_name fields are not set if not provided in source. Object constructor does not initialize changeset (and I guess that constructor depends on implicit empty string initialization for user_name), though user_id is.

Looks like following change fixes problem.

Though looking around the code, it might be needed to initialize more variables (timestamp, version), but I do not know, how this might affect performance.

@mmd-osm
Copy link
Contributor

mmd-osm commented May 28, 2019

I believe you can also fetch diff files from Geofabrik which include metadata. Due to GDPR restrictions, you need a special download tool and authenticate using your osm user account: https://osm-internal.download.geofabrik.de/index.html.

You can also run Overpass without metadata by leaving out the "--meta" tag for your dispatcher process and the update_database / update_from_dir executables.

@wiktorn
Copy link
Contributor Author

wiktorn commented May 28, 2019

@mmd-osm thank you for the pointer. Still I think it might be worthwhile to include this change as it looked to me like data corruption at first and I lost confidence in my hardware and data.

@mmd-osm
Copy link
Contributor

mmd-osm commented May 28, 2019

I think a better fix would be to reject processing such minutely diffs in case you've started your dispatcher with --meta or --attic. After all, there isn't much point running your Overpass server in meta data mode and then try to load some files without any meta data.

As an extra bonus, you don't need additional hard disk space for completely useless meta data.

@mmd-osm
Copy link
Contributor

mmd-osm commented Jun 23, 2021

Superseded by 4a9cf9d

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

Successfully merging this pull request may close these issues.

2 participants