Shp2pb is a utility tool designed to convert Shapefile (shp) formats into Protocol Buffers (protobuf) files. It streamlines the process of transforming geographic data, enabling efficient storage and transmission in a compact, serialized format suitable for various applications
use npm: $ npm install shp2pb
Take the example data below:
const GeoPB=require('shp2pb');
const buf=GeoPB.shp2pb('data.shp',{wkid:4326});
fs.writeFileSync('data.pb',buf);
const json=GeoPB.pb2json('data.shp',{wkid:4326});
console.log(JSON.stringify(json))
Licensed under the MIT License. See LICENSE
for details.