I have two layers formed by polygons that I need to overlap in order to calculate the max distance of one polygon with respect to the perimeter of the other one.

In order to be clear I have this type of situation:


I have a file with the black polygons and another file with the red one. I need to know the maximum distance of the red one to the black one (the blue arrow in the example).... any suggestion?

Here the passages that I'm making:

1) this is the initial situation. In order to simplify the situation I made the polygons with the exact colours as in the example:

2) Next, I made the euclidean distance as follows:

3) Zonal statistics:

4) this is the output:

If I'm correct: the COUNT is the previous FID (so the number that indicate each black polygon). Max should be the maximum distance of the black polygon to the next red polygon. If this is right, how is it possible that in some cases I have Min greater than zero and Max equal to zero? Moreover, this values are already in meters?

Actually it is a bug: if I compute only max make sense:

So that MAX are the maximum number of METERS to the next red polygon, right? A last question: is it possible to have a 0 value if NO red polygons are inside the black polygons?

  • Are all polygon that ideal in respect to being rectangles and alingment?
    – Matte
    Jun 13, 2016 at 10:46
  • Basically the red are in general included in the black onen.. it can be that one red is spread through more than one black... Basically the reds are Buildings and blacks are properties (if I have a public building it can be spread on more than one property)
    – Nicola
    Jun 13, 2016 at 12:41
  • glad that it worked. If you have a polygon inside then the min will be zero, For more precision (to avoid edge uncertainty), you should use select by location"
    – radouxju
    Jun 15, 2016 at 12:23
  • The last point is not clear for me (I'm really stupid, sorry!!).... The min = 0 make sense only if the two polygons has the same edge on the same line... but if is it a case as the first example in which the red one is completely included in the black one without sharing an edge? where I should use select by location?
    – Nicola
    Jun 15, 2016 at 13:03

1 Answer 1


If you have spatial analyst, compute the euclidian distance to each red polygon, then you can use zonal statistics as a table to extract the maximum value of the distance to the red polygon for each black polygon (make sure that each black polygon has a unique ID). The precision will depend on the pixel size that you define for the analysis (if your pixel is one meter, your precision will be one meter).

If you don't have spatial analyst but you have an advanced licence, create points on the boundary of the black polygon using create feature vertices to point (MID and END options), the use generate near table to get the distance from those points to the black polygons and finally use summary statistics (maximum) to find the furthest point for each ID. The precision will depend on the number of points (use densify if better precision is needed).

If you don't have the extension, note that option 2 is possible with alternative tools, but it will take longer.

  • First of all thank you for the reply... but I have still problems.... probably I'm jumping some passages!! Just to recup: I have the two different shapefile with the two polygons and I have spatial analyst. If I compute the euclidian distance I have only to put ONE file in the window that will be the "red shapefile". What came out from the output is something without any sense. What I'm missing? How can I say to ArcGis "look, you have to calculate the euclidian distance to the black polygon? By the way... I would need the precise lenght in meters, is it possible?
    – Nicola
    Jun 13, 2016 at 13:55
  • yes, you need to compute the distance to the red shapefile only. You can specify a small pixel size from the environment values. You are NOT computng the distance to the black polygon, but to the red ones, which will be a continuous field. What do you mean when you say that it does not make sense ? Have you tried the zonal stat ?
    – radouxju
    Jun 13, 2016 at 19:30
  • What I mean is that I expected to have a sort of table saying "the max distance of the perimeter of this polygon to the next one is x meters"... how is it possible without saying to the program "compute it from red to black"? Should I overlay the two raster (or something similar) before? moreover, if the red polygon is spread on more than one black polygons, do I have the value for each black polygon? probably these are stupid questions, but I'm really lost. Thank you for the patience!
    – Nicola
    Jun 14, 2016 at 10:24
  • the table you need will be the output of "zonal statistics as a table"
    – radouxju
    Jun 14, 2016 at 10:26
  • you get the maximum value of the pixel inside the black polygons, and this maximum value has to be on the perimeter (there can be no point further from the red polygon inside the balck one than a point located on the perimeter of the black one.
    – radouxju
    Jun 14, 2016 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.