How Do I Create Polygons for My Water Utility's Service Area?

May 25, 2025 7 answers
Asked by WaterWizard42
I'm working at a water and wastewater utility where I've been assigned the task of creating polygons that represent our service territory for our website. We have a list of service addresses with their latitudes and longitudes, and we operate around six small systems. I'm thinking of color coding the polygons based on different systems, but I'm running into a problem: when I plot all the addresses, it ends up connecting neighborhoods that are miles apart. I believe I need to determine the outermost coordinates for each cluster, but I'm not sure how to do that. Does anyone have suggestions or algorithms that could help me get the right coordinates?

Answers

ClusterCaptain
For a straightforward approach, you can take the maximum and minimum latitude and longitude for each neighborhood. This will give you four corners that create a region containing all the points.
Reply to this answer
KMLKing91
Consider using Google KML or KMZ files. They format lat/long points, shapes, and labels into a simple XML style that Google Maps can overlay automatically, which might save you some time.
Reply to this answer
DataDiver99
Are you trying to visualize a single service territory or do you already have multiple service territories to plot? If it's multiple, I suggest building a convex hull for each one using libraries like SciPy. If it's a single territory you're visualizing, you might want to look into clustering techniques, but keep in mind it can be tricky to get the results to match your needs exactly.
Reply to this answer
LatLngNinja
When you're in Google Maps, you can just right-click anywhere on the map and find the latitude and longitude of the cursor position. It's a quick way to get some points you might need.
Reply to this answer
MapMaster
You might also try mymaps.google.com; it's friendly for creating custom maps and might let you outline those service areas easily.
Reply to this answer
PolygonPro85
To get a polygon that encompasses all your points, you should calculate the "convex hull." Here's a simple approach: take each pair of points and draw a line between them. Check if other points fall on either side of the line using the dot product method. If the points are on both sides, skip that line. If they're only on one side, it's on the edge of the shape. Once you have your edges, you can create triangles from a central point. Just keep in mind that this won't cluster your data, so you'll want to do that first if you have distinct groups.

GeoGuru22: Also, using the convex hull will give you a tightly bound shape. If you just need a rectangle around the points, find the min and max of your coordinates to create a bounding box instead.

Reply to this answer
MapMaven77
It mostly depends on the programming language you're using. The min/max method works but might give you a rectangle. The convex hull method is valid but may not be very pretty. An alternative is to find an SVG image of your regions online and use that. Or, if you prefer a hands-on approach, plot the lat/long values, import them into a graphics program like Inkscape, and draw the polygons manually. This way, you can create something that looks good and meets your needs without getting too bogged down in the technical stuff.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions