2017 © Pedro Peláez
 

project php-poc-geoapi

image

brunoric/php-poc-geoapi

  • Monday, June 25, 2018
  • by brunoric
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

php-poc-geoapi

Build Status, (*1)

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., (*2)

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:, (*3)

composer create-project brunoric/php-poc-geoapi

To start playing with it, run the command below from inside the project path:, (*4)

bin/console server:start

This will run the PHP built-in server making the application available at http://127.0.0.1:8000., (*5)

Customer list

To list the customers from the default customer repository access the endpoint *:, (*6)

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., (*7)

# 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 **:, (*8)

# 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., (*9)

* The default latitude is 53.339428 and the default longitude is -6.257664., (*10)

The Versions