Skip to content

Commit

Permalink
Merge pull request #32 from GIScience/development
Browse files Browse the repository at this point in the history
Example updates in README an Swagger file
  • Loading branch information
TimMcCauley committed Apr 24, 2018
2 parents 6d0d5d7 + 3d4f842 commit 2dea5df
Show file tree
Hide file tree
Showing 2 changed files with 184 additions and 36 deletions.
107 changes: 77 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,54 +217,101 @@ Finally, `request=list` will return a JSON object generated from

### Examples

##### POIs
##### POIS around a buffered point

```sh
curl -X POST \
http://localhost:5000/pois \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"geometry": {
"geojson": {
"type": "Point",
"coordinates": [8.8034, 53.0756]
},
"buffer": 50
"request": "pois",
"geometry": {
"bbox": [
[8.8034, 53.0756],
[8.7834, 53.0456]
],
"geojson": {
"type": "Point",
"coordinates": [8.8034, 53.0756]
},
"limit": 2000,
"request": "pois",
"sortby": "distance",
"filters": {
"category_ids": [488],
"wheelchair": ["yes"]
}
"buffer": 250
}
}'
```

##### POI Statistics
##### POIs of given categories
```sh
curl -X POST \
http://localhost:5000/pois \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"geometry": {
"geojson": {
"type": "Point",
"coordinates": [8.8034, 53.0756]
},
"buffer": 50
"request": "pois",
"geometry": {
"bbox": [
[8.8034, 53.0756],
[8.7834, 53.0456]
],
"geojson": {
"type": "Point",
"coordinates": [8.8034, 53.0756]
},
"buffer": 100
},
"limit": 200,
"filters": {
"category_ids": [180, 245]
}
}'
```

##### POIs of given category groups

```sh
curl -X POST \
http://localhost:5000/pois \
-H 'Content-Type: application/json' \
-d '{
"request": "pois",
"geometry": {
"bbox": [
[8.8034, 53.0756],
[8.7834, 53.0456]
],
"geojson": {
"type": "Point",
"coordinates": [8.8034, 53.0756]
},
"buffer": 100
},
"limit": 200,
"filters": {
"category_group_ids": [160]
}
}'
```

##### POI Statistics
```sh
curl -X POST \
http://129.206.7.157:5005/pois \
-H 'Content-Type: application/json' \
-d '{
"request": "stats",
"geometry": {
"bbox": [
[8.8034, 53.0756],
[8.7834, 53.0456]
],
"geojson": {
"type": "Point",
"coordinates": [8.8034, 53.0756]
},
"limit": 2000,
"request": "stats",
"sortby": "distance",
"filters": {
"category_ids": [488]
}
"buffer": 100
}
}'
```

##### POI Category List
##### POI Categories as a list

```sh
curl -X POST \
Expand Down
113 changes: 107 additions & 6 deletions openpoiservice/server/api/pois_post.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ tags:
- name: "Pois"
info:
description: |
Returns points of interest in the area surrounding a geometry (geometry and/or bbox).
Returns points of interest in the area surrounding a geometry which can either be a bounding box, polygon or buffered linestring or point.
Find more examples on https://github.com/GIScience/openpoiservice.
version: "0.1"
title: "Openpoiservice"
contact:
email: "support@openrouteservice.org"
license:
name: "MIT"
url: "https://github.com/swagger-api/swagger-ui/blob/master/LICENSE"
url: "https://github.com/GIScience/openpoiservice/blob/master/LICENSE"
consumes:
- "application/json"
schemes:
Expand All @@ -23,6 +24,101 @@ security:
paths:
"/pois":
post:
description: |
Examples:
```
##### POIS around a buffered point
curl -X POST \
https://api.openrouteservice.org/pois?api_key=INSERT_YOUR_KEY \
-H 'Content-Type: application/json' \
-d '{
"request": "pois",
"geometry": {
"bbox": [
[8.8034, 53.0756],
[8.7834, 53.0456]
],
"geojson": {
"type": "Point",
"coordinates": [8.8034, 53.0756]
},
"buffer": 250
}
}'
##### POIs of given categories
curl -X POST \
https://api.openrouteservice.org/pois?api_key=INSERT_YOUR_KEY \
-H 'Content-Type: application/json' \
-d '{
"request": "pois",
"geometry": {
"bbox": [
[8.8034, 53.0756],
[8.7834, 53.0456]
],
"geojson": {
"type": "Point",
"coordinates": [8.8034, 53.0756]
},
"buffer": 100
},
"limit": 200,
"filters": {
"category_ids": [180, 245]
}
}'
##### POIs of given category groups
curl -X POST \
https://api.openrouteservice.org/pois?api_key=INSERT_YOUR_KEY \
-H 'Content-Type: application/json' \
-d '{
"request": "pois",
"geometry": {
"bbox": [
[8.8034, 53.0756],
[8.7834, 53.0456]
],
"geojson": {
"type": "Point",
"coordinates": [8.8034, 53.0756]
},
"buffer": 100
},
"limit": 200,
"filters": {
"category_group_ids": [160]
}
}'
##### POI Statistics
curl -X POST \
https://api.openrouteservice.org/pois?api_key=INSERT_YOUR_KEY \
-H 'Content-Type: application/json' \
-d '{
"request": "stats",
"geometry": {
"bbox": [
[8.8034, 53.0756],
[8.7834, 53.0456]
],
"geojson": {
"type": "Point",
"coordinates": [8.8034, 53.0756]
},
"buffer": 100
}
}'
##### POI Categories as a list
curl -X POST \
https://api.openrouteservice.org/pois?api_key=INSERT_YOUR_KEY \
-H 'content-type: application/json' \
-d '{
"request": "list"
}'
```
parameters:
- name: "api_key"
in: "query"
Expand Down Expand Up @@ -77,10 +173,15 @@ definitions:
example: {
"request": "pois",
"geometry": {
"bbox": [
[8.74189636230469, 53.07144289415349],
[8.814767341613771, 53.091060308703845]
]
"bbox": [
[8.458614349365236, 55.470054514892844],
[8.473613262176515, 55.47323501110393]
],
"geojson": {
"type": "Point",
"coordinates": [8.458614349365236, 55.470054514892844]
},
"buffer": 100
},
"limit": 200
}
Expand Down

0 comments on commit 2dea5df

Please sign in to comment.