-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
8,103 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,30 @@ | ||
/* THIS IS A BIT-AUTO-GENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. */ | ||
|
||
{ | ||
"kriscarle.maphubs-utils/maphubs-utils/url-util@1.0.0": { | ||
"kriscarle.maphubs-utils/maphubs-utils/debug@1.0.0": { | ||
"files": [ | ||
{ | ||
"relativePath": "url-util/index.js", | ||
"relativePath": "debug/README.md", | ||
"test": false, | ||
"name": "index.js" | ||
} | ||
], | ||
"mainFile": "url-util/index.js", | ||
"trackDir": "url-util", | ||
"origin": "AUTHORED" | ||
}, | ||
"kriscarle.maphubs-utils/maphubs-utils/[email protected]": { | ||
"files": [ | ||
"name": "README.md" | ||
}, | ||
{ | ||
"relativePath": "log/index.js", | ||
"relativePath": "debug/index.js", | ||
"test": false, | ||
"name": "index.js" | ||
} | ||
], | ||
"mainFile": "log/index.js", | ||
"trackDir": "log", | ||
"origin": "AUTHORED" | ||
}, | ||
"kriscarle.maphubs-utils/maphubs-utils/[email protected]": { | ||
"files": [ | ||
{ | ||
"relativePath": "file-encoding-utils/README.md", | ||
"test": false, | ||
"name": "README.md" | ||
}, | ||
{ | ||
"relativePath": "file-encoding-utils/index.js", | ||
"relativePath": "debug/package.json", | ||
"test": false, | ||
"name": "index.js" | ||
"name": "package.json" | ||
} | ||
], | ||
"mainFile": "file-encoding-utils/index.js", | ||
"trackDir": "file-encoding-utils", | ||
"origin": "AUTHORED" | ||
"mainFile": "debug/index.js", | ||
"trackDir": "debug", | ||
"origin": "AUTHORED", | ||
"exported": true | ||
}, | ||
"kriscarle.maphubs-utils/maphubs-utils/email-util@1.0.0": { | ||
"kriscarle.maphubs-utils/maphubs-utils/email-util@1.1.1": { | ||
"files": [ | ||
{ | ||
"relativePath": "email-util/README.md", | ||
|
@@ -53,30 +35,42 @@ | |
"relativePath": "email-util/index.js", | ||
"test": false, | ||
"name": "index.js" | ||
}, | ||
{ | ||
"relativePath": "email-util/package.json", | ||
"test": false, | ||
"name": "package.json" | ||
} | ||
], | ||
"mainFile": "email-util/index.js", | ||
"trackDir": "email-util", | ||
"origin": "AUTHORED" | ||
"origin": "AUTHORED", | ||
"exported": true | ||
}, | ||
"kriscarle.maphubs-utils/maphubs-utils/debug@1.0.0": { | ||
"kriscarle.maphubs-utils/maphubs-utils/file-encoding-utils@1.0.0": { | ||
"files": [ | ||
{ | ||
"relativePath": "debug/README.md", | ||
"relativePath": "file-encoding-utils/README.md", | ||
"test": false, | ||
"name": "README.md" | ||
}, | ||
{ | ||
"relativePath": "debug/index.js", | ||
"relativePath": "file-encoding-utils/index.js", | ||
"test": false, | ||
"name": "index.js" | ||
}, | ||
{ | ||
"relativePath": "file-encoding-utils/package.json", | ||
"test": false, | ||
"name": "package.json" | ||
} | ||
], | ||
"mainFile": "debug/index.js", | ||
"trackDir": "debug", | ||
"origin": "AUTHORED" | ||
"mainFile": "file-encoding-utils/index.js", | ||
"trackDir": "file-encoding-utils", | ||
"origin": "AUTHORED", | ||
"exported": true | ||
}, | ||
"kriscarle.maphubs-utils/maphubs-utils/importers@1.0.2": { | ||
"kriscarle.maphubs-utils/maphubs-utils/importers@1.1.8": { | ||
"files": [ | ||
{ | ||
"relativePath": "importers/README.md", | ||
|
@@ -114,19 +108,56 @@ | |
"name": "index.js" | ||
}, | ||
{ | ||
"relativePath": "importers/shapefile/index.js", | ||
"relativePath": "importers/package.json", | ||
"test": false, | ||
"name": "index.js" | ||
"name": "package.json" | ||
}, | ||
{ | ||
"relativePath": "importers/shapefile/shapefile-fairy.js", | ||
"relativePath": "importers/shapefile/index.js", | ||
"test": false, | ||
"name": "shapefile-fairy.js" | ||
"name": "index.js" | ||
} | ||
], | ||
"mainFile": "importers/index.js", | ||
"trackDir": "importers", | ||
"origin": "AUTHORED" | ||
"origin": "AUTHORED", | ||
"exported": true | ||
}, | ||
"kriscarle.maphubs-utils/maphubs-utils/[email protected]": { | ||
"files": [ | ||
{ | ||
"relativePath": "log/index.js", | ||
"test": false, | ||
"name": "index.js" | ||
}, | ||
{ | ||
"relativePath": "log/package.json", | ||
"test": false, | ||
"name": "package.json" | ||
} | ||
], | ||
"mainFile": "log/index.js", | ||
"trackDir": "log", | ||
"origin": "AUTHORED", | ||
"exported": true | ||
}, | ||
"kriscarle.maphubs-utils/maphubs-utils/[email protected]": { | ||
"files": [ | ||
{ | ||
"relativePath": "url-util/index.js", | ||
"test": false, | ||
"name": "index.js" | ||
}, | ||
{ | ||
"relativePath": "url-util/package.json", | ||
"test": false, | ||
"name": "package.json" | ||
} | ||
], | ||
"mainFile": "url-util/index.js", | ||
"trackDir": "url-util", | ||
"origin": "AUTHORED", | ||
"exported": true | ||
}, | ||
"version": "13.0.4" | ||
"version": "14.7.6" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
{ | ||
"env": { | ||
"compiler": "bit.envs/compilers/flow@0.0.10" | ||
"compiler": "bit.envs/compilers/flow@7.0.3" | ||
}, | ||
"dependencies": {}, | ||
"componentsDefaultDirectory": "{name}", | ||
"packageManager": "npm" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
// @flow | ||
const geobuf = require('geobuf') | ||
const Pbf = require('pbf') | ||
const Promise = require('bluebird') | ||
const fs = require('fs') | ||
const debug = require('../../debug')('importers/geobuf') | ||
const util = require('util') | ||
const readFile = util.promisify(fs.readFile) | ||
|
||
module.exports = async function (filePath: string, layer_id: number, config?: Object) { | ||
debug.log(`importing Geobuf for layer: ${layer_id}`) | ||
/* eslint-disable security/detect-non-literal-fs-filename */ | ||
// file path is a folder from a env var + a GUID, not orginal filename | ||
const file = await Promise.promisify(fs.readFile, {context: fs})(filePath) | ||
const file = await readFile(filePath) | ||
const geoJSON = geobuf.decode(new Pbf(new Uint8Array(file))) | ||
return geoJSON | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
// @flow | ||
const Promise = require('bluebird') | ||
const fs = require('fs') | ||
const ogr2ogr = require('ogr2ogr') | ||
const debug = require('../../debug')('importers/gpx') | ||
|
||
module.exports = async function (filePath: string, layer_id: number, config?: Object) { | ||
/* eslint-disable security/detect-non-literal-fs-filename */ | ||
// file path is a folder from a env var + a GUID, not orginal filename | ||
const ogr = ogr2ogr(fs.createReadStream(filePath), 'GPX') | ||
let geoJSON = await ogr2ogr(fs.createReadStream(filePath), 'GPX') | ||
.format('GeoJSON').skipfailures() | ||
.options(['-t_srs', 'EPSG:4326', '-sql', 'SELECT * FROM tracks']) | ||
.timeout(60000) | ||
const geoJSON = await Promise.promisify(ogr.exec, {context: ogr})() | ||
.promise() | ||
if (geoJSON.features && geoJSON.features.length === 0) { | ||
debug.log('No tracks found, loading waypoints') | ||
const ogrWaypoints = ogr2ogr(fs.createReadStream(filePath), 'GPX') | ||
geoJSON = await ogr2ogr(fs.createReadStream(filePath), 'GPX') | ||
.format('GeoJSON').skipfailures() | ||
.options(['-t_srs', 'EPSG:4326', '-sql', 'SELECT * FROM waypoints']) | ||
.timeout(60000) | ||
|
||
const geoJSON = await Promise.promisify(ogrWaypoints.exec)() | ||
return geoJSON | ||
} else { | ||
if (config && config.writeDebugData) { | ||
fs.writeFile(config.tempFilePath + '/gpx-upload-layer-' + layer_id + '.geojson', JSON.stringify(geoJSON), (err) => { | ||
if (err) { | ||
throw err | ||
} | ||
}) | ||
} | ||
return geoJSON | ||
.promise() | ||
} | ||
if (config && config.writeDebugData) { | ||
fs.writeFile(config.tempFilePath + '/gpx-upload-layer-' + layer_id + '.geojson', JSON.stringify(geoJSON), (err) => { | ||
if (err) { | ||
throw err | ||
} | ||
}) | ||
} | ||
return geoJSON | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.