Lines Matching refs:geohash
40 * entries should be: array("geohash" => {"id1","id3",})
116 $geohash = $geometry->out('geohash');
117 Logger::debug('Update index for geohash: ' . $geohash);
118 return $this->addToIndex($geohash, $id);
124 * @param string $geohash
129 private function addToIndex(string $geohash, string $id): bool
132 // check index for key/geohash
133 if (!array_key_exists($geohash, $this->spatial_idx)) {
134 Logger::debug("Geohash $geohash not in index, just add $id.");
142 $pageIds = $this->spatial_idx [$geohash];
148 if ($knownHash === $geohash) {
149 Logger::debug("Document $id was found in index and has the same geohash, nothing to do.");
154 Logger::debug("Document/media $id was found in index but has different geohash (it moved).");
157 // remove it from the old geohash element
162 // set on new geohash element
163 $pageIds = $this->spatial_idx[$geohash];
168 $this->spatial_idx [$geohash] = $pageIds;
173 * Looks up the geohash(es) for the document in the index.
226 $geohash = $geometry->out('geohash');
227 // TODO truncate the geohash to something reasonable, otherwise they are
230 return $this->addToIndex($geohash, 'media__' . $imgId);