This microservice is designed to validate if a specific geographic location (latitude and longitude) falls within the coverage area of an ISP's infrastructure. Built with FastAPI, it uses advanced spatial analysis techniques and integrates seamlessly with other systems such as ERPs and chatbots.
- Accepts geographic coordinates (lat, lon) as input.
- Parses and analyzes
.kml
files to extract:- Locations of NAP boxes.
- Urban and rural area boundaries.
- Generates coverage areas based on proximity to NAP boxes:
- 150m for urban zones.
- 200m for rural zones.
- Performs spatial intersections using GeoPandas.
- Integration-ready for systems like ERPs and chatbots.
- Input: Geographic coordinates are sent to the microservice.
- File Parsing: The
.kml
file is processed to extract NAP box points and area polygons. - Spatial Analysis: The system:
- Converts coordinates to a common CRS (EPSG:3857).
- Checks if the input coordinate intersects with coverage areas.
- Output: Returns whether the location is within coverage.
The microservice integrates with ERPs, such as Odoo, to provide users with a map-based interface to check coverage:
- Users select their location on a map powered by Google Maps.
- The system sends the coordinates to the microservice for validation.
- Python 3.8+
- Libraries: FastAPI, GeoPandas, Shapely, lxml
- Tools: Google Earth Pro (to create
.kml
files)
-
Clone the repository:
git clone https://github.com/edwin06111998/ms-core-coverage.git cd ms-core-coverage
-
Install dependencies:
pip install -r requirements.txt
-
Add the
.kml
file: Place your.kml
file in the project root directory at./data/map.kml
. -
Run the server:
python3 main.py
The system uses .kml
files to define NAP box locations and area boundaries:
- Points represent NAP boxes.
- Polygons define urban and rural zones.
- Integration with chatbots to validate coverage via messaging platforms like WhatsApp.
- Dynamic adjustment of coverage radii based on network conditions.
Contributions are welcome! Please submit a pull request or create an issue for any improvements or features you'd like to see.
For questions or feedback, feel free to reach out:
- Email: [email protected]
- GitHub: edwin06111998