close
The Wayback Machine - https://web.archive.org/web/20201112182845/https://github.com/xoolive/traffic/issues/102
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

Airport.geoencode not working #102

Closed
sashamadar opened this issue Sep 4, 2020 · 9 comments
Closed

Airport.geoencode not working #102

sashamadar opened this issue Sep 4, 2020 · 9 comments
Assignees

Comments

@sashamadar
Copy link

@sashamadar sashamadar commented Sep 4, 2020

Hi,

The request to get the airport details using airports["JFK"].geoencode(runways=True, labels=True) does not work. It outputs a blank cell on jupyter or colab notebook. I have tried running this command before and it used to work (a couple of months ago).

Thank you for the help,
Sasha

@xoolive
Copy link
Owner

@xoolive xoolive commented Sep 4, 2020

Thank you Sasha for your interest in the library.

About your problem, I suspect a problem in your Jupyter configuration, unrelated to the traffic library. Could you check whether a regular altair sample code works properly?
https://altair-viz.github.io/getting_started/starting.html

@sashamadar
Copy link
Author

@sashamadar sashamadar commented Sep 4, 2020

Thank you Xavier for your support.
It turns out that a regular altair sample code works well.

Also, the airports.geonencode request seems the only not working. The other plot like Flight Information Region work. What is weird is that I have exactly the same trouble using google colab or python on my desktop.

I am using version 4.1 of altair

Thank you :)
Sasha

@xoolive
Copy link
Owner

@xoolive xoolive commented Sep 7, 2020

On my side, it seems that the CSV file from ourairports.com is now empty! (an issue on their side)

Can you try airports.data and check the content of the dataframe? If this is the problem, I will implement a fallback and upload a fix quickly...

Xavier

@xoolive
Copy link
Owner

@xoolive xoolive commented Sep 8, 2020

The problem seems fixed on the ourairports.com side and I was able to reproduce the issue you mentioned. For now you can do

airports["JFK"].geoencode(False, True, True) 

But there seems to be a bug with the full openstreetmap layout. I will investigate that.

@xoolive xoolive self-assigned this Sep 8, 2020
@sashamadar
Copy link
Author

@sashamadar sashamadar commented Sep 9, 2020

Thank you for your help Xavier.
The airports["JFK"].geoencode(False, True, True) does work now.

In the meantime, I troubleshooted the bug using python on my desktop (Spyder) with the altair_viewer library. The graphs are being displayed on a local webpage and it works fine.

Thanks again,
Sasha

@xoolive
Copy link
Owner

@xoolive xoolive commented Sep 9, 2020

Following up, it seems there is an issue with altair and Polygons which appear as big full squares. LineStrings work fine. I am still not sure whether the geojson is faulty (e.g. airports['KJFK'].geojson()) or whether it is a bug in altair/vega.

@develmusa
Copy link

@develmusa develmusa commented Oct 12, 2020

At Version 2.3 @xoolive's temporary solution worked. It's just missing the Layout of OSM.

  • airports["AMS"].geoencode(runways=True, labels=True): -> Blank Cell
  • airports["AMS"].geoencode(False, True, True): ->
    visualization

But in the current commit 95e9ff5 it seems the method something with the definition of geoencode() went wrong.

  • airports["AMS"].geoencode(runways=True, labels=True) and airports["AMS"].geoencode(False, True, True) :
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-be0fee99b63c> in <module>
----> 1 airports["LFBO"].geoencode(runways=True, labels=True)

~/.conda/envs/thead/lib/python3.8/site-packages/traffic-2.4.1-py3.8.egg/traffic/core/structure.py in geoencode(self, footprint, runways, labels)
    129             cumul.append(self.runways.geoencode())
    130         if labels:
--> 131             cumul.append(self.runways.geoencode("labels"))
    132         if len(cumul) == 0:
    133             raise TypeError(

TypeError: geoencode() takes 1 positional argument but 2 were given
@xoolive xoolive closed this in edde381 Oct 12, 2020
@xoolive
Copy link
Owner

@xoolive xoolive commented Oct 12, 2020

woops, thanks @develmusa !
I remember when I edited this and mypy didn't shout :/

In the meantime, I changed default parameters for airports, without OSM layout, but with runways and labels. Will revert when things get clearer with altair and polygons.

Closing for now then, sorry for the inconvenience

@xoolive
Copy link
Owner

@xoolive xoolive commented Nov 8, 2020

@develmusa @sashamadar found out the issue by chance today (the best way to solve problems is probably to not try...), reopening then pushing a fix

@xoolive xoolive reopened this Nov 8, 2020
@xoolive xoolive closed this in 340b338 Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.