WKB to GeoJSON
Convert WKB (Well Known Binary) values to GeoJSON. Or from GeoJSON to WKB
About
"Well-known binary" (WKB) is a binary encoding that allows geometric data to be efficiently stored and transmitted.
WKB is a standard method for representing geometric objects such as
, points
, and lines
in binary form.
It's commonly used in the field of Geographic Information Systems (GIS) and spatial databases.polygons
This tool uses the wkx package for conversions.
WKB to GeoJSON
import wkx from 'wkx'
// wkbValue is your input value
const twkbBuffer = Buffer.from(wkbValue, 'hex')
const geometry = wkx.Geometry.parse(twkbBuffer)
const geoJson = geometry.toGeoJSON()
GeoJSON to WKB
import wkx from 'wkx'
// geoJsonValue is your input JSON
const geometry = wkx.Geometry.parseGeoJSON(geoJsonValue)
const wkbString = geometry.toWkb().toString('hex')