New answers tagged

0

I've tried the Networkx module in Python. From what I can see, though, it only draws a path from node to node on a graph, not following the curves in the edges. Thus, if finding a distance along a road network is what's needed, Networkx returns only an approximation of it. I'm yet to find out whether this is good enough for my purposes. In case it isn't, ...


4

Try something like that: n=0 for f1 in layer1: p1 = f1.geometry().asPoint() x1, y1 = p1.x(), p1.y() coord1= f"{x1},{y1}" for f2 in layer2: p2 = f2.geometry().asPoint() x2, y2 = p2.x(), p2.y() coord2= f"{x2},{y2}" n += 1 try: processing.run("native:...


Top 50 recent answers are included