Boundary Atlas

How to assign leads and accounts to sales territories by city, county or district

Define territories as sets of counties, cities, ZIPs or districts, then place each lead's address in them: geocode the address, call locate_point, and look the result up in your territory table. Because every area has a stable ID, territories survive renames, and you can draw them as GeoJSON for the team.

Who this is for

Ask your agent

With Boundary Atlas added to Claude, ChatGPT, Cursor or Codex (free, no key; how):

Here are our territories as lists of counties. For each new lead's address, find the county with Boundary Atlas and tell me which territory owns it.

Step by step

  1. Define territories. List each territory's county (or city, ZIP, district) IDs, e.g. us:county:17031.
  2. Place each lead. Geocode the address, then locate_point(lat, lon); read the county, city or district ID.
  3. Assign. Look the ID up in your territory table. Leads in unincorporated areas have no city, so county-based territories are the safest.
  4. Show the map. get_boundaries on each territory's counties, merged, gives a map for the team.

Live example

233 S Wacker Dr, Chicago (Willis Tower), at 41.8786, -87.6362:

LevelResult
City or townChicago
CountyCook County
ZIP code60606
Congressional districtIllinois's 7th congressional district (IL-07)
State senate districtState Senate District 5
State house districtState House District 9
Voting precinct42014
StateIllinois
MayorBrandon Johnson
U.S. RepresentativeDanny K. Davis (D)
U.S. SenatorRichard J. Durbin (D)
U.S. SenatorTammy Duckworth (D)
State SenatorLakesia Collins (Democratic)
State RepresentativeYolonda Morris (Democratic)
City websitechi.gov
City councilChicago City Council
County websitewww.cookcountyil.gov
locate_point(lat=41.8786, lon=-87.6362)

Things to know

More guides