Index: trunk/extensions/gis/transversemercator.php |
— | — | @@ -252,16 +252,16 @@ |
253 | 253 | } |
254 | 254 | |
255 | 255 | $northing = $this->Northing_Offset + $this->Scale * |
256 | | - ( ($M - $M0) + $v*tan($lat_rad) * |
257 | | - ( $A*$A/2 |
| 256 | + ( ($M - $M0) + $v*tan($lat_rad) * |
| 257 | + ( $A*$A/2 |
258 | 258 | + (5 - $T + 9*$C + 4*$C*$C) * pow($A,4)/24 |
259 | | - + (61 - 58*$T + $T*$T |
| 259 | + + (61 - 58*$T + $T*$T |
260 | 260 | + 600*$C - 330*$e_prime_sq) * pow($A,6)/720 )); |
261 | 261 | |
262 | 262 | $easting = $this->Easting_Offset + $this->Scale * $v * |
263 | | - ( $A |
| 263 | + ( $A |
264 | 264 | + (1-$T+$C)*pow($A,3)/6 |
265 | | - + (5 - 18*$T + pow($T,2) + 72*$C |
| 265 | + + (5 - 18*$T + pow($T,2) + 72*$C |
266 | 266 | - 58 * $e_prime_sq)*pow($A,5)/120 ); |
267 | 267 | |
268 | 268 | # FIXME: Use zone_letter |
Index: trunk/extensions/gis/GeoParam.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | * |
10 | 10 | * include( "extensions/gis/geo.php" ); |
11 | 11 | * |
12 | | - * If $wgMapsourcesURL is not defined, there will not be links to the |
| 12 | + * If $wgMapsourcesURL is not defined, there will not be links to the |
13 | 13 | * "Map sources" page, but the geo tag will still be rendered. |
14 | 14 | * |
15 | 15 | * To add the points to a database, see the gis/geodb extension |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | $this->londeg_min = $this->londeg_max = $this->londeg; |
125 | 125 | $this->updateInternal(); |
126 | 126 | |
127 | | - |
| 127 | + |
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
— | — | @@ -201,7 +201,7 @@ |
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
205 | | - * Given decimal degrees, convert to |
| 205 | + * Given decimal degrees, convert to |
206 | 206 | * minutes, seconds and direction |
207 | 207 | */ |
208 | 208 | function make_minsec( $deg ) { |
— | — | @@ -215,7 +215,7 @@ |
216 | 216 | # Round to a suitable number of digits |
217 | 217 | # FIXME: should reflect precision |
218 | 218 | $deg = round($deg, 6); |
219 | | - $min = 60.0 * (abs($deg) - intval(abs($deg))); |
| 219 | + $min = 60.0 * (abs($deg) - intval(abs($deg))); |
220 | 220 | $min = round($min, 4); |
221 | 221 | $sec = 60.0 * ($min - intval($min)); |
222 | 222 | $sec = round($sec, 2); |
— | — | @@ -317,13 +317,13 @@ |
318 | 318 | * Produce markup suitable for use in page |
319 | 319 | * Use original content as much as possible |
320 | 320 | */ |
321 | | - function get_markup() |
| 321 | + function get_markup() |
322 | 322 | { |
323 | 323 | $n = count($this->coor); |
324 | 324 | |
325 | 325 | if ($n == 0) { |
326 | 326 | # Range is special case |
327 | | - return $this->make_position( $this->latdeg_min, |
| 327 | + return $this->make_position( $this->latdeg_min, |
328 | 328 | $this->londeg_min ) |
329 | 329 | . " to " |
330 | 330 | . $this->make_position( $this->latdeg_max, |
— | — | @@ -335,7 +335,7 @@ |
336 | 336 | $this->coor['latdeg'].'° '. $this->coor['latns'], |
337 | 337 | $this->coor['londeg'].'° '. $this->coor['lonew'] ); |
338 | 338 | } elseif ($n == 6) { |
339 | | - return $this->getMicroformat( |
| 339 | + return $this->getMicroformat( |
340 | 340 | $this->coor['latdeg'].'°'. $this->coor['latmin'].'′ '. |
341 | 341 | $this->coor['latns'], |
342 | 342 | $this->coor['londeg'].'°'. $this->coor['lonmin'].'′ '. |
— | — | @@ -358,5 +358,3 @@ |
359 | 359 | '">' . $lon . '</abbr></span>'; |
360 | 360 | } |
361 | 361 | } |
362 | | - |
363 | | - |
Index: trunk/extensions/gis/Geo.alias.php |
— | — | @@ -0,0 +1,11 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Aliases for special pages |
| 5 | + * |
| 6 | + */ |
| 7 | + |
| 8 | +$aliases = array(); |
| 9 | + |
| 10 | +$aliases['en'] = array( |
| 11 | + 'Geo' => array( 'Geo' ), |
| 12 | +); |
Property changes on: trunk/extensions/gis/Geo.alias.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 13 | + native |
Added: svn:keywords |
2 | 14 | + Id |
Index: trunk/extensions/gis/gissettings.php |
— | — | @@ -4,5 +4,3 @@ |
5 | 5 | # different! |
6 | 6 | |
7 | 7 | $wikibasedir = "../.."; |
8 | | - |
9 | | - |
Index: trunk/extensions/gis/maparea.php |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | } |
133 | 133 | return $out; |
134 | 134 | } |
135 | | - |
| 135 | + |
136 | 136 | function map_pos( $lat, $lon ) |
137 | 137 | { |
138 | 138 | # |
— | — | @@ -158,4 +158,3 @@ |
159 | 159 | return $out; |
160 | 160 | } |
161 | 161 | } |
162 | | - |
Index: trunk/extensions/gis/GisDatabase.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | /** |
58 | 58 | * Add a position to the database |
59 | 59 | */ |
60 | | - function add_position( $id, $latmin, $lonmin, |
| 60 | + function add_position( $id, $latmin, $lonmin, |
61 | 61 | $latmax, $lonmax, $globe, $type, $type_arg ) |
62 | 62 | { |
63 | 63 | $fname = 'GisDatabase::add_position'; |
— | — | @@ -115,9 +115,9 @@ |
116 | 116 | * Select entities belonging to or overlapping an area |
117 | 117 | * Also select by globe and type if specified |
118 | 118 | */ |
119 | | - function select_area( $latmin, $lonmin, $latmax, $lonmax, |
| 119 | + function select_area( $latmin, $lonmin, $latmax, $lonmax, |
120 | 120 | $globe, $type, $type_arg ) |
121 | | - { |
| 121 | + { |
122 | 122 | if (!$globe) $globe = ""; |
123 | 123 | |
124 | 124 | $condition = "gis_globe = '" . $globe . "'"; |
— | — | @@ -160,7 +160,7 @@ |
161 | 161 | 'gis_longitude_min', |
162 | 162 | 'gis_longitude_max', |
163 | 163 | 'gis_globe', |
164 | | - 'gis_type', |
| 164 | + 'gis_type', |
165 | 165 | 'gis_type_arg', |
166 | 166 | 'page_title', |
167 | 167 | 'page_namespace' ), |
— | — | @@ -176,4 +176,3 @@ |
177 | 177 | return $this->db->fetchObject ( $this->result ); |
178 | 178 | } |
179 | 179 | } |
180 | | - |
Index: trunk/extensions/gis/README |
— | — | @@ -1,12 +1,12 @@ |
2 | | -The GIS extension is based on the experience learned from WikiProject |
| 2 | +The GIS extension is based on the experience learned from WikiProject |
3 | 3 | Geographical coordinates. The extensions can be enabled individually, but |
4 | | -the concept is certainly more powerful when they are all enabled. |
| 4 | +the concept is certainly more powerful when they are all enabled. |
5 | 5 | |
6 | 6 | For more information, please see: |
7 | 7 | http://meta.wikimedia.org/wiki/Gis |
8 | 8 | http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Geographical_coordinates |
9 | 9 | |
10 | | -Magnus Manske has been extremely helpful in the work on integration with |
| 10 | +Magnus Manske has been extremely helpful in the work on integration with |
11 | 11 | Wikimaps, and that work will continue. I would also like to give a big thank |
12 | 12 | you to all participants in WikiProject Geographical coordinates who have |
13 | 13 | helped immensely with suggestions practical work. |
Index: trunk/extensions/gis/geo.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | * |
10 | 10 | * include( "extensions/gis/geo.php" ); |
11 | 11 | * |
12 | | - * If $wgMapsourcesURL is not defined, there will not be links to the |
| 12 | + * If $wgMapsourcesURL is not defined, there will not be links to the |
13 | 13 | * "Map sources" page, but the geo tag will still be rendered. |
14 | 14 | * |
15 | 15 | * To add the points to a database, see the gis/geodb extension |
— | — | @@ -37,11 +37,10 @@ |
38 | 38 | */ |
39 | 39 | |
40 | 40 | if ( !defined( 'MEDIAWIKI' ) ) { |
41 | | - echo "Geo extension\n"; |
42 | | - exit( 1 ) ; |
| 41 | + echo "Geo extension\n"; |
| 42 | + exit( 1 ) ; |
43 | 43 | } |
44 | 44 | |
45 | | - |
46 | 45 | $wgExtensionFunctions[] = "wfGeoExtension"; |
47 | 46 | |
48 | 47 | /** |
— | — | @@ -54,28 +53,27 @@ |
55 | 54 | $wgHooks['ArticleDelete'][] = 'articleDeleteGeo'; |
56 | 55 | } |
57 | 56 | |
58 | | -if ( !function_exists( 'extAddSpecialPage' ) ) { |
59 | | - require( dirname(__FILE__) . '/../ExtensionFunctions.php' ); |
60 | | -} |
61 | | -extAddSpecialPage( dirname(__FILE__) . '/Specialgeo_body.php', 'Geo', 'GeoPage' ); |
62 | | - |
63 | 57 | $wgExtensionCredits['specialpage'][] = array( |
64 | 58 | 'name' => 'Geo', |
65 | 59 | 'description' => 'Enables rich geotagging functionality', |
66 | | - 'author' => 'Egil Kvaleberg, Jens Frank' |
| 60 | + 'author' => array( 'Egil Kvaleberg', 'Jens Frank' ), |
67 | 61 | ); |
68 | 62 | |
69 | | -global $wgAutoloadClasses; |
70 | | -$wgAutoloadClasses['GeoParam'] = dirname(__FILE__) . '/GeoParam.php'; |
71 | | -$wgAutoloadClasses['GisDatabase'] = dirname(__FILE__) . '/GisDatabase.php'; |
| 63 | +$dir = dirname(__FILE__) . '/'; |
| 64 | +$wgExtensionAliasesFiles['Geo'] = $dir . 'Geo.alias.php'; |
| 65 | +$wgAutoloadClasses['SpecialGeo'] = $dir . 'Specialgeo_body.php'; |
| 66 | +$wgSpecialPages['Geo'] = 'SpecialGeo'; |
72 | 67 | |
| 68 | +$wgAutoloadClasses['GeoParam'] = $dir . 'GeoParam.php'; |
| 69 | +$wgAutoloadClasses['GisDatabase'] = $dir . 'GisDatabase.php'; |
73 | 70 | |
| 71 | + |
74 | 72 | /** |
75 | 73 | * Hook function called every time a page is saved |
76 | 74 | * Use the ArticleSaveComplete instead of ArticleSave since the ID is |
77 | 75 | * not available upon ArticleSave for new articles |
78 | 76 | */ |
79 | | -function articleSaveGeo ( $article, $user, $text ) |
| 77 | +function articleSaveGeo ( $article, $user, $text ) |
80 | 78 | { |
81 | 79 | $id = $article->getID(); |
82 | 80 | |
— | — | @@ -92,7 +90,7 @@ |
93 | 91 | $content = $tagresult[1]; |
94 | 92 | $params = $tagresult[2]; |
95 | 93 | $full = $tagresult[3]; |
96 | | - |
| 94 | + |
97 | 95 | if ( $tagname != 'geo' ) { |
98 | 96 | continue; |
99 | 97 | } |
— | — | @@ -112,7 +110,7 @@ |
113 | 111 | /** |
114 | 112 | * Hook function called every time a page is deleted |
115 | 113 | */ |
116 | | -function articleDeleteGeo ( $article ) |
| 114 | +function articleDeleteGeo ( $article ) |
117 | 115 | { |
118 | 116 | $id = $article->getID(); |
119 | 117 | |
— | — | @@ -160,5 +158,3 @@ |
161 | 159 | return $skin->makeKnownLink( 'Special:Geo', $geo->get_markup(), $geo->get_param_string() ); |
162 | 160 | |
163 | 161 | } |
164 | | - |
165 | | - |
Index: trunk/extensions/gis/neighbors.php |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | var $title; |
40 | 40 | var $attr; |
41 | 41 | |
42 | | - function neighbors( $dist ) |
| 42 | + function neighbors( $dist ) |
43 | 43 | { |
44 | 44 | $this->p = new GeoParam(); |
45 | 45 | $this->d = $dist; |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | $this->attr = $this->p->get_attr(); |
49 | 49 | } |
50 | 50 | |
51 | | - function show() |
| 51 | + function show() |
52 | 52 | { |
53 | 53 | global $wgOut, $wgUser, $wgContLang; |
54 | 54 | |
— | — | @@ -74,7 +74,10 @@ |
75 | 75 | |
76 | 76 | $g = new GisDatabase(); |
77 | 77 | $g->select_radius_m( $lat0, $lon0, $this->d * 1000, |
| 78 | + // FIXME: Notice: Undefined index: globe in extensions\gis\neighbors.php on line 79 |
| 79 | + // FIXME: Notice: Undefined index: type in extensions\gis\neighbors.php on line 79 |
78 | 80 | $this->attr['globe'], $this->attr['type'], |
| 81 | + // FIXME: Notice: Undefined index: arg:type in extensions\gis\neighbors.php on line 81 |
79 | 82 | $this->attr['arg:type'] ); |
80 | 83 | $all = array(); |
81 | 84 | $all_pos = array(); /* temporary store reqd due to sort */ |
— | — | @@ -120,7 +123,7 @@ |
121 | 124 | } |
122 | 125 | return "$out\n<table class=\"gisneighbourtable\">$table</table>\n"; |
123 | 126 | } |
124 | | - |
| 127 | + |
125 | 128 | function show_location( $id, $d, $pos ) |
126 | 129 | { |
127 | 130 | $id = $pos->gis_page; |
— | — | @@ -128,7 +131,7 @@ |
129 | 132 | $out = "<tr><th>[[{$pos['name']}]]</th>"; |
130 | 133 | |
131 | 134 | $type = $pos['type']; |
132 | | - |
| 135 | + |
133 | 136 | $out .= "<td>$type</td>"; |
134 | 137 | if ($d < 1000) { |
135 | 138 | $out .= '<td>'.round($d).' m</td>'; |
— | — | @@ -150,4 +153,3 @@ |
151 | 154 | . "</td></tr>\r\n"; |
152 | 155 | } |
153 | 156 | } |
154 | | - |
Index: trunk/extensions/gis/mapsources.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | $wgOut->setPagetitle( $this->mapsources ); |
58 | 58 | $wgOut->addWikiText( $this->build_output() ); |
59 | 59 | } |
60 | | - |
| 60 | + |
61 | 61 | function build_output() { |
62 | 62 | global $wgOut, $wgUser, $wgContLang, $wgRequest; |
63 | 63 | |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | 'landmark' => 10000 # 10 thousand |
91 | 91 | ); |
92 | 92 | |
93 | | - $attr['default'] = |
| 93 | + $attr['default'] = |
94 | 94 | $default_scale[$attr['type']]; |
95 | 95 | # FIXME: Scale according to city size, if available |
96 | 96 | } |
— | — | @@ -139,7 +139,7 @@ |
140 | 140 | |
141 | 141 | /* |
142 | 142 | * MSN uses an altitude equivalent |
143 | | - * instead of a scale: |
| 143 | + * instead of a scale: |
144 | 144 | * 143 == 1:1000000 scale |
145 | 145 | */ |
146 | 146 | $altitude = intval( $attr['scale'] * 143/1000000 ); |
— | — | @@ -226,7 +226,7 @@ |
227 | 227 | /* |
228 | 228 | * Replace in page |
229 | 229 | */ |
230 | | - $search = array( |
| 230 | + $search = array( |
231 | 231 | "{latdegdec}", "{londegdec}", |
232 | 232 | "{londegneg}", "{latdegint}", |
233 | 233 | "{londegint}", "{latdegabs}", |
— | — | @@ -289,5 +289,3 @@ |
290 | 290 | return str_replace( $search, $replace, $bstext ); |
291 | 291 | } |
292 | 292 | } |
293 | | - |
294 | | - |
Index: trunk/extensions/gis/kml.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | * Support the "Map sources" list mechanism, see also: |
5 | 5 | * http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Geographical_coordinates |
6 | 6 | * |
7 | | - * This extension was designed to work together with the geo tag |
| 7 | + * This extension was designed to work together with the geo tag |
8 | 8 | * extension (geo.php). It can be useful in its own right also, but |
9 | 9 | * class GeoParam from geo.php needs to be avalibale |
10 | 10 | * |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | require_once( "{$wikibasedir}/includes/Setup.php" ); |
48 | 48 | require_once( "geo.php" ); |
49 | 49 | } |
50 | | - |
| 50 | + |
51 | 51 | require_once( "mapsources.php"); |
52 | 52 | require_once( "neighbors.php"); |
53 | 53 | require_once( "maparea.php"); |
— | — | @@ -119,5 +119,3 @@ |
120 | 120 | } |
121 | 121 | |
122 | 122 | exit ( 0 ) ; |
123 | | - |
124 | | -?> |
Index: trunk/extensions/gis/greatcircle.php |
— | — | @@ -91,4 +91,3 @@ |
92 | 92 | /* Assumes Earth radius of 6366.71 km */ |
93 | 93 | } |
94 | 94 | } |
95 | | - |
Index: trunk/extensions/gis/Specialgeo_body.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | * Support the "Map sources" list mechanism, see also: |
5 | 5 | * http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Geographical_coordinates |
6 | 6 | * |
7 | | - * This extension was designed to work together with the geo tag |
| 7 | + * This extension was designed to work together with the geo tag |
8 | 8 | * extension (geo.php). It can be useful in its own right also, but |
9 | 9 | * class GeoParam from geo.php needs to be avalibale |
10 | 10 | * |
— | — | @@ -36,21 +36,14 @@ |
37 | 37 | exit( 1 ); |
38 | 38 | } |
39 | 39 | |
40 | | -# Add messages |
41 | | -global $wgMessageCache, $wgDesysopMessages; |
42 | | -// !JF1 |
43 | | -/* |
44 | | -foreach( $wgDesysopMessages as $key => $value ) { |
45 | | - $wgMessageCache->addMessages( $wgDesysopMessages[$key], $key ); |
46 | | -} |
47 | | -*/ |
48 | 40 | require_once('mapsources.php'); |
49 | 41 | |
50 | | -class GeoPage extends SpecialPage { |
51 | | - function __construct() { |
52 | | - parent::__construct( 'Geo', 'geo' ); |
53 | | - } |
| 42 | +class SpecialGeo extends SpecialPage { |
54 | 43 | |
| 44 | + function __construct() { |
| 45 | + parent::__construct( 'Geo', 'geo' ); |
| 46 | + } |
| 47 | + |
55 | 48 | function execute( $subpage ) { |
56 | 49 | global $wgOut, $wgRequest, $wgCookiePrefix; |
57 | 50 | $params = $wgRequest->getValues(); |
— | — | @@ -73,7 +66,7 @@ |
74 | 67 | } |
75 | 68 | unset( $params['subaction'] ); |
76 | 69 | unset( $params[$wgCookiePrefix.'_session'] ); |
77 | | - |
| 70 | + |
78 | 71 | foreach ( $params as $key => $val ) { |
79 | 72 | $wgOut->addHTML( "<input type=\"hidden\" name=\"$key\" value=\"$val\">\n" ); |
80 | 73 | } |
— | — | @@ -95,29 +88,3 @@ |
96 | 89 | } |
97 | 90 | } |
98 | 91 | } |
99 | | -/* |
100 | | -global $wgRequest; |
101 | | - |
102 | | -if ( isset ( $_GET['geo'] ) ) { |
103 | | - $geo = $wgRequest->getVal( 'geo' ); |
104 | | - $title = $wgRequest->getVal( 'title' ); |
105 | | - $bsl = new map_sources( $geo, $title ); |
106 | | - $bsl->show(); |
107 | | -} else if ( isset ( $_GET['near'] ) ) { |
108 | | - $near = $wgRequest->getVal( 'near' ); |
109 | | - $dist = $wgRequest->getVal( 'dist' ); |
110 | | - $title = $wgRequest->getVal( 'title' ); |
111 | | - $bsl = new neighbors( $near, $dist, $title ); |
112 | | - $bsl->show(); |
113 | | -} else if ( isset ( $_GET['maparea'] ) ) { |
114 | | - $maparea = $wgRequest->getVal( 'maparea' ); |
115 | | - $action = $wgRequest->getVal( 'action' ); |
116 | | - $bsl = new maparea( $maparea ); |
117 | | - $bsl->show( $action ); |
118 | | -} else if ( isset ( $_GET['version'] ) ) { |
119 | | - $bsl = new gis_version( ); |
120 | | - $bsl->show(); |
121 | | -} |
122 | | - |
123 | | -*/ |
124 | | - |
Index: trunk/extensions/gis/gisversion.php |
— | — | @@ -39,20 +39,20 @@ |
40 | 40 | |
41 | 41 | $wgOut->setPagetitle( "Version" ); |
42 | 42 | $wgOut->addHTML( ' |
43 | | - <p><b><a href="http://www.mediawiki.org/">MediaWiki</a></b> |
| 43 | + <p><b><a href="http://www.mediawiki.org/">MediaWiki</a></b> |
44 | 44 | <a href="http://meta.wikimedia.org/wiki/Gis">GIS extension</a>, |
45 | 45 | copyright (C) 2005 by Egil Kvaleberg.</p> |
46 | | - |
| 46 | + |
47 | 47 | <p>The GIS extension is free software; you can redistribute it and/or modify |
48 | 48 | it under the terms of the GNU General Public License as published by |
49 | 49 | the Free Software Foundation; either version 2 of the License, or |
50 | 50 | (at your option) any later version.</p> |
51 | | - |
| 51 | + |
52 | 52 | <p>The GIS extension is distributed in the hope that it will be useful, |
53 | 53 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
54 | 54 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
55 | 55 | GNU General Public License for more details.</p> |
56 | | - |
| 56 | + |
57 | 57 | <p>You should have received <a href="../COPYING">a copy of the GNU General Public License</a> |
58 | 58 | along with this program; if not, write to the Free Software |
59 | 59 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
— | — | @@ -64,5 +64,3 @@ |
65 | 65 | $wgOut->addWikiText( $out ); |
66 | 66 | } |
67 | 67 | } |
68 | | - |
69 | | - |