diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2011-02-01 02:03:28 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2011-02-01 02:03:28 +0100 |
commit | 710407ad022b919c78659a3d30c7ce695eea9560 (patch) | |
tree | 7716d31aa6392b5b225514b94ccf62d7f42d5798 /src | |
parent | d857e652d28ab6988b60d3d72e3b4432d0125eaf (diff) | |
download | osm-xapi-710407ad022b919c78659a3d30c7ce695eea9560.tar.gz osm-xapi-710407ad022b919c78659a3d30c7ce695eea9560.tar.xz osm-xapi-710407ad022b919c78659a3d30c7ce695eea9560.zip |
remove trailing whitespaces
Diffstat (limited to 'src')
-rw-r--r-- | src/nodejs/main.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/nodejs/main.js b/src/nodejs/main.js index 80bd051..96d1043 100644 --- a/src/nodejs/main.js +++ b/src/nodejs/main.js @@ -93,7 +93,7 @@ var options = [ // { // object = node/way/relation/* , // bbox = { left : 1.0 , right : 1.0 , top : 1.0, bottom : 1.0 } -// tag = { key : [ ], value [ ] } +// tag = { key : [ ], value [ ] } // } @@ -101,14 +101,14 @@ function buildMainQuery(reqJso){ var id = 1; var replacements = Array(); - + var selectMap = { - 'node' : 'id,user_id,tstamp,version,changeset_id,hstore_to_array(tags) as tags, ' + + 'node' : 'id,user_id,tstamp,version,changeset_id,hstore_to_array(tags) as tags, ' + 'X(geom) as lat, Y(geom) as lon', 'way' : 'id,tstamp,version,changeset_id,nodes,user_id,hstore_to_array(tags) as tags ', 'relation' : '' //FIXME: plz - } - + } + // FIXME: help me i am not side effect free function buildTagsQuery(map){ @@ -125,7 +125,7 @@ function buildMainQuery(reqJso){ // FIXME: help me i am not side effect free function buildBbox(object,bbox){ - + var colName = { node : 'geom', way : 'linestring', @@ -136,7 +136,7 @@ function buildMainQuery(reqJso){ ' st_setsrid(st_makepoint($' + id++ + ', $' + id++ + '), 4326), ' + ' st_setsrid(st_makepoint($' + id++ + ', $' + id++ + '), 4326) ' + ' ), 4326) '; - + for( direction in bbox ) { replacements.push(bbox[direction]); } @@ -153,15 +153,15 @@ function buildMainQuery(reqJso){ } return map; } - + query = "SELECT " + selectMap[reqJso.object] + " FROM " + reqJso.object + "s"; - + whereClauses = Array(); if(reqJso.bbox != undefined){ whereClauses.push(buildBbox(reqJso.object,reqJso.bbox)); } - + // FIXME: rename tag to tags key to keys value to values if(reqJso.tag != undefined){ tags = explodeTags(reqJso.tag.key,reqJso.tag.value); @@ -278,11 +278,11 @@ function myFunction(req,res){ res.writeHead(200); var reqObj = parser.urlToXpathObj(req.url); - + var queryDict = buildMainQuery(reqObj); - + var resXml = osmRes.mkXmlRes(res); - + console.log(JSON.stringify(queryDict)); console.log("??????????????????????????????"); @@ -296,12 +296,12 @@ function myFunction(req,res){ }); query.on('end', function() { - console.log(" EEEND "); + console.log(" EEEND "); res.atEnd(); }); query.on('row', function(row) { - //console.log(JSON.stringify(row)); + //console.log(JSON.stringify(row)); if(reqObj.object == "node") { var pojo = rowToNode(row); res.putNode(pojo); |