Play with gdal.vectorTranslate in Node.js
✓ Published0🌍 Public
TThomasG77
Last edited Mar 18, 2022
Created on Mar 18, 2022
This example demonstrates a complete geospatial data processing pipeline using the Node.js `gdal-async` library. It downloads a Natural Earth countries dataset, extracts the ZIP archive, and converts the shapefile to GeoPackage format with `gdal.vectorTranslate`, then transforms the GeoPackage into GeoJSON. The script uses the `got` library for HTTP streaming with progress reporting and `adm-zip` for extraction. This showcases how GDAL's vector translation capabilities can be invoked programmatically in a Node.js environment for format conversion between common geospatial file types.
AI-generated descriptionPlay with gdal.vectorTranslate in Node.js
Related to my question https://github.com/mmomtchev/node-gdal-async/issues/18
Install
git clone https://gist.github.com/3f4795f399112c152bc9105b111e6888.git gdal-vector-translate-demo
cd gdal-vector-translate-demo
npm i
Run to download and transform geospatial files with
node index.js
ISC Licensed