Skip to content

Bouding box uses wrong conversion between degrees and meters #43

Description

@Helium314

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions