Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #49 from jczaplew/master
Browse files Browse the repository at this point in the history
Add missing dependency + upgrade dbgeo
  • Loading branch information
Chris Whong authored Sep 29, 2016
2 parents e5b67fb + ecd9088 commit 772e5d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "config.js",
"dependencies": {
"async": "~1.2.0",
"dbgeo": "^0.1.1",
"dbgeo": "^1.0.0",
"dotenv": "^2.0.0",
"express": "^4.13.4",
"jsonexport": "^1.1.0",
"pg-promise": "^4.3.3",
Expand Down
14 changes: 6 additions & 8 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ app.get('/sql', function (req, res) {
function dbGeoParse(data, format) {
return new Promise(function (resolve, reject) {
dbgeo.parse(data, {
outputFormat: format,
geometryColumn: 'geom',
geometryType: 'wkb'
outputFormat: format
}, function (err, result) {
if (err) {
reject(err);
Expand All @@ -72,12 +70,12 @@ function dbGeoParse(data, format) {
}


function jsonExport(data) {
//remove geom
data.forEach(function (row) {
delete row.geom;
function jsonExport(data) {
//remove geom
data.forEach(function (row) {
delete row.geom;
});

return new Promise(function (resolve, reject) {
jsonexport(data, function (err, csv) {
if (err) {
Expand Down

0 comments on commit 772e5d4

Please sign in to comment.