brunoric / php-poc-geoapi
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^7.1.3
- ext-ctype: *
- ext-iconv: *
- guzzlehttp/guzzle: ^6.3
- sensio/framework-extra-bundle: ^5.1
- symfony/console: ^4.1
- symfony/flex: ^1.0
- symfony/framework-bundle: ^4.1
- symfony/lts: ^4@dev
- symfony/monolog-bundle: ^3.3
- symfony/yaml: ^4.1
Requires (Dev)
- symfony/dotenv: ^4.1
- symfony/maker-bundle: ^1.5
- symfony/test-pack: ^1.0
- symfony/web-server-bundle: ^4.1
Conflicts
This package is not auto-updated.
Last update: 2024-12-22 07:07:18 UTC
README
Very tiny Proof of Concept for calculating distances between two points in the globe. This application provides a small REST API to play with some customer data and their location.
Installing and playing
To install and play this PoC you will just need to have a PHP 7.1+ environment with composer installed and then run the following command in your CLI:
composer create-project brunoric/php-poc-geoapi
To start playing with it, run the command below from inside the project path:
bin/console server:start
This will run the PHP built-in server making the application available at http://127.0.0.1:8000.
Customer list
To list the customers from the default customer repository access the endpoint *:
http://127.0.0.1:8000/customer/list
You can then play with the customer properties (id, name, latitude, longitude) and with 'asc' or 'desc' as ordering direction.
# will output the customers order by ID ascendent.
http://127.0.0.1:8000/customer/list/id/asc
# will output the customers order by ID descentend.
http://127.0.0.1:8000/customer/list/id/desc
# will output the customers order by NAME ascendent.
http://127.0.0.1:8000/customer/list/name/asc
# will output the customers order by NAME descentend.
http://127.0.0.1:8000/customer/list/id/desc
# will output the customers order by LATITUDE ascendent.
http://127.0.0.1:8000/customer/list/id/asc
# will output the customers order by LATITUDE descentend.
http://127.0.0.1:8000/customer/list/id/desc
# will output the customers order by LONGITUDE ascendent.
http://127.0.0.1:8000/customer/list/id/asc
# will output the customers order by LONGITUDE descentend.
http://127.0.0.1:8000/customer/list/id/desc
To order the customers by distance from a specific point just call **:
# will output the customers order by DISTANCE ascendent.
http://127.0.0.1:8000/customer/list/distance/asc
# will output the customers order by DISTANCE descentend.
http://127.0.0.1:8000/customer/list/distance/desc
* Current customers are being loaded from a closed list in a S3 bucket.
* The default latitude is 53.339428 and the default longitude is -6.257664.