Wiki

Clone wiki

gnd / CouchViewsShows

Finding data (views)

track_listing

Purpose: to provide a useful way of showing an overview description for each data file.

URL: http://gnd.iriscouch.com/tracks/_design/tracks/_view/track_listing

Output:

{"id":"5958984be825e1348a1f3500d10d5037","key":"5958984be825e1348a1f3500d10d5037","value":"Track 1 - plat_c (22) pts"},
{"id":"5958984be825e1348a1f3500d10d5156","key":"5958984be825e1348a1f3500d10d5156","value":"Track 2 - plat_c (22) pts"},
{"id":"5958984be825e1348a1f3500d10d545c","key":"5958984be825e1348a1f3500d10d545c","value":"Track 3 - plat_c (22) pts"},
{"id":"5958984be825e1348a1f3500d10d5661","key":"5958984be825e1348a1f3500d10d5661","value":"Track 4 - plat_b (22) pts"},

Single document

Once you have a document id, you can retrieve the document via (for example): http://gnd.iriscouch.com/tracks/0d9500c05ef3a901397b5d7dda0f758e

Unique metadata values

Purpose: to find a list of the metadata values currently in use:

URL:

Output:

{"rows":[
{"key":"","value":2},
{"key":"235024514","value":2},
{"key":"235056112","value":2},
{"key":"538004171","value":2},
{"key":"A M A L I A","value":2},
{"key":"AASLI","value":2},
{"key":"AASVIK","value":1},
{"key":"ABERSOCH BAY","value":2},
{"key":"ACOUSTIC SURVEY","value":2},
{"key":"ADAMAS","value":1},
{"key":"AGULHAS STREAM","value":2},
... and so on

Viewing data (shows)

geoJson

Purpose: to show a spatial datafile in geoJson format

URL: http://gnd.iriscouch.com/tracks/_design/tracks/_show/geoJson/5958984be825e1348a1f3500d10d5156

Output:

{
    "type": "Feature",
    "geometry": {
        "type": "LineString",
        "coordinates": [
            [
                -5.09627472599351,
                50.373955280729675
            ],
            [
                -5.951697976245685,
                49.613376158532944
            ],
            [
                -5.086885150980324,
                53.46368666410489
            ]
        ]
    },
    "properties": {
        "name": "Track 2",
        "sensor": "Garmin-G200",
        "plaform": "plat_c",
        "sensorType": "temp",
        "platformType": "van",
        "trial": "trial_c",
        "id": "5958984be825e1348a1f3500d10d5156",
        "time": [
            "2012-03-02T10:11:06+0000",
            "2012-03-02T10:39:44+0000",
            "2012-03-02T10:43:57+0000"
        ]
    }
}

metadata

Similar to the metadata view listed above, the 'show' outputs just the metadata for the specified document.

URL: http://gnd.iriscouch.com/tracks/_design/tracks/_show/metadata/0d9500c05ef3a901397b5d7dda0f758e

Gives this result:

{
    "trial": "BR_trial1",
    "sensor_type": "GARMIN G300",
    "sensor": "GPS",
    "platform_type": "SHIP",
    "name": "RAYMARINER",
    "platform": "RAYMARINER",
    "type": "track",
    "time_bounds": {
        "start": "2012-02-27T14:46:02+0000",
        "end": "2012-02-27T14:55:00+0000"
    },
    "geo_bounds": {
        "tl": [
            50.3,
            -2.4
        ],
        "br": [
            50.1,
            -2.1
        ]
    },
    "data_type": [
        "time",
        "lat",
        "lon"
    ]
}

Updated