Node-Geohash 技术文档
1. 安装指南
安装方式
Node-Geohash 是一个用于 Node.js 的 Geohash 库。你可以通过 npm 来安装这个库。
npm install ngeohash
2. 项目使用说明
基本用法
安装完成后,你可以在你的 Node.js 项目中引入 ngeohash 模块,并使用其提供的功能。
var geohash = require('ngeohash');
// 编码经纬度为 Geohash 字符串
console.log(geohash.encode(37.8324, 112.5584));
// 输出: ww8p1r4t8
// 解码 Geohash 字符串为经纬度
var latlon = geohash.decode('ww8p1r4t8');
console.log(latlon.latitude); // 输出: 37.8324
console.log(latlon.longitude); // 输出: 112.5584
基本方法
geohash.encode(latitude, longitude, precision=9)
将一对经纬度值编码为 Geohash 字符串。第三个参数是可选的,用于指定 Geohash 字符串的长度,从而影响其精度。
geohash.decode(hashstring)
将 Geohash 字符串解码为经纬度值。返回一个包含 latitude 和 longitude 键的 JavaScript 对象。
geohash.decode_bbox(hashstring)
将 Geohash 字符串解码为匹配的边界框。返回一个四元素数组:[minlat, minlon, maxlat, maxlon]。
geohash.bboxes(minlat, minlon, maxlat, maxlon, precision=9)
获取 [minlat, minlon] 和 [maxlat, maxlon] 之间的所有 Geohash 字符串。这些字符串可以用于在缓存中查找 POI。
geohash.neighbor(hashstring, direction)
在指定方向上查找 Geohash 字符串的邻居。方向是一个二维数组,例如 [1,0] 表示北,[-1,-1] 表示西南。
geohash.neighbors(hashstring)
查找 Geohash 字符串的所有 8 个邻居 [n, ne, e, se, s, sw, w, nw]。
整数方法
geohash.encode_int(latitude, longitude, bitDepth=52)
将一对经纬度值编码为 Geohash 整数。第三个参数是可选的,用于指定整数的 bitDepth,从而影响其精度。
geohash.decode_int(hashinteger, bitDepth=52)
将 Geohash 整数解码为经纬度值。返回一个包含 latitude 和 longitude 键的 JavaScript 对象。
geohash.decode_bbox_int(hashinteger, bitDepth=52)
将 Geohash 整数解码为匹配的边界框。返回一个四元素数组:[minlat, minlon, maxlat, maxlon]。
geohash.bboxes_int(minlat, minlon, maxlat, maxlon, bitDepth=52)
获取 [minlat, minlon] 和 [maxlat, maxlon] 之间的所有 Geohash 整数。
geohash.neighbor_int(hashinteger, direction, bitDepth=52)
在指定方向上查找 Geohash 整数的邻居。
geohash.neighbors_int(hashinteger, bitDepth=52)
查找 Geohash 整数的所有 8 个邻居 [n, ne, e, se, s, sw, w, nw]。
3. 项目 API 使用文档
编码与解码
geohash.encode(latitude, longitude, precision=9):将经纬度编码为 Geohash 字符串。geohash.decode(hashstring):将 Geohash 字符串解码为经纬度。
边界框
geohash.decode_bbox(hashstring):解码 Geohash 字符串为边界框。geohash.bboxes(minlat, minlon, maxlat, maxlon, precision=9):获取指定范围内的所有 Geohash 字符串。
邻居
geohash.neighbor(hashstring, direction):查找指定方向的邻居。geohash.neighbors(hashstring):查找所有 8 个邻居。
整数编码与解码
geohash.encode_int(latitude, longitude, bitDepth=52):将经纬度编码为 Geohash 整数。geohash.decode_int(hashinteger, bitDepth=52):将 Geohash 整数解码为经纬度。
整数边界框
geohash.decode_bbox_int(hashinteger, bitDepth=52):解码 Geohash 整数为边界框。geohash.bboxes_int(minlat, minlon, maxlat, maxlon, bitDepth=52):获取指定范围内的所有 Geohash 整数。
整数邻居
geohash.neighbor_int(hashinteger, direction, bitDepth=52):查找指定方向的邻居。geohash.neighbors_int(hashinteger, bitDepth=52):查找所有 8 个邻居。
4. 项目安装方式
Node-Geohash 可以通过 npm 进行安装:
npm install ngeohash
安装完成后,你可以在项目中通过 require('ngeohash') 引入并使用该库。
GLM-5智谱 AI 正式发布 GLM-5,旨在应对复杂系统工程和长时域智能体任务。Jinja00
GLM-5-w4a8GLM-5-w4a8基于混合专家架构,专为复杂系统工程与长周期智能体任务设计。支持单/多节点部署,适配Atlas 800T A3,采用w4a8量化技术,结合vLLM推理优化,高效平衡性能与精度,助力智能应用开发Jinja00
请把这个活动推给顶尖程序员😎本次活动专为懂行的顶尖程序员量身打造,聚焦AtomGit首发开源模型的实际应用与深度测评,拒绝大众化浅层体验,邀请具备扎实技术功底、开源经验或模型测评能力的顶尖开发者,深度参与模型体验、性能测评,通过发布技术帖子、提交测评报告、上传实践项目成果等形式,挖掘模型核心价值,共建AtomGit开源模型生态,彰显顶尖程序员的技术洞察力与实践能力。00
Kimi-K2.5Kimi K2.5 是一款开源的原生多模态智能体模型,它在 Kimi-K2-Base 的基础上,通过对约 15 万亿混合视觉和文本 tokens 进行持续预训练构建而成。该模型将视觉与语言理解、高级智能体能力、即时模式与思考模式,以及对话式与智能体范式无缝融合。Python00
MiniMax-M2.5MiniMax-M2.5开源模型,经数十万复杂环境强化训练,在代码生成、工具调用、办公自动化等经济价值任务中表现卓越。SWE-Bench Verified得分80.2%,Multi-SWE-Bench达51.3%,BrowseComp获76.3%。推理速度比M2.1快37%,与Claude Opus 4.6相当,每小时仅需0.3-1美元,成本仅为同类模型1/10-1/20,为智能应用开发提供高效经济选择。【此简介由AI生成】Python00
Qwen3.5Qwen3.5 昇腾 vLLM 部署教程。Qwen3.5 是 Qwen 系列最新的旗舰多模态模型,采用 MoE(混合专家)架构,在保持强大模型能力的同时显著降低了推理成本。00- RRing-2.5-1TRing-2.5-1T:全球首个基于混合线性注意力架构的开源万亿参数思考模型。Python00