notice2shp
v0.0.2
Published
a simple utility to query e2Notices and return .shp files from the data they contain
Downloads
1
Readme
notice2shp
a simple utility to query e2Notices and return .shp files from the data they contain
as a cli
install
$ npm i notice2shp -S
use
$ notice2shp --help
Usage: cli [options]
a simple utility to query e2Notices and return .shp files from the data they contain
Options:
-V, --version output the version number
-s, --server <url> mongo connection string (without mongodb://)
-q, --query [String] query string. defaults to returning all
-o, --output <path> filename for output (without extension), i.e. fileName1234
-h, --help output usage information
$ notice2shp -S [username:password@]host1[:port1]
or with a query
$ notice2shp -s [username:password@]host1[:port1] -q '{"file_id":"470933"}'
or with a query and a filename
$ notice2shp -s [username:password@]host1[:port1] -q '{"file_id":"470933"}' -o 'filename1234'
as a module
install
$ npm i notice2shp -S
use
const generateShpFile = require('notice2shp');
let shpFileEverything = generateShpFile('[username:password@]host1[:port1]', {});
let shpFileSomeThings = generateShpFile('[username:password@]host1[:port1]',
{
'year': '2017'
});
let shpFileSomeThings = generateShpFile('[username:password@]host1[:port1]',
{
'year': '2017'
},
'filename1234');
what can be queried
{
"_id" : String,
"feature" : String,
"pdf_page" : String,
"action_geo" : [
{
"lat" : "36° 0' 37.80\" N",
"descriptor" : "",
"lon" : "14° 25' 25.92\" E",
"label" : "A"
},
{
"lat" : "36° 0' 40.38\" N",
"descriptor" : "",
"lon" : "14° 25' 28.32\" E",
"label" : "B"
},
{
"lat" : "36° 0' 30.42\" N",
"descriptor" : "",
"lon" : "14° 25' 44.40\" E",
"label" : "C"
},
{
"lat" : "36° 0' 27.84\" N",
"descriptor" : "",
"lon" : "14° 25' 42.00\" E",
"label" : "D"
}
],
"corr_id" : String,
"country_code" : String,
"year" : String,
"charts" : [
{
"chart_id" : String,
"international_chart_number" : String
}
],
"action_geom" : {
"type" : "FeatureCollection",
"features" : [
{
"geometry" : {
"type" : "MultiPoint",
"coordinates" : [
[
14.4239,
36.0105
],
[
14.4245,
36.0112
],
[
14.429,
36.0085
],
[
14.4283,
36.0077
]
]
},
"type" : "Feature",
"properties" : {}
}
]
},
"para_title" : String,
"deliverable_case" : String,
"para_id" : String,
"processing_instructions" : [],
"para_source" : String,
"file_id" : String,
"para_kind" : String,
"action_processing_instruction" : String,
"book_id" : String,
"action" : String,
"raw_para_id" : String,
"book" : String,
"action_expr" : String,
"category" : String,
"ingest_date" : Date
}