I am working with a gtfs file with shapely and shape id and I am trying to calculate the total unique length of the routes passing by a stop.
I have a list of routes that goes through the stop and I am going through a loop where it finds the multiple routes(or whatever the quantity is) for each stop and shape id for it to create a line string geometry I have used the buffer to buf the line and find the combined length of the route but the problem is some of the routes don't total up properly. Maybe I am doing something wrong or missing a step. Any help would be awesome
line = LineString(shapes['geometry'].tolist()) buffer = line.buffer(0.0001) combine = unary_union(dilate) length = combine.area
This is basically the result it is adding the total length of the final route so i am not even sure if it is combining. Basically I have a list of all the route ids that pass through the stop id and I have a (geodataframe for shape id geometry(x,y) where it holds the shape coord) it then filters through the shape id and creates a linestring and I am trying buffer the linestring so that it adds all the routes that passes the stop id.