Skip to content

Aggregator weights by object ID #364

Answered by raybellwaves
Naarlack asked this question in Q&A
Discussion options

You must be logged in to vote

I think what you would like is a obj_id_col_count arg (bool) to get_flows_gdf.

Here is a quick and dirty post-processed version. It's likely this information is in the code and just not being returned.

flows['start_point'] = flows['geometry'].apply(lambda geom: Point(geom.coords[0]))
flows['end_point'] = flows['geometry'].apply(lambda geom: Point(geom.coords[-1]))
counts = []
for ix, flow in flows.iterrows():
    start_point = flow['start_point']
    end_point = flow['end_point']
    count = 0
    for rider_id in gdf["rider_id"].unique():
        trajs = traj_collection.filter("rider_id", rider_id)
        for traj in trajs:
            traj_geom = traj.to_linestring()
            if star…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@Naarlack
Comment options

@raybellwaves
Comment options

Answer selected by Naarlack
@Naarlack
Comment options

@anitagraser
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants