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

Integration with lonboard #424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Integration with lonboard #424

wants to merge 1 commit into from

Conversation

xoolive
Copy link
Owner

@xoolive xoolive commented Apr 24, 2024

Hi @kylebarron,

Could you have a look at this first tentative? If you have some feedback, better ideas?

I wrote some basic examples blocks below, maybe there are smarter things to do.

With lines, I often see glitches (spikes) that I don't get with other visualization methods. Maybe there's something wrong in my code...

  • From lightest to heaviest, first a single trajectory:

image

from lonboard import Map, PathLayer, ScatterplotLayer
from traffic.data.samples import belevingsvlucht

table = belevingsvlucht.pyarrow_table(geo="line2d")
layer_traj = PathLayer(
    table=table,
    width_min_pixels=1,
    get_color="#4c78a8",
)
layer_scat = ScatterplotLayer(
    table=belevingsvlucht.next("holding_pattern").pyarrow_table(geo="point2d"),
    radius_min_pixels=3,
    get_fill_color="#f58518",
)
Map(layers=[layer_traj, layer_scat])
  • From the same dataset as the quickstart example, I should do smarter things, but that's just a first shot:

image

from lonboard import Map, PathLayer, ScatterplotLayer
from traffic.data.samples import quickstart

lfpo_landing = PathLayer(
    table=quickstart.filter("aggressive")
    .resample("1s")
    .has("aligned_on_ils('LFPO')")
    .eval(desc="", max_workers=6)
    .pyarrow_table(geo="line3d"),
    width_min_pixels=1,
    get_color="#4c78a8",
)

lfpg_landing = PathLayer(
    table=quickstart.filter("aggressive")
    .resample("1s")
    .has("aligned_on_ils('LFPG')")
    .eval(desc="", max_workers=6)
    .pyarrow_table(geo="line3d"),
    width_min_pixels=1,
    get_color="#f58518",
)

Map(layers=[lfpo_landing, lfpg_landing])
  • This is much heavier to preprocess (and there must be some settings to make it look beautiful)

image

# %%
from lonboard import Map, PathLayer, ScatterplotLayer
from traffic.data.datasets import landing_heathrow_2019

subset = (
    # a bit long to process on a laptop, therefore limiting to 5000 flights
    landing_heathrow_2019[:5000]
    .label("holding_pattern", holding=True)
    .eval(desc="", max_workers=4, cache_file="holding.parquet")
)

# %%

# Can we have a different color when the `holding` flag is True ?
holding_patterns = subset.query('holding').pyarrow_table(columns=["holding"], geo="point3d")
holding_layer = ScatterplotLayer(table=holding_patterns, radius_min_pixels=3)

Map(layers=[holding_layer])

Edit from a more powerful machine:

image

It looks like some paths are very well separated, i.e. runway threshold connected to beginning of trajectories sometimes.

With points and colors:

Screencast.from.25-04-2024.14.47.50.webm

@kylebarron
Copy link

Apologies, I've been so busy lately. I'm trying to get a new release of lonboard out early next week and then hope to focus on the trips layer for the following release.

It looks like these examples are using data from the traffic library, right? So I should be able to easily reproduce them myself?

@xoolive
Copy link
Owner Author

xoolive commented Apr 26, 2024

No worry, I also have a real job aside 😉

You should be able to run the code from traffic, but be careful to get it from the lonboard branch (attached to this PR) so you can get the pyarrow_table() methods (and few glitches fixed)

I will probably come with pathlayer() and scatterplotlayer() methods later after we converge.

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

Successfully merging this pull request may close these issues.

None yet

2 participants