changegen.generator
Module¶
- changegen.generator.generate_changes(table, others, deletions, dbname, dbport, dbuser, dbpass, dbhost, osmsrc, outfile, id_offset=0, neg_id=False, compress=True, self_intersections=False, max_nodes_per_way=2000, modify_only=False, hstore_column=None)¶
Generate an osm changefile (outfile) based on features in <table> (present in the database for which connection parameters are required).
All features in table will be added to the changefile, as well as any features from others that must be modified to properly represent linestring intersections. <osmsrc> is a file path pointing to an osmium-readable OSM source file (.pbf) for the purpose of querying existing node IDS to maintain intersections when modifying existing waysm.
others (either a string or list of strings) specifies the other table(s) in the database which must be queried for intersections with any newly-added features in table. Any intersections will produce a <modify> change file tag for the intersecting features in <other> that shares a junction node with the intersecting feature in table.
- Parameters
table (str) – Database table name from which new features will be derived.
- changegen.generator.generate_deletions(table, idfield, dbname, dbport, dbuser, dbpass, dbhost, osmsrc, outfile, compress=True, skip_nodes=True)¶
Produce a changefile with <delete> nodes for all IDs in table. IDs are chosen via idfield.
TODO: provide an option to not delete Nodes (which could break intersections.)