CloudSide / geohash

Geohash generation class for php
http://weibo.com/smcz
261 stars 109 forks source link

Uninitialized string offset: -1 #1

Open qinzhe opened 8 years ago

qinzhe commented 8 years ago

PHP Notice: Uninitialized string offset: -1 in /home/server/gochat/geohash.class.php on line 110 PHP Warning: strpos(): Empty needle in /home/server/gochat/geohash.class.php on line 114 PHP Warning: strpos(): Empty needle in /home/server/gochat/geohash.class.php on line 119 PHP Notice: String offset cast occurred in /home/server/gochat/geohash.class.php on line 119

Hkesd commented 7 years ago

这个问题解决了吗?

seebyyu commented 6 years ago
  1. line 27 public function Geohash() public function __construct()
  2. line 110 if (strpos($this->borders[$dir][$type], $lastChr) !== false) if (strpos($this->borders[$dir][$type], $lastChr) !== false && !empty($base))
xuekang commented 9 months ago

参数顺序可能有问题,注意调用encode经纬度传参顺序

xuekang commented 9 months ago

sql优化建议:SELECT * FROM address WHERE LEFT(geohash,5) IN ('wm6n0','wm6j8','wm6jc','wm3vz','wm3yp','wm6n1','wm6j9','wm3vx','wm6jb')