Select to view content in your preferred language

Creating wedge-shaped territories

6789
32
01-19-2016 07:02 AM
JuanetteWillis
New Contributor II

Good morning, I am trying to create new territories for our inspectors based on the number of locations to be inspected. Our office is centrally located in the county. We are wanting to have wedge-shaped territories radiating from our office, like pieces of a pie. Any suggestions on how to have the GIS assist with the division?

Thanks,

Juanette

32 Replies
ChrisDonohue__GISP
MVP Alum

Question - what data is available to use in dividing up the territories?  Any chance you have point data showing each inspection?

Also, let me add in who probably has several ideas on how to solve your original proposal:

Dan Patterson

EDIT:  Xander Bakker  beat me to it.  I need to learn how to type faster......

Chris Donohue, GISP

JuanetteWillis
New Contributor II

Thanks Chris. This is for inspecting restaurants, pools, hotels etc so I will have point data as soon as I finish cleaning up the geocoding.  🙂

0 Kudos
DanPatterson_Retired
MVP Emeritus

Several possibilities...

  1. If you have an origin point (office) and destination points (the other stuff), you can create points that radiate from the origin to the destination quite easily.  BUT, your map may look like this which isn't too helpful but looks really cool in color.

EMST_desire2.png

    2.  You could artificially create a circle to overlay your area and divide into the desired number of sectors needed and sample your points within each sector

  3.  You could use the network analyst extension (aka the not free extension) and produce a service area AND shortest route to the destinations from the office and divide it up as in step 2.  It might look like the above, but there might be fewer lines since the same road could be used to go from the different points (ie from point 59 to 99 to 26 might be the shortest, so you reduce 3 lines to 1, if they were connected by a road.)

  4.  other ideas pending... a nice screen grab would help fine-tune the above

JuanetteWillis
New Contributor II

Here is a quick screen grab. The star is our office and the dots are locations to be inspected.

0 Kudos
DanPatterson_Retired
MVP Emeritus

A circle division would be unduly cruel to just about everyone particularly if the slices of the circle were equal.  Since the intent...I hope... is to be fair and minimize clients, drive times and total costs, I am leaning more towards a Network Analyst solution.

In any event, it would be fairly easy and quick to solve if you just wanted to do something like quarter the distribution knowing full well that each quarter would have an unequal number of places to visit and the aspects of drive time and cost would be pretty well thrown out the window.

So back to you again...

  • do you have the network analyst extension? 
  • could you live with straight line distances and directions as in my previous figure?
  • how many slices do you need?
XanderBakker
Esri Esteemed Contributor

... and if you don't have access to the Network Analyst, you could do this in ArcGIS Online, if you have some credits to burn. Plan Routes—ArcGIS Online Help | ArcGIS can help to assign each point to an inspector. This will not create polygons, but will assign each point to a route (or vehicle = inspector).

I believe that a max of 200 points will be assigned per vehicle and each "vehicle/inspector" will burn 1 credit. If there are 1000 points and you have 5 inspectors, 5 routes will be calculated and you will consume 5 credits. So that's not a big thing (no need to take a second mortgage on your house)

JuanetteWillis
New Contributor II

To answer your questions, Dan.

  • I do not have Network Analyst. Just basic ArcMap 10.1 with the Spatial Analyst extension.
  • I can live with the straight line distances and directions. The main goal is to distribute the number of locations to visit. We know that the distances and routes will vary but it is hoped that each inspector will get some locations near the office and some farther. That is hoped to even out the driving burden. Some will have further to drive but others will have to deal with more traffic.
  • I am looking for 19 territories plus 6 which will only be about half the number of locations.

I do appreciate all your thoughts and insight into this problem.

0 Kudos
DanPatterson_Retired
MVP Emeritus

The earlier suggestion of Theissen polygons or voronoi diagrams you didn't respond to (see Xander's earlier post). Is another potential route to take.  It would require some work to cluster you data into logical areas rather than just the individual points.  The Triangulation tools I wrote produces for Voronoi diagram and Delauney triangulation which may be of use.  http://www.arcgis.com/home/item.html?id=6e9bc6cbf93d4939b2eb04ff8519be47

XanderBakker
Esri Esteemed Contributor

Interesting what you can do with wedges...

Precision is off (not much intelligence in the definition of the cut-off angles), but I'm getting somewhere... Will try to post some code tomorrow.

DanPatterson_Retired
MVP Emeritus

Xander Bakker forgot about this one... only got so far... I am sure you are using numpy too and could use a distraction

import numpy as np
import pylab as plt
angle = [np.deg2rad(i) for i in range(-180,180,30)]
R= 100
Xs = R*np.cos(angle)        # X values
Ys = R*np.sin(angle)        # Y values
pnts = np.round(np.array(zip(Xs,Ys)), 3)  # create the points
print("{}".format(pnts))
# center point and mean distance
XY_c = np.array([0.0,0.0])  # create a center point
Xc, Yc = XY_c.flatten()      # pull out values separately
#
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
circ = plt.Circle((Xc, Yc), radius=R, color='w',lw=2,alpha=.5)
ax.add_patch(circ)
plt.axis('equal')
plt.scatter(Xs,Ys)
plt.show()

Now just change the radius, give it a real center, connect the center to the points as triangles and you have a big circle for intersection or select by attributes (distractions... distractions... )

[[-100.      -0.   ]
[ -86.603  -50.   ]
[ -50.     -86.603]
[   0.    -100.   ]
[  50.     -86.603]
[  86.603  -50.   ]
[ 100.       0.   ]
[  86.603   50.   ]
[  50.      86.603]
[   0.     100.   ]
[ -50.      86.603]
[ -86.603   50.   ]]

image.png

ADDENDUM

c =np.array([0,0])
p = np.array([[c,pnts[i-1],pnts,c] for i in range(1,len(pnts))])
>>> print(p)
[[[   0.       0.   ]
  [-100.      -0.   ]
  [ -86.603  -50.   ]
  [   0.       0.   ]]

 [[   0.       0.   ]
  [ -86.603  -50.   ]
  [ -50.     -86.603]
  [   0.       0.   ]]
etc

should get you polys which can be "Arc'ed" into shape