jczaplew / dbgeo Goto Github PK
View Code? Open in Web Editor NEWNode.js module for converting database query results to GeoJSON or TopoJSON
License: Creative Commons Zero v1.0 Universal
Node.js module for converting database query results to GeoJSON or TopoJSON
License: Creative Commons Zero v1.0 Universal
TypeError: data.map is not a function
at Object.dbgeo.parse (/home/pi/NodeJS/dataCollect/node_modules/dbgeo/lib/dbgeo.js:47:22)
at /home/pi/NodeJS/dataCollect/app2.js:34:12
at process._tickCallback (internal/process/next_tick.js:103:7)
I'm trying to parse the out put of a query, but I get all the numerical fields as string even though they are numerical field in the postgreSQL
const dbgeo = require('dbgeo');
var db = pgp(DBconnJson.postgis);
db.query(formatSQL(req))
.then((data)=> console.log(data)) // data appear in the console are in string format!
.then(function (data) {
dbgeo.parse(data, {
outputFormat: 'geojson',
precision: 6
}
}
Is there any parameter I should set to preserve the data types?
We had a bug where, because the quantized option is not available or set in version 1.0.1 (which is the latest on npm), our points were snapping to super coarse grid when we had many markers. Setting the quantized param as described in the documentation did nothing because it's not picked up that version of the code.
Should also think about updating the topojson version the project is using since they're on 3.0.0 and dbgeo is using 1.x.
Thanks!
Let me know if there's any way I can help.
Some things have changed from the old informal 2008 spec https://geojson.org/geojson-spec. So to be valid for the 2016 spec your polygons MUST be right-hand wound. How we can export geojson in the new spec?
In postgis-preview, when I execute SQL that does not have any geometry column, dbgeo throws an error. I would still like to return geometry-less topojson to the client for the sake of consistency.
Warning as follows:
"
DeprecationWarning: Invalid
"main' field in '/home/myusername/node/node _modules/dbgeo/package.json' of
'. /dbgeo'•
• Please either fix that or report it to the module author
"
Perhaps similar to: indentjs/objectorarray#7
Hi John,
I'm attempting to create a nodejs app which allows me to talk to a postgis db and return query results to the browser as geojson to include in a leaflet map. i see that your postgeo app is now deprecated and that you've created dbgeo...but i've attempted to install in on both a windows and ubuntu server using - npm install dbgeo - but i get a series of errors.
Are you able to offer any advice?
Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.