https://github.com/rajgoesout/apitest
https://github.com/rajgoesout/apitest
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rajgoesout/apitest
- Owner: rajgoesout
- Created: 2019-04-10T10:01:07.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-09-16T18:00:22.000Z (over 2 years ago)
- Last Synced: 2024-03-02T14:17:29.759Z (about 1 year ago)
- Language: Python
- Size: 330 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# apitest
## Usage
```
$ psql mydb
mydb=# CREATE EXTENSION cube;
mydb=# CREATE EXTENSION earthdistance;
``````
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ export FLASK_ENV=development
$ python app.py
```## Endpoints
### Create Location
`POST /api/post_location`
Example request body:
```json
{
"accuracy": null,
"admin_name1": "San Andreas",
"key": "IN/200003",
"latitude": 25.5,
"longitude": 71.4,
"place_name": "San Fierro"
}
```### Get Places within 5km (earthdistance)
`GET /api/get_using_postgres`
Returns an array of places within 5km radius of queried point using postgres earthdistance extension.
Query Parameters:
`?latitude=28.6333&longitude=77.2167`
### Get Places within 5km (self computed)
`GET /api/get_using_self`
Returns an array of places within 5km radius of queried point.
Query Parameters:
`?latitude=28.6333&longitude=77.2167`