An open API service indexing awesome lists of open source software.

https://github.com/freinet12/geo-validator

Geo Validator Tool
https://github.com/freinet12/geo-validator

Last synced: about 2 months ago
JSON representation

Geo Validator Tool

Awesome Lists containing this project

README

        

GEO VALIDATOR

## SETUP
- Install PHP version 7.2+
- Install MYSQL (mysql Ver 15.1 Distrib 10.4.11-MariaDB)
- Create Database:


CREATE DATABASE IF NOT EXISTS geo

CHARACTER SET = 'utf8mb4'

COLLATE = 'utf8mb4_unicode_ci';

- Copy the contents of .env.example into a new file in the root app dir called .env
- Open up the .env file and update the following:

DB_HOST=your_mysql_host_ip

DB_PORT=3306 or whatever port mysql is running on

DB_USERNAME=your_mysql_username

DB_PASSWORD=your_mysql_password

## Migrations
- Run the following command:

php artisan migrate

## Endpoints

1) Create All 50 State Records

{APP_URL}/api/states/createAll

required fields: none

- returns:

- All sates created successfully!

2) Create City & Zip Records by Uploading a geo file

{APP_URL}/api/createGeoRecords

required fields:

- file (the geo file which has zip, city, state)

returns:

- Done.

3) Validate Provided Geo

{APP_URL}/api/validateGeo

- required params:

- city (city name)

- state (2 letter state code)

- zip (5 digit zip-code)


example:

{APP_URL}/api/validateGeo?city=stebbins&state=ak&zip=99671

- returns:

- valid geo (if the provided geo is valid)

- invalid geo (if the provided geo is invalid)

- unable to validate geo (if an error occured when trying to validate the provided geo)