Skip to content
Anne Blankert edited this page Feb 26, 2018 · 17 revisions

GrowApp server API

This API description documents only the publicly accessible functions. Many functions such as for uploading, updating or editing require a device id or user credentials. For these (private) functions, please refer to file photoserver.js.


/getphotos

HTTP request

Request Type

http GET

Query Parameters:

hashtags (optional)
Provide a comma-separated list of hashtags to this parameter to select those photo locations where at least one of the photos has at least one of the hashtags in its description

Response

Returns a JSON list of publicly viewable photos on the server formatted as GeoJSON FeatureCollection.

Every photo has the following attributes:

Point coordinate (longitude, latitude, WGS84), of the camera location where the photo was taken
id: unique numeric id of the photo
filename: the filename including extension of the photo. When the file extension is 'gif', the file is an animation built from multiple photos at the same location. The original static photo can be obtained by replacing the '.gif' extension with '.jpg'
isroot: boolean, if true, the picture is the first picture of a picture animation set
accuracy: a measure for the accuracy of the photo location, smaller is better
time: date and time when the photo was added to the server
width: width of the full resolution photo in pixels
height: height of the full resolution photo in pixels
description: text, user-defined description for the photo
tags: array of key-value pairs. keys can be numeric. Keys and their purpose are defined on the server, see /taglist

examples

Get all photos https://phenology.geodan.nl/photoserver/getphotos
Get photos with one of hashtags #wur or #agri https://phenology.geodan.nl/photoserver/getphotos?hashtags=%23wur,%23agri


/uploads/filename

HTTP Request

Request Type

http GET

Response

Returns a photo or animation indicated by 'filename'. Filenames can be obtained by a request to /getphotos. If the filename extension is '.gif', the resulting image will be an animation of all photos taken at the same location. If the '.gif' extension is replaced by '.jpg', the first static photo is returned.

example

https://phenology.geodan.nl/uploads/fd55236bc1d9f8ab13d53204fa908dd4.gif
See also /uploads/[small/medium]/filename


/uploads/[small|medium]/filename

HTTP Request

Request Type

http GET

Response

Returns a small (shortest side 200 pixels) or medium (shortest side 640 pixels) photo indicated by 'filename'. Filenames can be obtained by a request to /getphotos.

example

https://phenology.geodan.nl/uploads/small/fd55236bc1d9f8ab13d53204fa908dd4.jpg https://phenology.geodan.nl/uploads/medium/fd55236bc1d9f8ab13d53204fa908dd4.jpg
See also /uploads/filename for full resolution photos

/getphotoset

HTTP request

Request Type

http POST

Query Parameters:

photoid (required)
id of a photo for which to retrieve the associated set of photos that together form the photo animation

Response

JSON array (not GeoJSON!) of photos that together form the photo animation. The array is sorted by time, the first photo in the array is identical to the original photo. This array does not contain the photo locations.

Every array member has the following attributes:
id: unique numeric id of the photo
filename: the filename including extension of the photo. When the file extension is 'gif', the file an animation built from multiple photo's at the same location. The original static photo can be obtained by replacing the '.gif' extension with '.jpg'
accuracy: a measure for the accuracy of the photo location, smaller is better
time: date and time when the photo was added to the server
width: width of the full resolution photo in pixels
height: height of the full resolution photo in pixels
description: text, user defined description for the photo
tags: array of key value pairs. keys can be numeric. Keys and their purpose are defined on the server, see /taglist
lon: the longitude of the photo location
lat: the latitude of the photo location

examples

Get photoset for photo, POST photoid=1173 to https://phenology.geodan.nl/photoserver/getphotoset
response:
[ {"id":1173,
"accuracy":3,
"filename":"1069c1510f9a9ab15398968994bf1b5f.jpg",
"time":"2016-10-30T12:30:34.674Z",
"width":1920,
"height":1440,
"description":null,
"tags":[],
"lon":4.9170138,
"lat":52.3657044
},{
"id":17018,
"accuracy":3,
"filename":"d395a6b89fedf988a84cb309fa03a7a0.jpg",
"time":"2017-07-13T12:10:31.207Z",
"width":2592,
"height":1944, "description":"#nina ",
"tags":[], "lon":4.9169862,
"lat":52.3657217
}]

/creategif

HTTP request

Request Type

http POST

Query Parameters:

photoid (required)
id of a photo for which to create a set of gifs (full, medium, small)

Response

JSON array of URIs for the created gifs. The gifs are resized to the smallest photo in the set.

examples

Create GIFs for photo or photoset, POST photoid=27 to https://phenology.geodan.nl/photoserver/creategif response: ["/uploads/small/c22d786d4ddd5f68fd089eda53c8fa21.gif", "/uploads/medium/c22d786d4ddd5f68fd089eda53c8fa21.gif", "/uploads/c22d786d4ddd5f68fd089eda53c8fa21.gif"]

/taglist

HTTP request

Request Type

http GET

Query Parameters:

langcode (required)
two letter language code to use the tag names

Response

JSON array of tags

Every array member has the following attributes:
tagid: unique tag number
tagtext: language specific description for the tag
active: if true, the tag can be used for new photos, otherwise for display only

The tag list allows people to tag photos with language independent tags. If, for example, a photo is tagged with tagid 2, it will be displayed in English as tagged 'spring' and in Dutch as tagged 'lente'

examples

Get list of all tags in English https://phenology.geodan.nl/photoserver/taglist?langcode=en
response:
[{"tagid":5,"tagtext":"tree circumference","active":true},{"tagid":1,"tagtext":"spring","active":false},{"tagid":2,"tagtext":"summer","active":false},{"tagid":3,"tagtext":"autumn","active":false},{"tagid":4,"tagtext":"winter","active":false}]
Get list of all tags in Dutch https://phenology.geodan.nl/photoserver/taglist?langcode=nl
response:
[{"tagid":5,"tagtext":"boomomtrek","active":true},{"tagid":1,"tagtext":"lente","active":false},{"tagid":2,"tagtext":"zomer","active":false},{"tagid":3,"tagtext":"herfst","active":false},{"tagid":4,"tagtext":"winter","active":false}]