Twkb.js
javascript library to decode TWKB
Install / Use
/learn @TWKB/Twkb.jsREADME
twkb
This library allows to decode TWKB.
WARNING: this is a preview and may change without any notice
Usage
twkb.toGeoJSON(buffer)
Building
npm install
npm run build
Example
this is a simple example using leaflet
function get(url, callback) {
var oReq = new XMLHttpRequest();
oReq.open("GET", url, true);
oReq.responseType = "arraybuffer";
oReq.onload = function (oEvent) {
callback(oReq.response);
};
oReq.send(null);
}
var map = L.map('map').setView([40.505, -3.09], 5);
get('file.twkb', function(data) {
var g = new twkb.toGeoJSON(new Uint8Array(data))
L.geoJson({ features: g, type: "FeatureSet"}).addTo(map)
})
API
twkb
twkb.toGeoJSON(buffer)
Returns valid GeoJSON for the features
License
see LICENSE file
Related Skills
node-connect
351.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
