1
$\begingroup$

I'm developing an application where the user inputs latitude and longitude numbers in float type format.

I have to validate that the format of the numbers are correct.

My doubt is what is the maximun and minimum integer number on both latitude and longitude.

Let me give an example:

latitude:  <max/min>.666666
longitude: -<max/min>.666666

What are the correct max and min in both cases?

$\endgroup$
1
  • 3
    $\begingroup$ In degrees: -90 to +90 latitude; -180 to +180 longitude. $\endgroup$
    – f.thorpe
    Sep 16 at 1:12
2
$\begingroup$

Latitude is easy: -90 to +90.

Longitude can use one of two conventions: 0 to +360, or -180 to +180. You may want to handle both gracefully.

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.