-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
·57 lines (48 loc) · 1.57 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env node
const yargs = require('yargs/yargs');
const {hideBin} = require('yargs/helpers');
const parsePdfs = require('./parse-pdfs');
const createGeoJSON = require('./create-geojson');
const extractImages = require('./extract-images');
yargs(hideBin(process.argv))
.command('parse-pdfs [pdf-path] [-f fixed-trees-filepath] [-o output-filepath]', '', {
'pdf-path': {
describe: 'Directory of pdf files to be analyzed',
default: './'
},
'f': {
alias: 'fixed-trees-filepath',
describe: 'File name of csv containing predefined tree numbers'
},
'o': {
alias: 'output-filepath',
describe: 'Name of result csv file',
default: './parsed_trees.csv'
}
}, parsePdfs)
.command('create-geojson input-filepath [-o output-filepath]', '', {
'i': {
alias: 'input-filepath',
//default: './parsed_trees.csv'
},
'o': {
alias: 'output-filepath',
describe: 'Name of result csv file',
default: './trees.geojson'
}
}, createGeoJSON)
.command('extract-images [pdf-path]', '', {
'pdf-path': {
describe: 'Directory of pdf files to be analyzed',
default: './'
},
'o': {
alias: 'output-path',
describe: 'Name of directory where extracted images will be stored',
default: './images'
}
}, extractImages)
.wrap(null)
.alias('h', 'help')
.demandCommand()
.argv