# Calculate Distance between a Polygon and a Point Along a Path

I am very new to ArcGis and am trying to figure out how to do this.

Basically, this is what I am trying to do:

I have a map of Canada and in it I have polygons representing areas (each about the size of a municipality). I also have points describing the location of every airport in Canada and the network of roads all across Canada. What I need to do is find the distance from each area to the nearest airport using a road.

What I tried to do already was find the centroid of each polygon because I thought that I could use that to calculate the distance between two points along a road. But then I realized that the centroid is not necessarily connected to a road (especially in the northern parts of Canada) therefore I cannot use that.

I would really appreciate some sort of guidance as to how I would accomplish this as I am very new to ArcGIS and have not found much to help me (without confusing me) online.

• Have you considered building centroid connectors? Emme/2 GIS integration strategies often use these. As a Canadian company, perhaps Inro aleady has a dataset for this. It might be easier to import theirs than build your own. Commented Jun 26, 2012 at 20:20
• @KirkKuykendall Honestly, that seems like it would be to complicated and not "worth my time" (don't want to sound rude) just to do this once. I am looking for a way through just ArcMap. I do appreciate your comment and ideas though. Commented Jun 26, 2012 at 20:27
• Yeah, it would be a substantial effort. If someone (like Inro) has already done it, though, it might not be hard. I think you'd want a line connecting each centroid to the midpoint of each major side of the polygon - not just a single connector. Are the polygons that lack centroid connectivity fairly rectangular? Commented Jun 27, 2012 at 1:37

## 2 Answers

To route along a road network requires more than simple linear referencing, so I'm afraid this is not a trivial task without some sort of routing add-on such as Network Analyst. Whether you have Network Analyst will depend on your licence.

If you don't have Network Analyst you have three options as I see it.

1. The first is to implement an A* algorithm in ArcPy and effectively roll-your-own simple network analysis tool. This is quite do-able if you know Python but your comment above suggests that this would not be an approach you are keen on.
2. Use PostGis and PgRouting. Again, this is not ArcGIS and not entirely trivial (so you may not be interested) but our very own Underdark has an excellent tutorial here: http://underdark.wordpress.com/2011/02/07/a-beginners-guide-to-pgrouting/.
3. Use linear referencing together with a clever series of edits and selections to simplify the road network so you have only one line from each area to the nearest airport. To be honest, this will probably be harder work giving less dependable results with little option for repeatability than either of the other options. Without seeing the data it is difficult to describe how I would go about this, but basically you would need a lot of secondary information to eliminate huge swathes of the road network (land parcels plus some reasonable assumptions about the type of road the traveller would take and a sub-selection of roads based on a massively buffered vector from the area centroid to the airport could be a start... but it is already getting very nasty...)

You could try ET Geowizards. It has a plethora of point, polyline, polygon tools, one of which would probably help accomplish this task. It is an add on to ArcGIS with many free functions. ET Geowizards web site