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

Wrong sign in HeatTile.get_ll_bounds padding #6

Open
gusajz opened this issue Jul 16, 2014 · 2 comments
Open

Wrong sign in HeatTile.get_ll_bounds padding #6

gusajz opened this issue Jul 16, 2014 · 2 comments

Comments

@gusajz
Copy link
Contributor

gusajz commented Jul 16, 2014

The method substracts the padding from self.top and adds it in self.bottom, but it should be the other way. According to google maps documentation (https://developers.google.com/maps/documentation/javascript/maptypes#WorldCoordinates), Y coordinates go from north to south (ie: increasing going to north).

This causes, that padding actually make the box smaller, instead of larger, in the y axis. The result is a gap in top and bottom borders of every tile.

Actual code:
def get_ll_bounds(self, padding=0.0):
(n, w) = self.px2ll(self.left - padding, self.bottom + padding)
(s, e) = self.px2ll(self.right + padding, self.top - padding)
return (s, n, w, e)

Proposed fix (note the signs in px2ll second argument):
def get_ll_bounds(self, padding=0.0):
(n, w) = self.px2ll(self.left - padding, self.bottom - padding)
(s, e) = self.px2ll(self.right + padding, self.top + padding)
return (s, n, w, e)

@amccollum
Copy link
Owner

Sorry for the slow response. I'm willing to believe you're right on this if you've tested it. Can you submit a pull request? Thanks.

@gusajz
Copy link
Contributor Author

gusajz commented Jul 24, 2014

Yes, I've been using it intensively. Sure, I'll submit a pull request :)

gusajz added a commit to gusajz/pyheat that referenced this issue Aug 4, 2014
amccollum added a commit that referenced this issue Aug 4, 2014
Fixes: Wrong sign in HeatTile.get_ll_bounds padding #6
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

2 participants