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

Make property handling more robust #2244

Merged
merged 3 commits into from
Sep 16, 2024
Merged

Conversation

joto
Copy link
Collaborator

@joto joto commented Sep 15, 2024

(Changes to) Properties are stored at a later time in the database so the db is not changed if osm2pgsql fails for some reason. Basically we are trying to do as many checks as possible before actually writing the properties to the db. For instance the input file is now actually opened before properties are written,

This solves some cases already mentioned in PR #2085.

Property changes were reflected piece by piece in the database. This
changes it so they are only done in one go after all the changes have
been made. So if something fails before we get to the point where we
write all properties to the database, no updates are actually done.

And the code is simpler because we keep track of necessary database
updates automatically and do them the next time the store() function is
called.
If osm2pgsql fails during initialization, for instance because the input
file or the style file was not found, it had already initialized the
osm2pgsql_properties table in the database. We now write the properties
table later to reduce the chances that a small error on the command line
destroys an existing database this way.
@lonvia lonvia merged commit fa5b152 into osm2pgsql-dev:master Sep 16, 2024
27 checks passed
@joto joto deleted the robust-properties branch September 17, 2024 07:50
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