Quick Start¶
This guide walks you through your first VoronoiMap estimation in under 5 minutes.
1. Prepare Your Data¶
Create a data/ directory and add a point data file. Each line has space-separated longitude and latitude:
Create data/sample5.txt:
2. Run from the Command Line¶
# Estimate count from the 5-point dataset
voronoimap sample5.txt 5
# Multiple runs for better accuracy
voronoimap sample5.txt 5 --runs 3
Output:
The output shows:
- regions — Estimated number of Voronoi regions (should be close to the actual count)
- max_edges — Maximum number of vertices found on any single region
- avg_edges — Average number of vertices per region
- oracle calls — How many nearest-neighbor queries were made
3. Use the Python API¶
from vormap import get_sum, load_data, find_area, get_NN
# --- Estimation ---
estimated, max_edges, avg_edges = get_sum("sample5.txt", 5)
print(f"Estimated {estimated} objects")
print(f"Max edges: {max_edges}, Avg edges: {avg_edges:.1f}")
# --- Direct data access ---
data = load_data("sample5.txt")
print(f"Loaded {len(data)} points")
# Find nearest neighbor to an arbitrary point
nearest = get_NN(data, 500.0, 500.0)
print(f"Nearest to (500, 500): {nearest}")
# Compute area of the Voronoi region around a data point
area, vertices = find_area(data, 400.0, 600.0)
print(f"Region area: {area:.2f}, Vertices: {vertices}")
4. Custom Boundaries¶
By default, VoronoiMap auto-detects the search space from data extents. You can override this:
Next Steps¶
- CLI Reference — All command-line options
- Python API — Full function documentation
- Algorithm Overview — How the estimation works