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

Bouding box uses wrong conversion between degrees and meters #43

Open
Helium314 opened this issue Feb 28, 2022 · 0 comments
Open

Bouding box uses wrong conversion between degrees and meters #43

Helium314 opened this issue Feb 28, 2022 · 0 comments

Comments

@Helium314
Copy link

in

double locEast = lon + (radius_ew * BackendService.METER_TO_DEG) * cosLat;
double locWest = lon - (radius_ew * BackendService.METER_TO_DEG) * cosLat;

east-west size of the bounding box is set by converting meters to degrees and multiplying with cosLat. This results in narrower bouding boxes (in degrees) for high latitude.
But actually the bouding boxes with the same e-w width in metes should get wider if we go towards the poles.

Proposed solution:
change to (radius_ew * BackendService.METER_TO_DEG) / cosLat;
and change

radius_ew = (float)(((east - center_lon) * BackendService.DEG_TO_METER) / cosLat);
to ((east - center_lon) * BackendService.DEG_TO_METER) * cosLat

@Helium314 Helium314 changed the title Bouding box uses wrong conversion from degrees to meters Bouding box uses wrong conversion between degrees and meters Feb 28, 2022
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