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

OpenCage Result Constructs BBox Incorrectly #447

Open
ericbusboom opened this issue Oct 18, 2021 · 0 comments
Open

OpenCage Result Constructs BBox Incorrectly #447

ericbusboom opened this issue Oct 18, 2021 · 0 comments

Comments

@ericbusboom
Copy link

The OpenCageResult.bbox property is defined as:

@property
def bbox(self):
    south = self._bounds.get('southwest', {}).get('lat')
    north = self._bounds.get('northeast', {}).get('lat')
    west = self._bounds.get('southwest', {}).get('lng')
    east = self._bounds.get('northeast', {}).get('lng')
    if all([south, west, north, east]):
        return BBox.factory([south, west, north, east]).as_dict

But the BBox initializer expects a list argument, in BBox.__init__ to be:

    elif bbox is not None and all(bbox):
        self.west, self.south, self.east, self.north = map(float, bbox)

It looks like OpenCageResult.bbox should be changed to:

return BBox.factory([west, south, east, north]).as_dict
@ericbusboom ericbusboom changed the title OpenCage Result Constructs BBox Incorretly OpenCage Result Constructs BBox Incorrectly Oct 18, 2021
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

No branches or pull requests

1 participant