Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/roll up the results
query.on('row', function (result) {
if (!result) {
return res.send('No data found');
} else {
if (geom == "features") {
coll.features.push(geojson.getFeatureResult(result, spatialcol)); //use helper function
} else if (geom == "geometry") {
var shape = JSON.parse(result.geojson);
coll.geometries.push(shape);
}
}
});
//send the results
query.on('end', function (err, result) {
res.setHeader('Content-Type', 'application/json');
res.send(coll);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.