Skip to content

ov3qPI/voronoi_polygon_generator

Repository files navigation

voronoi_polygon_generator

Generates Voronoi polygons from a set of geographic coordinates and exports them in KML format for visualization in applications like Google Earth.

Features

  • Takes a CSV of latitude, longitude, and location names.
  • Computes Voronoi polygons with a bounding circle for completeness.
  • Outputs results as a KML file, including placemarks for original coordinates.

Requirements

  • Python 3
  • Libraries: numpy, scipy, simplekml

Install dependencies with:

pip install numpy scipy simplekml

Usage

python voronoi_polygon_generator.py <csv_file_path>
  • <csv_file_path>: Path to a CSV file containing Latitude, Longitude, and Location fields.

Output

  • voronoi.kml: KML file containing the generated Voronoi polygons and placemarks.

Example

CSV format:

Latitude,Longitude,Location
34.0522,-118.2437,Los Angeles
40.7128,-74.0060,New York

Run the script:

python voronoi_polygon_generator.py example_coordinates.csv

Notes

  • The script adds a bounding circle to ensure the Voronoi diagram covers all input points.
  • Polygons are styled with an outlined color and transparent fill for clarity.

About

Generates Voronoi polygons from a set of coordinates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages