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

Need a method for "massive" new links creation #548

Open
Art-Ev opened this issue Jul 4, 2024 · 1 comment
Open

Need a method for "massive" new links creation #548

Art-Ev opened this issue Jul 4, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Art-Ev
Copy link
Contributor

Art-Ev commented Jul 4, 2024

Hi,

Currently, creating a project from existing files or GIS layer is done via adding links "one by one".
This result in pretty long running time because .spatialite file is opened, edited, consolidated and closed once per link we want to add.

Maybe we can create a function taking a pandas dataframe as input and putting the new links all at once in the spatialite file ? (or by group of several thousand of links ?)
Or maybe set the opening and closing of the spatialite file "manual" instead ?

When building project from OSM, how is the spatialite file updated @pedrocamargo ?

@Art-Ev Art-Ev added the enhancement New feature or request label Jul 4, 2024
@pedrocamargo pedrocamargo changed the title Need a method for "massiv" new links creation Need a method for "massive" new links creation Jul 4, 2024
@pedrocamargo
Copy link
Contributor

@Art-Ev , this is indeed a time-consuming process. Currently, the OSM importer does this with an executemany call to sqlite3

conn.executemany(insert_qry, self.node_df[cols].to_records(index=False))

Creating all nodes before doing the links makes it a LOT faster, which is what we do with OSM (see line above).

Whenever I do things on a "large scale", I remove all triggers, add links and nodes and then add the triggers back. That is a hack that I can't recommend, but it could've made OK by running a set of Spatialite queries AFTER all links and nodes are added to enforce consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants