Location Data API - Sri Lanka
Table of Contents
Introduction
Developers can use this API to get datails of cities, districts and provinces which located all around the Sri Lanka. This API can easily intergarte to you appication using particular URI.
Technologies
Implemantations
- MongoDB
- NodeJS
Hosting
- Heroku
- DigitalOcean
Use Cases
- Developers can get major cities and sub areas in each district
- GPS cordinates (Latitude and Longitude) are avilabe for each major city and sub areas. GPS cordinates can be use with Google Maps and other GPS/ Map services
- Developers can easily get Administrative Districts of the Colombo Mucipal Council with GPS cordinates, Administrative Distict Name and Sub Area (Known name like Kollupitiya, Modara, etc.)
- Users can get all the disticts and provinces in Sri Lanka
Getting Started
API Documentation
1. Get Major Cities And Sub Areas in Sri Lanka
https://locatesrilanka.herokuapp.com/cities
2. Get All Provinces in Sri Lanka
https://locatesrilanka.herokuapp.com/provinces
3. Get All Districts in Sri Lanka
https://locatesrilanka.herokuapp.com/districts
4. Get GPS Cordinates of major city or sub area in Sri Lanka
https://locatesrilanka.herokuapp.com/cities/cordinates/[CITY NAME IN ENGLISH]
Example
Assume user needs to find GPS cordinates of Kadduwela, Sri Lanka
https://locatesrilanka.herokuapp.com/cities/cordinates/Kaduwela
5. Get all major cities or sub areas in selected distict Sri Lanka
https://locatesrilanka.herokuapp.com/cities/cordinates/[DISTRICT ID]
Example
Assume user needs to find GPS cordinates of Colombo District, Sri Lanka
https://locatesrilanka.herokuapp.com/cities/byDistrict/5
6. Get Administrative Districts of the Colombo Mucipal Council, Sri Lanka
https://locatesrilanka.herokuapp.com/cities/colombo_mca/[COLOMBO SUB AREA]
Example
Assume user needs to find details of Colombo 1, Sri Lanka
https://locatesrilanka.herokuapp.com/cities/colombo_mca/1
7. Get all Administrative Districts of the Colombo Mucipal Council, Sri Lanka
https://locatesrilanka.herokuapp.com/cities/colombo_mca
8. Get all Districts in Selected Province
https://locatesrilanka.herokuapp.com/districts/byprovince/[PROVINCE ID]
Example
Assume user needs to find districts in western province, Sri Lanka
https://locatesrilanka.herokuapp.com/districts/byprovince/1
9. Get count of all Districts in Selected Province
https://locatesrilanka.herokuapp.com/districts/districtcount/[PROVINCE ID]
Example
Assume user needs to find count of districts in western province, Sri Lanka
https://locatesrilanka.herokuapp.com/districts/districtcount/1
Project Setup
- Clone the repo
git clone https://github.com/PasinduS96/location-api-sl.git
- Install NPM packages
npm install
- Create .env file for environment varialbes
- Create environment variables
PORT= MONGO_URI=
- Run Project
npm start
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Acknowledgements
License
MIT © PasinduS96