I am using the Microsoft.SqlServer.Types DLL in my projects for validating Latitudes and Longitudes.
The Library validates longitude values between -15069 and 15069 degrees instead from -180 to 180. Can anybody explain what is the significance or reason that Microsoft is checking the longitude values to be between -15069 and 15069 degrees?
Microsoft has listed the standards for Geo Spatial standards on this website which mentions the Longitude values MUST be between -15069 and 15069 degrees, inclusive.
https://msdn.microsoft.com/en-us/library/ee301753(v=sql.105).aspx
Your inputs in understanding this concept will be appreciated!
Here's a brief thought experiment.
Which of the following three lines does LINESTRING (-180 0, 180 0)
represent?
A line going around the whole globe along the equator in an eastward direction.
A line going around the whole globe along the equator in a westward direction.
A line of length 0, since -180° latitude denotes the same meridian as +180° latitude.
As soon as you decide on any of the three possibilities, you will find that you have no way of modelling the other two cases as LINESTRING
(try it!)… at least not when you restrict longitude to the (geographically correct) interval [-180°..+180°]!
Let's see what happens when we relax that restriction:
The line going around the globe in an eastward direction can now be modelled as LINESTRING (-180 0, 180 0)
. (This seems to match our expectations, since increasing degrees of longitude means "going eastward".)
The line going around the globe in a westward direction now becomes LINESTRING (-180 0, -540 0)
. (Decreasing degrees of longitude denotes "going westward".)
The line of length 0 becomes LINESTRING (-180 0, -180 0)
. (No change in coordinates means "no distance travelled".)
That, I cannot say. It might have to do with floating-point precision (i.e. spatial computations becoming too imprecise if you specified a point that's "wrapped around" the globe more than 15,069° ÷ 360° = 41,8583… times) or simply a arbitrary limit (i.e. they thought noone will need to be able to construct a spiral that goes around the globe more than approx. 42 times).
Let's repeat the above thought experiment: What does LINESTRING (0 90, 0 -90)
mean?
A line going around half the globe along the prime meridian in a southward direction.
A line going around half the globe along the prime meridian in a northward direction.
A line of length 0.
We can rule out (3), since POINT (0 90)
and POINT (0 -90)
are distinct points: namely, the north pole and the south pole. A line going from one to the other definitely does not have zero length.
We can also rule out (2), simply because it does not make any sense to say "going northward" when starting at the north pole. You can only stay there, or go south, which is already covered by (1).
So we end up unambiguously with (1). The reason, therefore, why latitude was restricted to the geographically meaningful [-90°..+90°] is because there is never any ambiguity when modelling lines that touch or cross the geographic poles. This is because there are no sudden degree "jumps" like there are with longitude (where one and the same meridian is described both by -180° and +180°).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With