Index: trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValue.php |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | $distance = count( $parts ) > 0 ? trim( array_shift( $parts ) ) : false; |
90 | 90 | |
91 | 91 | if ( $distance !== false ) { |
92 | | - if ( preg_match( '/^\d+(\.\d+)?(\s.+)?\)$/', $distance ) ) { |
| 92 | + if ( preg_match( '/^!?\d+(\.\d+)?(\s.+)?\)$/', $distance ) ) { |
93 | 93 | $distance = substr( $distance, 0, -1 ); |
94 | 94 | } |
95 | 95 | else { |
Index: trunk/extensions/SemanticMaps/GeoCoords/SM_AreaValueDescription.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | protected $mBounds = false; |
30 | 30 | |
31 | 31 | public function __construct( SMGeoCoordsValue $dataValue, $comparator, $radius ) { |
32 | | - parent::__construct( $dataValue ); |
| 32 | + parent::__construct( $dataValue, $comparator ); |
33 | 33 | |
34 | 34 | // Parse the radius to the actual value and the optional unit. |
35 | 35 | $radius = preg_replace('/\s\s+/', ' ', $radius); |
— | — | @@ -156,7 +156,7 @@ |
157 | 157 | ) { |
158 | 158 | return false; |
159 | 159 | } |
160 | | - |
| 160 | + |
161 | 161 | $boundingBox = $this->getBounds(); |
162 | 162 | |
163 | 163 | $north = $dbs->addQuotes( $boundingBox['north'] ); |
— | — | @@ -166,8 +166,9 @@ |
167 | 167 | |
168 | 168 | $isEq = $this->getComparator() == SMW_CMP_EQ; |
169 | 169 | |
170 | | - $smallerThen = $isEq ? '<' : '>'; |
171 | | - $biggerThen = $isEq ? '>' : '<'; |
| 170 | + $smallerThen = $isEq ? '<' : '>='; |
| 171 | + $biggerThen = $isEq ? '>' : '<='; |
| 172 | + $joinCond = $isEq ? '&&' : '||'; |
172 | 173 | |
173 | 174 | // TODO: Would be safer to have a solid way of determining what's the lat and lon field, instead of assuming it's in this order. |
174 | 175 | $conditions = array(); |
— | — | @@ -176,6 +177,6 @@ |
177 | 178 | $conditions[] = "{$tableName}.lon $smallerThen $east"; |
178 | 179 | $conditions[] = "{$tableName}.lon $biggerThen $west"; |
179 | 180 | |
180 | | - return implode( ' && ', $conditions ); |
| 181 | + return implode( " $joinCond ", $conditions ); |
181 | 182 | } |
182 | 183 | } |
\ No newline at end of file |