1 / 15
文档名称:

geohash算法的php,python,java,Csharp版本源码php.doc

格式:doc   大小:40KB   页数:15页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

geohash算法的php,python,java,Csharp版本源码php.doc

上传人:学习的一点 2021/7/25 文件大小:40 KB

下载得到文件列表

geohash算法的php,python,java,Csharp版本源码php.doc

文档介绍

文档介绍:geohash算法的php,python,java,Csharp版本源码php

<?php
/**
* Geohash generation class
* /
*
* This file copyright (C) 2008 Paul Dixon (******@)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*//**
* Encode and decode geohashes
*
*/
class Geohash
{
private $coding="0123456789bcdefghjkmnpqrstuvwxyz";
private $codingMap=array();

public function Geohash()
{
//build map from encoding char to 0 padded bitfield
for($i=0; $i<32; $i++)
{
$this->codingMap[substr($this->coding,$i,1)]=str_pad(decbin($i), 5, "0", STR_PAD_LEFT);
}

}

/**
* Decode a geohash and return an array with decimal lat,long in it
*/
public function decode($hash)
{
//decode hash into binary string
$binary="";
$hl=strlen($hash);
for($i=0; $i<$hl; $i++)
{
$binary.=$this->codingMap[substr($hash,$i,1)];
}

//split the binary into lat and log binary strings
$bl=strlen($binary);
$blat="";
$blong="";
for ($i=0; $i<$bl; $i++)
{
if ($i%2)
$blat=$($binary,$i,1);

最近更新

道砟销售协议范本 18页

道砟材料采购合同3篇 46页

2025年小学四年级语文《和我们一样享受春天》.. 11页

轻巧的拍摄技巧 2页

二零二五年度电子商务平台建设技术咨询合同 3页

鸿门宴优秀课件ppt 18页

辽宁省丹东市博阳中学高一化学期末试题含解析.. 6页

辽宁省丹东市凤城朝鲜族中学2020-2021学年高三.. 10页

二零二五年度畜禽粪便处理企业鸡粪采购合同范.. 2页

辽宁省丹东市朝鲜中学2021-2022学年高二数学理.. 5页

辽宁省丹东市第一中学高二物理测试题含解析 5页

辽宁省丹东市第二十四中学2021年高二生物下学.. 8页

辽宁省大连市尚立高级中学2021年高三物理联考.. 7页

透水混凝土景观销售合同2篇 33页

辽宁省大连市前程高级中学2021-2022学年高二物.. 5页

二零二五年度石材购销合作合同模板 3页

辽宁省大连市庄河第五高级中学高三化学月考试.. 5页

(茅台酒)白酒酿造工职业技能认定-制曲制酒考.. 10页

2025年小学四年级文明礼仪优秀演讲稿 5页

辽宁省大连市普兰店第三十八中学2022年高三数.. 6页

辽宁省大连市普兰店第十九高级中学2021年高一.. 9页

洪水影响评价工作要点与对策 3页

学校发展水平三年自查自评报告 20页

化疗药物配制及流程课件 20页

河北省中小学生转学申请表 1页

湖北生产建设项目水土保持工程概(估)算编制.. 50页

断背山中英双语版 39页

霍尼韦尔dc1040中文说明书 17页

GBT 34008-2017 防辐射混凝土 24页

eq2102电气系统讲义. 37页