Hi,
Its new API, the document is not completed yet.
You can use the following information for now, and I will come back to you on the final document.
CeTLeR API URL: “https://gisdataapi.cetler.se/”
API variables are:
• **dataBaseName: **CeTLeR contains several different geodata databases, in our assignment we will be working with the database named CeTLeR.
• bufferType: several filtration buffer types are available; we will use radius type only.
• data: type of data you want to retrieve. We will use “poi” data type.
• key & value: We will use keys (amenity, highway) and all its values. Please visit https://wiki.openstreetmap.org/wiki/Map_features for more information.
Variable value can accept multi selection separated by “;”. Example: (restaurant;cafe)
• centerpoint: latitude and longitude that represents the buffer center point.
• radius: in meter; represents the buffer radius.
• apiKey: authentication code. Each student will be given one unique code to be used for this assignment.
The idea of the API is to provide all the requested features for the selected category within the given buffer.
Example of a call to OSM API in R:
url <-"https://gisdataapi.cetler.se/"
apiData = GET(url,
query = list(dataBaseName='OSM', ApiKey="omar-public", bufferType="radius", data="poi",
centerPoint ="52.497424, 13.372886", radius=3000,
key='amenity',value='restaurant;cafe;pub'))
To plot the downloaded feature on a map use the following R code:
apiData = rawToChar(apiData$content)
jsonData = fromJSON(apiData)
sfData <- st_as_sf(jsonData, coords = c("longitude", "latitude"), crs = 4326)
tm_basemap(leaflet::providers$OpenStreetMap) +
tm_shape(sfData) + tm_dots(col = "value", palette=c(restaurant='green', cafe='red', pub='black'),
stretch.palette = FALSE, size=.1, shape =21)
Retrieve data structure:
The response will be in JSON format. The format is shown below:
[
{
"poiName": "Tullinge Gymnasium",
"key": "amenity",
"value": "school",
"latitude": 59.2141762,
"longitude": 17.9181938
},
{
"poiName": "Hörningsnässkolan",
"key": "amenity",
"value": "school",
"latitude": 59.2360153,
"longitude": 17.9942684
},
.
.
.
]
The retrieved data will contain the following fields:
• Point of interested name.
• Key.
• Value.
• Latitude.
• Longitude.
Regards,
Omar