Skip to content

Instantly share code, notes, and snippets.

@geobabbler
Created November 23, 2014 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geobabbler/b23d69193bd9699078c0 to your computer and use it in GitHub Desktop.
Save geobabbler/b23d69193bd9699078c0 to your computer and use it in GitHub Desktop.
app.get('/leonardtown/buildings/:geom', function (req, res, next) {
var client = new pg.Client(app.conString);
var geom = req.params.geom.toLowerCase();
if ((geom != "features") && (geom != "geometry")) {
res.status(404).send("Resource '" + geom + "' not found");
return;
}
var tablename = "leonardtown_bldgs";
var schemaname = "public";
var fullname = schemaname + "." + tablename;
var spatialcol = "";
var proptype = req.query.type;
var whereclause = ";";
if (typeof proptype != "undefined") {
if (proptype.toLowerCase() != "all") {
whereclause = " where structure_ = '" + proptype + "';";
}
}
var coll;
var sql = "";
//logic continues from here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment