Socket
Socket
Sign inDemoInstall

gdalnpm

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gdalnpm

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


Version published
Weekly downloads
0
Maintainers
1
Install size
4.62 kB
Created
Weekly downloads
 

Readme

Source

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!!!!!

Keywords

FAQs

Last updated on 17 Oct 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc