Last active
February 12, 2016 18:44
-
-
Save Ramona2020/76feb71b3bd4e84bc320 to your computer and use it in GitHub Desktop.
Single Feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let $uri := fn:encode-for-uri( "http://bioimages.vanderbilt.edu/vanderbilt/7-314#2002-06-14") | |
let $json := fetch:text("http://api.gbif.org/v1/occurrence/search?occurrenceID=" || $uri) | |
let $json := fn:parse-json($json) | |
let $latitude := $json?results?1?decimalLatitude | |
let $longitude := $json?results?1?decimalLongitude | |
let $identifier := $json?results?1?identifier | |
return map { | |
"type": "Feature", | |
"geometry": map { | |
"type": "Point", | |
"coordinates": [$longitude, $latitude] | |
}, | |
"properties": map { | |
"name": $identifier | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment