[Interop-dev] Any progress on AlterMap?

Nicolás Echániz (spam-protected)
Tue Oct 30 09:55:40 CET 2012


Hi Nguyễn,


On 10/30/12 00:49, Nguyễn Hồng Quân wrote:
> I'm looking for a map app to collect geolocation info of routers. I
> heard about AlterMap and tried installing it. It seems that it lacks
> many functions:
> - I cannot edit a node.
> - There is very few option for a new-created node: We now have only node
> name, lat/lon. No password protection v.v...

The code available at the link provided by Guido is just a small proof
of concept of the technologies involved.


> - There is no data field for receiving updates which will be sent
> automatically from routers.

couchdb is schemaless, so you can send any arbitrary JSON data you wish
to add to a node through HTTP, no need for pre-defined fields.


an example flollows...

get all nodes:

$ curl -X GET
http://127.0.0.1:5984/altermap/_design/altermap/_view/byCollection

{"total_rows":3,"offset":0,"rows":[
{"id":"47ad792d23adcbaa2bed2d48b308bead","key":"nodes","value":{"_id":"47ad792d23adcbaa2bed2d48b308bead","_rev":"1-d49ddf0d694aac4960db062cd739f166","name":"toto","coords":{"lat":-31.801834884076452425,"lon":-64.415228962898254395},"wait":true,"collection":"nodes"}},
{"id":"47ad792d23adcbaa2bed2d48b308c73c","key":"nodes","value":{"_id":"47ad792d23adcbaa2bed2d48b308c73c","_rev":"4-2c00d1b99a8098725076907495d0b598","name":"joseluis","coords":{"lat":-31.802112988096421731,"lon":-64.414783716201782227},"collection":"nodes"}},
{"id":"47ad792d23adcbaa2bed2d48b308d610","key":"nodes","value":{"_id":"47ad792d23adcbaa2bed2d48b308d610","_rev":"1-64ac665949912ee3ab16e7865fdda7cd","name":"flor","coords":{"lat":-31.798967172499931877,"lon":-64.413828849792480469},"collection":"nodes"}},
]}

get a specific node:
$ curl -X GET
http://127.0.0.1:5984/altermap/47ad792d23adcbaa2bed2d48b308c73c

{"_id":"47ad792d23adcbaa2bed2d48b308c73c","_rev":"4-2c00d1b99a8098725076907495d0b598","name":"joseluis","coords":{"lat":-31.802112988096421731,"lon":-64.414783716201782227},"collection":"nodes"}

Add some arbitrary data to the node:

curl -X PUT
http://localhost:5984/altermap/47ad792d23adcbaa2bed2d48b308c73c -H
"Content-Type: application/json" -d
'{"_rev":"4-2c00d1b99a8098725076907495d0b598",
"name":"joseluis","collection":"nodes","coords":{"lat":-31.802112988096421731,"lon":-64.414783716201782227},
"network":"quintanalibre.org.ar", "admin": "(spam-protected)"}'

{"ok":true,"id":"47ad792d23adcbaa2bed2d48b308c73c","rev":"5-05ecb6ce7abafe4becd07fb15042eddb"}


Test that the node now has the new network and admin attributes set:

$ curl -X GET
http://127.0.0.1:5984/altermap/47ad792d23adcbaa2bed2d48b308c73c

{"_id":"47ad792d23adcbaa2bed2d48b308c73c","_rev":"5-05ecb6ce7abafe4becd07fb15042eddb","name":"joseluis","collection":"nodes","coords":{"lat":-31.802112988096421731,"lon":-64.414783716201782227},"network":"quintanalibre.org.ar","admin":"(spam-protected)"}


So... the idea is that routers can use curl to update their data
dynamicaly or even automatically add themselves to the database.



> So, please let me know the development plan of AlterMap, how will its
> API look like?

There will be news regarding AlterMap during this week, as we are
preparing a minimal functional version for an event we will be attending
shortly. We will report progress on this list.


Cheers,
NicoEchániz







More information about the Interop-dev mailing list