gdalnpm

1.0.3 • Public • Published

This package is used to convert geospatial pdf to geotiff file in one go.(No Extra NPM modules is required)

Installation:-

  1. First Install GDAL on your system. This is the way to install GDAL in your system(LINUX):-
    • sudo add-apt-repository ppa:ubuntugis/ppa
    • sudo apt-get update
    • sudo apt-get install gdal-bin
    • ogrinfo --version

2)Method Name:-

convertToTiff(originGeoPdfPath, allowCompression, destinationGeoTiffFolderName)

* originGeoPdfPath(string):- The Complete Path where your geospatial pdf is present

* allowCompression(boolean):- To allow compression or not by default it is false if you want to allow compression pass true

*destinationGeoTiffFolderName(string):-The comeplete path of the folder where you want to save your converted geotiff files

*return Promises

3)Sample Code to perform conversion

const GdalNpm = require('gdalnpm')  //require NPM

const path = require('path')        //require path

//originGeoPdfPath:- The Complete Path where your geospatial pdf is present

//allowCompression:- To allow compression or not by default it is false if you want to allow compression pass true

//destinationGeoTiffFolderName:-The comeplete path of the folder where you want to save your converted geotiff files

const ConvertToGeoTiff = async (originGeoPdfPath, allowCompression, destinationGeoTiffFolderName) => {
try {
    return await GdalNpm.convertToTiff(originGeoPdfPath, allowCompression, destinationGeoTiffFolderName)
}
catch (err) {
    throw err;
}
}

await ConvertToGeoTiff(path.join(__dirname, 'geospatial.pdf'), true, path.join(__dirname, 'geotiff')).catch(err => console.log(err))


Enjoy!!!! Happy Coding!!!!!

Package Sidebar

Install

npm i gdalnpm

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

4.73 kB

Total Files

3

Last publish

Collaborators

  • the_freaky_developer