r65787 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65786‎ | r65787 | r65788 >
Date:06:18, 2 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.6 - teweaked coordinate stuff
Modified paths:
  • /trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_QueryPrinters.php (modified) (history)
  • /trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoords.php (modified) (history)
  • /trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValue.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValue.php
@@ -79,14 +79,15 @@
8080 */
8181 public function getQueryDescription( $value ) {
8282 // TODO
 83+ return parent::getQueryDescription( $value );
8384 }
8485
8586 /**
8687 * @see SMWDataValue::parseDBkeys
8788 */
8889 protected function parseDBkeys( $args ) {
89 - $this->mCoordinateSet['lat'] = $args[0];
90 - $this->mCoordinateSet['lon'] = $args[1];
 90+ $this->mCoordinateSet['lat'] = $args['lat'];
 91+ $this->mCoordinateSet['lon'] = $args['lon'];
9192
9293 $this->m_caption = MapsCoordinateParser::formatCoordinates( $this->mCoordinateSet );
9394 $this->mWikivalue = $this->m_caption;
@@ -97,8 +98,19 @@
9899 */
99100 public function getDBkeys() {
100101 $this->unstub();
101 - return array( $this->mCoordinateSet['lat'], $this->mCoordinateSet['lon'] );
 102+
 103+ return array(
 104+ 'lat' => $this->mCoordinateSet['lat'],
 105+ 'lon' => $this->mCoordinateSet['lon']
 106+ );
102107 }
 108+
 109+ /**
 110+ * @see SMWDataValue::getSignature
 111+ */
 112+ public function getSignature() {
 113+ return 'ff';
 114+ }
103115
104116 /**
105117 * @see SMWDataValue::getShortWikiText
Index: trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoords.php
@@ -60,6 +60,9 @@
6161 $south = $dbs->addQuotes( $boundingBox['south'] );
6262 $west = $dbs->addQuotes( $boundingBox['west'] );
6363
 64+ // TODO: The field names are hardcoded in, since SMW offers no support for selection based on multiple fields.
 65+ // Ideally SMW's setup should be changed to allow for this. Now the query can break when other extensions
 66+ // add their own semantic tables with similar signatures.
6467 $whereSQL .= "{$tablename}.lat < $north && {$tablename}.lat > $south && {$tablename}.lon < $east && {$tablename}.lon > $west";
6568
6669 return true;
Index: trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_QueryPrinters.php
@@ -170,5 +170,4 @@
171171 }
172172 }
173173
174 -
175174 }
\ No newline at end of file

Status & tagging log