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

airpollutionapi30 has incorrectly swapped latitude and longitude #387

Closed
davidpirogov opened this issue Jan 16, 2022 · 3 comments
Closed
Labels
Milestone

Comments

@davidpirogov
Copy link

Fairly straightforward bug that fails in locations greater than plus-minus 90 degrees longitudinal, such as Melbourne, Australia (place id 2158177, 'lon': 144.9633, 'lat': -37.814)

The offending code is in the lines below:

lon = float(the_dict['coord']['lat'])
lat = float(the_dict['coord']['lon'])

Simple fix to swap the dictionary keys so that the lat variable refers to float(the_dict['coord']['lat']) and that the lon variable refers to float(the_dict['coord']['lon'])

@csparpa
Copy link
Owner

csparpa commented Jan 19, 2022

Haaaa good catch! A classic human error ;-)

@davidpirogov would you feel like directly proposing a pull request for this? If so, please also include a unit-test to "fix the fix"

Thanks!!

@csparpa csparpa added the bug label Jan 19, 2022
davidpirogov added a commit to davidpirogov/pyowm that referenced this issue Jan 24, 2022
@davidpirogov
Copy link
Author

@csparpa done!

davidpirogov added a commit to davidpirogov/pyowm that referenced this issue Jan 26, 2022
@csparpa
Copy link
Owner

csparpa commented Jan 27, 2022

Closed with #390

@csparpa csparpa closed this as completed Jan 27, 2022
@csparpa csparpa added this to the 3.3.0 milestone Feb 14, 2022
@csparpa csparpa mentioned this issue Feb 14, 2022
csparpa added a commit that referenced this issue Feb 14, 2022
# New features
[380](#380) Implemented [National Weather Alerts](https://openweathermap.org/api/one-call-api#listsource) support
[376](#376) Now PyOWM uses SQLite instead of files to internally store city data. `CityIDRegistry` interface has changed but in a retrocompatible way


# Chores
[381](#381) Now it is possible to specify how many times to retry an API call


# Bugfixes
[379](#379) Experimental fix for `404` errors on Agromonitor API satellite image search 
[387](#387) Fixed lat/lon swap bug on Airpollution API
[389](#389) Fixed wrong city name in City ID database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants