Difference between revisions of "-0 Issue"

From Geohashing
imported>Gissehel
imported>JesseW
(categorize)
 
(10 intermediate revisions by 7 users not shown)
Line 1: Line 1:
'''This issue is closed as the official tool has been updated and the most "algebric notation" pages looks to be updated to use "-0 notation".''' Page kept as history and explanation of the notations.
+
'''This issue is closed as the official tool has been updated and most "algebric notation" pages look to be updated to use "-0 notation."''' Page kept as history and explanation of the notations.
  
 
----
 
----
  
Granicule longitudes and lattitudes are indexes that look like relative integers. They are minimal value of all the points in the graticule if the values are positive, and they are the maximal value of all the points in the graticule if the values are negative.  
+
Graticule longitudes and latitudes are indexes that look like relative integers. They are the minimal value of all the points in the graticule if the values are positive, and they are the maximal value of all the points in the graticule if the values are negative.  
  
  
So (-23.452365°,16.415222°) is located in the Ganicule [[-23,16]].
+
So (-23.452365°,16.415222°) is located in the Graticule [[-23,16]].
  
And (23.452365°,-16.415222°) is located in the Ganicule [[23,-16]].
+
And (23.452365°,-16.415222°) is located in the Graticule [[23,-16]].
  
  
 
With this notation, 0 and -0 are different values (this rule will be called "-0 notation").
 
With this notation, 0 and -0 are different values (this rule will be called "-0 notation").
  
== Issue with the official tool ==
+
[[Category:Algorithm]]
 
 
'''UPDATE''' - the official tool now does accept -0. -- Zig.
 
 
 
The official tool doesn't accept -0 as an input, which make it difficult to make automatic templates for graticules x -0 or -0 x.
 
 
 
The official tool can use "abs" to work this around. If given abs=1 on the url, the official tool will consider the values as being south/west coordinate of the graticule (while this only true for positive lattitude and longitude). (This rule will be called "algebric notation")
 
 
 
But this workaround doesn't work for the <code>&lt;map</code>...<code>/&gt;</code> element, because the map element doesn't take the abs.
 
 
 
The xkcd.js of the official tool can be changed to take -0 as input.
 
 
 
Current code :
 
 
 
  if (qsParm['abs'] != 1) {
 
    if (qsParm['long'] < 0) qsParm['long']--;
 
    if (qsParm['lat'] < 0) qsParm['lat']--;
 
  }
 
 
 
New code :
 
 
 
  if (qsParm['abs'] != 1) {
 
    if (qsParm['long'] == "-0") {
 
      qsParm['long']=-1;
 
    } else if (qsParm['long'] < 0) {
 
      qsParm['long']--;
 
    }
 
    if (qsParm['lat'] == "-0") {
 
      qsParm['lat']=-1;
 
    } else if (qsParm['lat'] < 0) {
 
      qsParm['lat']--;
 
    }
 
  }
 
 
 
This has been applied [[User:Zigdon|Zigdon]] 16:32, 25 May 2008 (UTC)
 
 
 
Another workaround, involving -360 instead of -0 is described in [[Template_talk:Graticule/-0_long_workaround_in_action]]
 
 
 
== Issue with the [[Active Graticules]]'s page ==
 
 
 
The "abs workaround" leeds the [[Active Graticules]]'s page into chaos. While most of the graticules use the "-0 notation" (example [[Boston]] is refered as 42 -71), United kingdom mostly use the "algebric notation" (example [[Swindon, United Kingdom|Swindon]] is refered as 51 -2).
 
 
 
This inconsistency leeds to wrong labels in the official tool.
 

Latest revision as of 05:07, 22 May 2012

This issue is closed as the official tool has been updated and most "algebric notation" pages look to be updated to use "-0 notation." Page kept as history and explanation of the notations.


Graticule longitudes and latitudes are indexes that look like relative integers. They are the minimal value of all the points in the graticule if the values are positive, and they are the maximal value of all the points in the graticule if the values are negative.


So (-23.452365°,16.415222°) is located in the Graticule -23,16.

And (23.452365°,-16.415222°) is located in the Graticule 23,-16.


With this notation, 0 and -0 are different values (this rule will be called "-0 notation").