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') 引入并使用该库。
AutoGLM-Phone-9BAutoGLM-Phone-9B是基于AutoGLM构建的移动智能助手框架,依托多模态感知理解手机屏幕并执行自动化操作。Jinja00
Kimi-K2-ThinkingKimi K2 Thinking 是最新、性能最强的开源思维模型。从 Kimi K2 开始,我们将其打造为能够逐步推理并动态调用工具的思维智能体。通过显著提升多步推理深度,并在 200–300 次连续调用中保持稳定的工具使用能力,它在 Humanity's Last Exam (HLE)、BrowseComp 等基准测试中树立了新的技术标杆。同时,K2 Thinking 是原生 INT4 量化模型,具备 256k 上下文窗口,实现了推理延迟和 GPU 内存占用的无损降低。Python00
GLM-4.6V-FP8GLM-4.6V-FP8是GLM-V系列开源模型,支持128K上下文窗口,融合原生多模态函数调用能力,实现从视觉感知到执行的闭环。具备文档理解、图文生成、前端重构等功能,适用于云集群与本地部署,在同类参数规模中视觉理解性能领先。Jinja00
HunyuanOCRHunyuanOCR 是基于混元原生多模态架构打造的领先端到端 OCR 专家级视觉语言模型。它采用仅 10 亿参数的轻量化设计,在业界多项基准测试中取得了当前最佳性能。该模型不仅精通复杂多语言文档解析,还在文本检测与识别、开放域信息抽取、视频字幕提取及图片翻译等实际应用场景中表现卓越。00
GLM-ASR-Nano-2512GLM-ASR-Nano-2512 是一款稳健的开源语音识别模型,参数规模为 15 亿。该模型专为应对真实场景的复杂性而设计,在保持紧凑体量的同时,多项基准测试表现优于 OpenAI Whisper V3。Python00
GLM-TTSGLM-TTS 是一款基于大语言模型的高质量文本转语音(TTS)合成系统,支持零样本语音克隆和流式推理。该系统采用两阶段架构,结合了用于语音 token 生成的大语言模型(LLM)和用于波形合成的流匹配(Flow Matching)模型。 通过引入多奖励强化学习框架,GLM-TTS 显著提升了合成语音的表现力,相比传统 TTS 系统实现了更自然的情感控制。Python00
Spark-Formalizer-X1-7BSpark-Formalizer 是由科大讯飞团队开发的专用大型语言模型,专注于数学自动形式化任务。该模型擅长将自然语言数学问题转化为精确的 Lean4 形式化语句,在形式化语句生成方面达到了业界领先水平。Python00