duckpgq-extension
duckpgq-extension copied to clipboard
Graph creation functions
-- Preamble: Just stumbled upon the extension, very excited, thank you!
Functionality suggestion ( maybe already in pipeline):
Explicit graph data are not that common and often have to be created by recomputing the topology. This is common in the spatial context ( street lanes), where graphs are computed by analyzing topological relationships between member geometries.
The result is a data structure -- the edge table. See for example the behaviour of [pg_routing] (https://docs.pgrouting.org/latest/en/pgr_createTopology.html), potentially with an additional vertices table.
It would be awesome if it was possible to create the input structures in DUCK/PGQ, instead of having to craft them separately.
Hi Tom,
Thank you :) I'll start working more on the extension again in the near future (wrapping up an internship right now)
I am new to pg_routing, so just for my understanding, what would be the input to pgr_createTopology
? Would that be an already existing edge_table
(or a csv file with a source and target column?) through which the edge_table
gets updated/created according to the rows_where
parameter and the creation of a vertex_table
?
If so, that sounds like a feature I would definitely like to add to the list, seems quite useful and improves usability :) Please let me know!
Yes, an edge table that contains a geom column. Think of it as generating a graph def from a vector drawing. These are typically linestring edges (note, we distinguish vertices of a linestring, an graph nodes, where 2+ linestrings intersect). Duckdb implements spatial geometries as here https://duckdb.org/docs/extensions/spatial.html
Tolerance is for "snapping" linestrings if there is a small gap between end vertices.
I see, I believe there are opportunities to combine the spatial and duckpgq extension, so I'll keep this in mind. Thank you :)
JUst catching up on this, did anyone manage to experiment with graph creation based on the DuckDB geometry support? This is now beautifully mainstream, and supporting graph based analytics ( shortest path) requires the ability to create a network from the geometries from a table that contains "lines". Is this something that is now tackled in the duckpg extension development?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.