From d8fd33cf3cbd2b9adbf28e7739a1c0de61043f16 Mon Sep 17 00:00:00 2001 From: slomo Date: Thu, 7 Apr 2011 15:55:56 +0200 Subject: added nvm submodule --- .gitmodules | 6 ++++++ nvm | 1 + 2 files changed, 7 insertions(+) create mode 160000 nvm diff --git a/.gitmodules b/.gitmodules index 4b7b098..3bacd5e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,9 @@ [submodule "src/nodejs/tests/node-async-testing"] path = src/nodejs/tests/node-async-testing url = https://github.com/bentomas/node-async-testing.git +[submodule "nave"] + path = nave + url = https://github.com/isaacs/nave.git +[submodule "nvm"] + path = nvm + url = https://github.com/creationix/nvm.git diff --git a/nvm b/nvm new file mode 160000 index 0000000..8352018 --- /dev/null +++ b/nvm @@ -0,0 +1 @@ +Subproject commit 83520186d8eb88dbf0a713876be723169cf956bd -- cgit v1.2.3 From 00f03a2ffec6823ea33cee90e03fb2f9c91113cb Mon Sep 17 00:00:00 2001 From: slomo Date: Thu, 7 Apr 2011 15:57:42 +0200 Subject: .gitmodules updated --- .gitmodules | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3bacd5e..b086e1f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "src/nodejs/tests/node-async-testing"] path = src/nodejs/tests/node-async-testing url = https://github.com/bentomas/node-async-testing.git -[submodule "nave"] - path = nave - url = https://github.com/isaacs/nave.git [submodule "nvm"] path = nvm url = https://github.com/creationix/nvm.git -- cgit v1.2.3 From 403fc3857079a27600629494aba50da9da1c9953 Mon Sep 17 00:00:00 2001 From: slomo Date: Thu, 7 Apr 2011 16:00:38 +0200 Subject: rewrote bootstrap.sh --- .gitignore | 2 +- bootstrap.sh | 72 ++++++++++++++++++++++++++---------------------------------- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index c093b4d..7c70a89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -usr/ +nodejs # Temp Files # ############## diff --git a/bootstrap.sh b/bootstrap.sh index fd458b7..bca7c9d 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,55 +1,45 @@ -#! /bin/sh +#! /bin/bash ########################### # start config -PREFIX=`pwd`/usr/ -NODE_VERSION=0.3.5 - -# use full for development -DEV_TOOLS="node-dev jslint" +# location of nvm script +NVM_PATH=nvm/nvm.sh +# location where node.js will be installed +export NVM_DIR=$PWD/nodejs +NODE_VERSION=v0.4.0 +PROJECT_PATH=src/nodejs # end config ########################### -export PATH=${PREFIX}/bin:${PATH} - -## Download Helper -# $1 - url -# $2 - destdir -download() { - mkdir -p ${PREFIX}/src - - if [ ! -f ${2} ]; then - echo "!! saving source to $1" - curl ${1} | tar -x -z -C ${PREFIX}/src - fi -} - -if [ ! -f ${PREFIX}/bin/node ]; then - # fetch and compile nodejs - download http://nodejs.org/dist/node-v${NODE_VERSION}.tar.gz ${PREFIX}/src/node-v${NODE_VERSION} - - cd ${PREFIX}/src/node-v${NODE_VERSION} - ./configure --prefix=${PREFIX} - make install - cd ${PREFIX}/.. -else - echo "!! node already installed" +# create directory +mkdir -p $NVM_DIR +echo $NVM_DIR + +# source nvm +. $NVM_PATH +nvm sync + +# install node if requested +echo "This will build and install node.js $NODE_VERSION into '$NVM_DIR'." +read -p "Do you like to proceed? " prompt +if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] + then + nvm install $NODE_VERSION + nvm use $NODE_VERSION fi -if [ ! -f ${PREFIX}/bin/npm ];then - # fetch and compile npm - curl http://npmjs.org/install.sh | sh -else - echo "!! npm already installed" +# install npm if requested +read -p "Do you like to install npm? " prompt +if [[ $prompt == "n" || $prompt == "N" || $prompt == "no" || $prompt == "No" ]] + then + exit 0; + else + curl http://npmjs.org/install.sh | sh fi -# load development code and compile dependencies -npm link src/nodejs/ - -for TOOL in $DEV_TOOLS; do - npm install $TOOL -done; +echo "Download all dependencies for project in $PROJECT_PATH" +npm link $PROJECT_PATH -- cgit v1.2.3 From 80e91c369cb3dad0edd7fe21973ff5c2acdc9fb4 Mon Sep 17 00:00:00 2001 From: yves Date: Tue, 19 Apr 2011 11:34:59 +0200 Subject: bla --- AUTOHRS | 1 + 1 file changed, 1 insertion(+) create mode 100644 AUTOHRS diff --git a/AUTOHRS b/AUTOHRS new file mode 100644 index 0000000..736f58e --- /dev/null +++ b/AUTOHRS @@ -0,0 +1 @@ +dsadsd -- cgit v1.2.3 From 31712a70998885f8d3c460278cf9ac4a390c4191 Mon Sep 17 00:00:00 2001 From: yves Date: Tue, 19 Apr 2011 11:36:27 +0200 Subject: fixxed typo --- AUTHORS | 1 + 1 file changed, 1 insertion(+) create mode 100644 AUTHORS diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..736f58e --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +dsadsd -- cgit v1.2.3 From 138114719ba57743ba0af1a9711de8a5615dfcba Mon Sep 17 00:00:00 2001 From: yves Date: Tue, 19 Apr 2011 13:42:05 +0200 Subject: moved readme, so github will render it --- AUTOHRS | 1 - README | 105 ------------------------------------------------------------- README.rst | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+), 106 deletions(-) delete mode 100644 AUTOHRS delete mode 100644 README create mode 100644 README.rst diff --git a/AUTOHRS b/AUTOHRS deleted file mode 100644 index 736f58e..0000000 --- a/AUTOHRS +++ /dev/null @@ -1 +0,0 @@ -dsadsd diff --git a/README b/README deleted file mode 100644 index f9894d1..0000000 --- a/README +++ /dev/null @@ -1,105 +0,0 @@ -=============== -osm@spline Xapi -=============== - -Contact -============ -http://osm.spline.de -mailing list: osm@lists.spline.de or xapi@lists.spline.de -irc: irc://irc.freenode.net/#spline - -Aim -============ - -We like to rewrite some parts of the XApi needed for our own application. Our -aim is not get a full implementation of the Xapi, but to answer only specific -requests, at low latency. For this subset of Xapi we want completly cover the -original api. - -Requests -============= - -This is a list of example requests, we want to optimize. - -* xapi.spline.de/api/0.6/node[amenity=*] -* xapi.spline.de/api/0.6/node[highway=busstop] -* xapi.spline.de/api/0.6/node[bbox=-6,50,2,61] -* xapi.spline.de/api/0.6/node[amenity=hospital][bbox=-6,50,2,61] - -a more formal description -------------------------- - -We serve the node endpoint, but no others. We implment the tag based filtering, -for only one tag and a bounding box. - -Basic setup -============= - -Just execute bootstrap.sh which will install node and everything you need into -your local directory. If you don't trust us read the bootstrap.sh. If you have -node and npm installed you can just use "npm link src/nodejs/" to install all -the dependencies. - -Dependencies -============= - -For dependencies checkout the package.json file. One special case is the node-postgres -lib. Use a patched version: https://github.com/AlexanderS/node-postgres - -If you try the libxml branch make sure you have installed libxml for developers. - -Database setup -============= - -We use postgres 9.* with postgis 1.5. Postgres 9.0 is used because we need some -functions on hstores and postgis 1.5 is used for fancy geometry things. - -To setup a database you first need a runing postgres 9.0 instance. I hope you know -how to do this. - -Use - - createdb osm - -to create a database with name osm. Use - - createlang plpgsql osm - -to add plpgsql to your database. If you want to create a database user do so: - - createuser - -Add hstore support for your database: - - psql -d osm < /share/contrib/hstore.sql - -Add postgis support for your database: - - psql -d osm < /share/contrib/postgis-1.5/postgis.sql - -Just do: - - psql -d osm < /share/contrib/postgis-1.5/spatial_ref_sys.sql - -Create the actual schema for osm data. For this step you need osmosis. If your -osmosis build is correct there should be a directory named pacakge/scripts where -you run: - - psql -d osm < pgsql_simple_schema_0.6.sql - psql -d osm < pgsql_simple_schema_0.6_linestring.sql -Optional/stil to test: - - psql -d osm < pgsql_simple_schema_0.6_action.sql - psql -d osm < pgsql_simple_schema_0.6_bbox.sql - -For documentation on the schema read pgsql_simple.txt. - -Import data from xml with: - - osmosis --read-xml file="planet.osm.bz2" --wp host="localhost" password="TopSecretPassword" user="insertUserNameHere" database="osm" - -Before or after import you may want to create a indexes. Examples below: - CREATE INDEX idx_nodes_tags ON nodes USING GIN(tags); - CREATE INDEX idx_nodes_tags ON nodes USING GIST(tags); - CREATE INDEX idx_ways_tags ON ways USING GIN(tags); - CREATE INDEX idx_ways_tags ON ways USING GIST(tags); diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..f9894d1 --- /dev/null +++ b/README.rst @@ -0,0 +1,105 @@ +=============== +osm@spline Xapi +=============== + +Contact +============ +http://osm.spline.de +mailing list: osm@lists.spline.de or xapi@lists.spline.de +irc: irc://irc.freenode.net/#spline + +Aim +============ + +We like to rewrite some parts of the XApi needed for our own application. Our +aim is not get a full implementation of the Xapi, but to answer only specific +requests, at low latency. For this subset of Xapi we want completly cover the +original api. + +Requests +============= + +This is a list of example requests, we want to optimize. + +* xapi.spline.de/api/0.6/node[amenity=*] +* xapi.spline.de/api/0.6/node[highway=busstop] +* xapi.spline.de/api/0.6/node[bbox=-6,50,2,61] +* xapi.spline.de/api/0.6/node[amenity=hospital][bbox=-6,50,2,61] + +a more formal description +------------------------- + +We serve the node endpoint, but no others. We implment the tag based filtering, +for only one tag and a bounding box. + +Basic setup +============= + +Just execute bootstrap.sh which will install node and everything you need into +your local directory. If you don't trust us read the bootstrap.sh. If you have +node and npm installed you can just use "npm link src/nodejs/" to install all +the dependencies. + +Dependencies +============= + +For dependencies checkout the package.json file. One special case is the node-postgres +lib. Use a patched version: https://github.com/AlexanderS/node-postgres + +If you try the libxml branch make sure you have installed libxml for developers. + +Database setup +============= + +We use postgres 9.* with postgis 1.5. Postgres 9.0 is used because we need some +functions on hstores and postgis 1.5 is used for fancy geometry things. + +To setup a database you first need a runing postgres 9.0 instance. I hope you know +how to do this. + +Use + + createdb osm + +to create a database with name osm. Use + + createlang plpgsql osm + +to add plpgsql to your database. If you want to create a database user do so: + + createuser + +Add hstore support for your database: + + psql -d osm < /share/contrib/hstore.sql + +Add postgis support for your database: + + psql -d osm < /share/contrib/postgis-1.5/postgis.sql + +Just do: + + psql -d osm < /share/contrib/postgis-1.5/spatial_ref_sys.sql + +Create the actual schema for osm data. For this step you need osmosis. If your +osmosis build is correct there should be a directory named pacakge/scripts where +you run: + + psql -d osm < pgsql_simple_schema_0.6.sql + psql -d osm < pgsql_simple_schema_0.6_linestring.sql +Optional/stil to test: + + psql -d osm < pgsql_simple_schema_0.6_action.sql + psql -d osm < pgsql_simple_schema_0.6_bbox.sql + +For documentation on the schema read pgsql_simple.txt. + +Import data from xml with: + + osmosis --read-xml file="planet.osm.bz2" --wp host="localhost" password="TopSecretPassword" user="insertUserNameHere" database="osm" + +Before or after import you may want to create a indexes. Examples below: + CREATE INDEX idx_nodes_tags ON nodes USING GIN(tags); + CREATE INDEX idx_nodes_tags ON nodes USING GIST(tags); + CREATE INDEX idx_ways_tags ON ways USING GIN(tags); + CREATE INDEX idx_ways_tags ON ways USING GIST(tags); -- cgit v1.2.3 From 55d003757654b4540aba6476df44a7df9ee25fd0 Mon Sep 17 00:00:00 2001 From: lus Date: Thu, 21 Apr 2011 18:23:07 +0200 Subject: unescape input for parser --- src/nodejs/parse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nodejs/parse.js b/src/nodejs/parse.js index 321823b..4dc12b5 100644 --- a/src/nodejs/parse.js +++ b/src/nodejs/parse.js @@ -127,5 +127,5 @@ var parser = function(){ exports.urlToXpathObj = function urlToXpathObj(url){ var parse = new parser(); - return parse.parse(url); + return parse.parse(unescape(url)); } -- cgit v1.2.3 From 1c143502a80a02b2a5821623d49d2969fb6d1734 Mon Sep 17 00:00:00 2001 From: lusy <-> Date: Thu, 21 Apr 2011 18:42:19 +0200 Subject: package dependencies updated --- src/nodejs/package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nodejs/package.json b/src/nodejs/package.json index 92b4c3c..4cd1c7b 100644 --- a/src/nodejs/package.json +++ b/src/nodejs/package.json @@ -9,8 +9,6 @@ , "xmlbuilder" : "*" , "log4js" : "*" , "opts" : "*" - } -, "dependencies" : - { "async_testing" : "*" + , "async_testing" : "*" } } -- cgit v1.2.3 From 04f592ec08165553bbd872cfe0d8c3dbddd7f7ec Mon Sep 17 00:00:00 2001 From: yves Date: Thu, 21 Apr 2011 19:05:43 +0200 Subject: finished bootstrap skript --- bootstrap.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index bca7c9d..6227de2 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -38,8 +38,15 @@ if [[ $prompt == "n" || $prompt == "N" || $prompt == "no" || $prompt == "No" ]] then exit 0; else - curl http://npmjs.org/install.sh | sh + curl http://npmjs.org/install.sh | sh fi echo "Download all dependencies for project in $PROJECT_PATH" npm link $PROJECT_PATH + + +echo +echo "To use nvm source it by typing: 'NVM_DIR=$NVM_DIR . $PWD/$NVM_PATH' " +echo "For permanent usage, add it to your ~/.bashrc" +echo +echo "with 'nvm use $NODE_VERSION' you can enable nvm" -- cgit v1.2.3 From 530fef9c8b6653278c1158871fd6fbe39176391b Mon Sep 17 00:00:00 2001 From: yves Date: Thu, 21 Apr 2011 19:07:45 +0200 Subject: fixed gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7c70a89..e745656 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -nodejs +# local nodejs install +/nodejs # Temp Files # ############## -- cgit v1.2.3 From 03aed737e3909650c369499582abdf9b6b221f50 Mon Sep 17 00:00:00 2001 From: yves Date: Thu, 21 Apr 2011 19:12:01 +0200 Subject: removed unneeded submodule --- .gitmodules | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index b086e1f..32cf581 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "src/nodejs/tests/node-async-testing"] - path = src/nodejs/tests/node-async-testing - url = https://github.com/bentomas/node-async-testing.git [submodule "nvm"] path = nvm url = https://github.com/creationix/nvm.git -- cgit v1.2.3 From bfe75502dbb0ab00dad6b2008f64730260febb31 Mon Sep 17 00:00:00 2001 From: yves Date: Sat, 23 Apr 2011 22:38:09 +0200 Subject: put devDependencies into package.json --- src/nodejs/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nodejs/package.json b/src/nodejs/package.json index 4cd1c7b..170c96d 100644 --- a/src/nodejs/package.json +++ b/src/nodejs/package.json @@ -10,5 +10,7 @@ , "log4js" : "*" , "opts" : "*" , "async_testing" : "*" +, "devDependencies" : + } } -- cgit v1.2.3 From 0a85fb5077e1036ea72ce5011a79e9aaa75628b9 Mon Sep 17 00:00:00 2001 From: booo Date: Tue, 26 Apr 2011 01:08:22 +0200 Subject: removed whitespaces --- bootstrap.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 6227de2..db8c0b3 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -11,7 +11,7 @@ export NVM_DIR=$PWD/nodejs NODE_VERSION=v0.4.0 PROJECT_PATH=src/nodejs -# end config +# end config ########################### # create directory @@ -23,12 +23,12 @@ echo $NVM_DIR nvm sync # install node if requested -echo "This will build and install node.js $NODE_VERSION into '$NVM_DIR'." +echo "This will build and install node.js $NODE_VERSION into '$NVM_DIR'." read -p "Do you like to proceed? " prompt if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] then nvm install $NODE_VERSION - nvm use $NODE_VERSION + nvm use $NODE_VERSION fi @@ -48,5 +48,5 @@ npm link $PROJECT_PATH echo echo "To use nvm source it by typing: 'NVM_DIR=$NVM_DIR . $PWD/$NVM_PATH' " echo "For permanent usage, add it to your ~/.bashrc" -echo +echo echo "with 'nvm use $NODE_VERSION' you can enable nvm" -- cgit v1.2.3 From 8cebbdb2b4a45fff7f90e2fd758bcf30c45f610f Mon Sep 17 00:00:00 2001 From: booo Date: Tue, 26 Apr 2011 01:24:34 +0200 Subject: init/update submodule nvm --- bootstrap.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index db8c0b3..67fdf2d 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -3,6 +3,10 @@ ########################### # start config +#fetch nvm and perhaps modified pg module? +git submodule init +git submodule update + # location of nvm script NVM_PATH=nvm/nvm.sh # location where node.js will be installed -- cgit v1.2.3 From 433128ad45974a024fe73c6fe84f38d38d9653ce Mon Sep 17 00:00:00 2001 From: booo Date: Tue, 26 Apr 2011 01:39:15 +0200 Subject: added modified pg as submodule --- .gitmodules | 3 +++ pg | 1 + 2 files changed, 4 insertions(+) create mode 160000 pg diff --git a/.gitmodules b/.gitmodules index 32cf581..124f89b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "nvm"] path = nvm url = https://github.com/creationix/nvm.git +[submodule "pg"] + path = pg + url = https://github.com/AlexanderS/node-postgres.git diff --git a/pg b/pg new file mode 160000 index 0000000..acdd726 --- /dev/null +++ b/pg @@ -0,0 +1 @@ +Subproject commit acdd726a29152c209d378e5bb28a47c7f201acaa -- cgit v1.2.3 From ebcff6f5011a8bf4ecaa53214592fbb78141ec2d Mon Sep 17 00:00:00 2001 From: booo Date: Tue, 26 Apr 2011 01:39:47 +0200 Subject: fixed package.json --- src/nodejs/package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/nodejs/package.json b/src/nodejs/package.json index 170c96d..4cd1c7b 100644 --- a/src/nodejs/package.json +++ b/src/nodejs/package.json @@ -10,7 +10,5 @@ , "log4js" : "*" , "opts" : "*" , "async_testing" : "*" -, "devDependencies" : - } } -- cgit v1.2.3 From 0150318ef9f58e4cd9f6d80c3e66f8b9d7fef61c Mon Sep 17 00:00:00 2001 From: booo Date: Tue, 26 Apr 2011 01:48:22 +0200 Subject: use npm to link pg submodule --- bootstrap.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 67fdf2d..21850c2 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -46,8 +46,9 @@ if [[ $prompt == "n" || $prompt == "N" || $prompt == "no" || $prompt == "No" ]] fi echo "Download all dependencies for project in $PROJECT_PATH" -npm link $PROJECT_PATH +npm link $PWD/pg +npm link $PROJECT_PATH echo echo "To use nvm source it by typing: 'NVM_DIR=$NVM_DIR . $PWD/$NVM_PATH' " -- cgit v1.2.3