-
Notifications
You must be signed in to change notification settings - Fork 79
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
Clipping trajectories to eurofirs #10
Comments
Thank you for your report @obbe79 I was able to reproduce the bug with the so6 example on the repository so6_LIMM = so6.inside_bbox(eurofirs['LIMM'])
so6_LIMM['BAW33CE'].clip(eurofirs['LIMM'].flatten()) I think it is more a problem on the SO6 side than on the FIR side. Let me investigate further when I have more time (not this week); I have fixed a similar issue with regular ADS-B flights and considered a different way to address the question. I can probably correct the SO6 in a similar manner. |
Hi,
Unfortunately I still get the abovementioned error on some trajectories. (the red line is the trajectory and the blue line is the FIR boundary) |
This is indeed the problem I suspected :) I will fix it the same way it is done now with What you noticed with |
Is it possible to join multiple intersections? For example, I would like to extract all the trajectories that go through the LIMM FIR and LIRR FIR. Is there an easy way to do this? I was able to do it creating a polygon that joins the italian FIRs, and then creating a new ExtrudedPolygon() object from which I created a new Airspace() object.
I'm not sure how Thank you. |
Note to myself, implement sum(f for f in so6 if f.intersects(eurofirs['LIMM']) and f.intersects(eurofirs['LIRR'])) |
This is now possible: ``` sum( f for f in so6 if f.intersects(eurofirs['LIMM']) and f.intersects(eurofirs['LIRR']) ) ```
@obbe79 I started to have a look but my faulty flight actually did not intersect the sector (so clip would fail, it will return Could you please try Thank you for your support |
@obbe79 also please be aware that most flights will actually fly above LIMM FIR. (stops at FL295, but UIR covers FL295 and above) Current Now that I look at it again, I think a future version of By the way, I forgot I had this, but you can do |
Thank you for your answer. Yes, summing the FIRs works! 😄 I also sent you the trajectory you asked for. |
@obbe79 Could you please try now? Also be careful if you use pickled version of your so6, I made a change in the library: timestamps are now explicitly marked with UTC timezone. This may cause issues if you cached data before... (just rewrite your cached files) If you parse directly so6 files every time you run your code (slower), you will not see any difference. About your specific flight: import matplotlib.pyplot as plt
from traffic.data import SO6, eurofirs
from traffic.drawing import EuroPP, countries
ex = SO6.from_file('bcs361.pkl')
with plt.style.context('traffic'):
fig, ax = plt.subplots(subplot_kw=dict(projection=EuroPP()))
ax.add_feature(countries())
ex['BCS361'].plot(ax)
ex['BCS361'].clip(eurofirs['LIMM'].flatten()).plot(ax)
eurofirs['LIMM'].plot(ax)
ax.set_extent(eurofirs['LIMM']) |
This is now possible: ``` sum( f for f in so6 if f.intersects(eurofirs['LIMM']) and f.intersects(eurofirs['LIRR']) ) ```
Hello,
I would like to clip so6 trajectories to specific FIRs.
For instance, I have collected all the trajectories crossing a specific FIR:
bdx_so6_LIMM = so6_m1.inside_bbox(eurofirs['LIMM'])
and now I would like to clip them.
Unfortunately the clip command does not work with the eurofirs objects (I don't have AIRAC files):
bdx_so6_LIMM['BCS361'].clip(eurofirs['LIMM'].flatten())
I get the following error:
NotImplementedError: Multi-part geometries do not provide a coordinate sequence
I'm probably missing something. Is there a better way to do what I'm trying to do?
Thank you,
Rob
The text was updated successfully, but these errors were encountered: