Why does SQL Server GEOGRAPHY allow longitudes between -15069° and +15069°? Why ±15069°? -


i using microsoft.sqlserver.types dll in projects validating latitudes , longitudes.

the library validates longitude values between -15069 , 15069 degrees instead -180 180. can explain significance or reason microsoft checking longitude values between -15069 , 15069 degrees?

microsoft has listed standards geo spatial standards on website mentions longitude values must between -15069 , 15069 degrees, inclusive.

https://msdn.microsoft.com/en-us/library/ee301753(v=sql.105).aspx

your inputs in understanding concept appreciated!

why longitude not restricted [-180°..+180°]?

here's brief thought experiment. of following 3 lines linestring (-180 0, 180 0) represent?

  1. a line going around whole globe along equator in eastward direction.

  2. a line going around whole globe along equator in westward direction.

  3. a line of length 0, since -180° latitude denotes same meridian +180° latitude.

as decide on of 3 possibilities, find have no way of modelling other 2 cases linestring (try it!)… @ least not when restrict longitude (geographically correct) interval [-180°..+180°]!

let's see happens when relax restriction:

  • the line going around globe in eastward direction can modelled linestring (-180 0, 180 0). (this seems match our expectations, since increasing degrees of longitude means "going eastward".)

  • the line going around globe in westward direction 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".)

yes, why did chose ±15069 degrees?

that, cannot say. might have floating-point precision (i.e. spatial computations becoming imprecise if specified point that's "wrapped around" globe more 15,069° ÷ 360° = 41,8583… times) or arbitrary limit (i.e. thought noone need able construct spiral goes around globe more approx. 42 times).

why latitude restricted [-90°..+90°], if longitude wasn't restricted?

let's repeat above thought experiment: linestring (0 90, 0 -90) mean?

  1. a line going around half globe along prime meridian in southward direction.

  2. a line going around half globe along prime meridian in northward direction.

  3. a line of length 0.

we can rule out (3), since point (0 90) , point (0 -90) distinct points: namely, north pole , south pole. line going 1 other not have 0 length.

we can rule out (2), because not make sense "going northward" when starting @ north pole. can stay there, or go south, covered (1).

so end unambiguously (1). reason, therefore, why latitude restricted geographically meaningful [-90°..+90°] because there never ambiguity when modelling lines touch or cross geographic poles. because there no sudden degree "jumps" there longitude (where 1 , same meridian described both -180° , +180°).


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -