measure polygon center to nearest polygon border

5231
9
Jump to solution
10-23-2012 10:13 AM
AndreasDaim
Occasional Contributor
hey,

the NEAR tool measures nearest distance from border feature A to nearest border feature B.
How to measure nearest distance from CENTER of feature A to nearest border feature B?

king regards
andreas
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
You could convert your polygons to points using the 'CENTROID' and then use the centroid points in the Near Table tool to get distance from centers to closest polygon boundary.  You can use the Near_FID field to join these distance values back into your original table.  This tool is only available with ArcInfo.

IF you have ArcEditor (or Basic in 10.1) you can use the Export Feature Attributes to ASCII tool instead to get centroids.  This will write out the attributes to a text file with XY coordinates of the centroid of your parcel.  Use that to create an XY Event Layer and export that into a new Feature Class.

View solution in original post

0 Kudos
9 Replies
AndreasDaim
Occasional Contributor
so with attachment:
1) measure distance from center of blue polygon to nearest other feature (black arrow)
2) or also measure distance from center of multipartpolygon (black+blue polygon) to nearest other feature (yellow arrow)

[ATTACH=CONFIG]18787[/ATTACH]

gz
andreas
0 Kudos
by Anonymous User
Not applicable
You could convert your polygons to points using the 'CENTROID' and then use the centroid points in the Near Table tool to get distance from centers to closest polygon boundary.  You can use the Near_FID field to join these distance values back into your original table.  This tool is only available with ArcInfo.

IF you have ArcEditor (or Basic in 10.1) you can use the Export Feature Attributes to ASCII tool instead to get centroids.  This will write out the attributes to a text file with XY coordinates of the centroid of your parcel.  Use that to create an XY Event Layer and export that into a new Feature Class.
0 Kudos
AndreasDaim
Occasional Contributor
hey,

Tryed the first suggestion but didnt work at the step, where to calculate the point to polygon BOUNDARY distance, because the points are within/on the polygon. The polygon represents the field, the points the influcence on it - and I need the distances to the field boundary?

best regards
andreas
0 Kudos
T__WayneWhitley
Frequent Contributor
Caleb's suggestion sounds good to me.  I'm assuming you created the centroid points okay?  If so, you need the distance from these points to the green line, correct?  So I suppose the green line is in a line feature class, you can execute Near with the centroid points as input and the line feature class as the near feature(s).  If that is failing, can you elaborate more on what is going wrong?
0 Kudos
AndreasDaim
Occasional Contributor
Caleb's suggestion sounds good to me.  I'm assuming you created the centroid points okay?  If so, you need the distance from these points to the green line, correct?  So I suppose the green line is in a line feature class, you can execute Near with the centroid points as input and the line feature class as the near feature(s).  If that is failing, can you elaborate more on what is going wrong?


centroid points worked fine.
But the green line isn't a line feature, its the boundary line of a polygon (no fill colour just boundary line template)
demonstrating a meadow in real, and the polygons which of i created the centroids are on and within this meadow polygon (demonstrating different impacts in real). And they are not clipped, just laying uppon once another.
I attacht another example: impact polygon (blue/yellow) uppon meadowpolygon (selected, green boundary)
[ATTACH=CONFIG]18996[/ATTACH]

And with this constellation I can't measure the distance as suggested because I can just selecte by NEAR the polygon "meadow" and get the result "0" of course. But i need the distance: impact polygon to the boundary of the meadow polygon.
0 Kudos
T__WayneWhitley
Frequent Contributor
Then would it make sense to convert the polygon features to line for purposes of this Near analysis?  I'm assuming you have that capability (do you have this advanced license or other means to convert?).

This way you can 'force' the computation of distance to the boundary of the poly - I think this is what you're asking.  Otherwise, without this intermediate step (converting the poly boundary to line), ArcGIS has no way of knowing that you mean, either the interior (part of the polygon) or the boundary (also part of the polygon).

If this doesn't quite make sense, look over more carefully the docs on Near (which are very good, including illustrations [although not of your special case]):
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000001q000000
0 Kudos
AndreasDaim
Occasional Contributor
Then would it make sense to convert the polygon features to line for purposes of this Near analysis?  I'm assuming you have that capability (do you have this advanced license or other means to convert?).

This way you can 'force' the computation of distance to the boundary of the poly - I think this is what you're asking.  Otherwise, without this intermediate step (converting the poly boundary to line), ArcGIS has no way of knowing that you mean, either the interior (part of the polygon) or the boundary (also part of the polygon).

If this doesn't quite make sense, look over more carefully the docs on Near (which are very good, including illustrations [although not of your special case]):
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000001q000000


now I got it, worked out fine with polylines/centroid - thx Caleb & Whitley!
little last question: how to easy rejoin the resulting NEAR column with my origin attribute table for the impact polygons?
Would like some simple stepwise description, if fact, that I'm not familiar with Arcmap.
gz
andreas
0 Kudos
T__WayneWhitley
Frequent Contributor
You know how to do 'join by attribute', correct?  The key is to have a common field values with which to perform this join...
So how is this done?  You can 'preserve attributes' in converting Feature To Line.  I think choosing that option will result in the 'old' FID written to the 'new' line fc with the fieldname, 'FID_<fcName>'.  So you could join by attribute back to the orig fc FID using this preserved FID.  Test this to be sure it behaves as you expect.  Below is a rough outline of how it's done:

- run Feature to Line on poly fc with 'preserve attributes' on (this may be 'on' by default)
- if your orig poly fc name is 'impact', let's just say, then look in your Feature to Line output for a field 'FID_impact'...
- visually inspect and verify the line features' FID_impact values match the poly features' FID.
- join by attribute FID_impact to FID....or to permanently join the fields to the target poly fc, use the Join Field tool


Check this out:
Join Field
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000065000000
0 Kudos
AndreasDaim
Occasional Contributor
You know how to do 'join by attribute', correct?  The key is to have a common field values with which to perform this join...
So how is this done?  You can 'preserve attributes' in converting Feature To Line.  I think choosing that option will result in the 'old' FID written to the 'new' line fc with the fieldname, 'FID_<fcName>'.  So you could join by attribute back to the orig fc FID using this preserved FID.  Test this to be sure it behaves as you expect.  Below is a rough outline of how it's done:

- run Feature to Line on poly fc with 'preserve attributes' on (this may be 'on' by default)
- if your orig poly fc name is 'impact', let's just say, then look in your Feature to Line output for a field 'FID_impact'...
- visually inspect and verify the line features' FID_impact values match the poly features' FID.
- join by attribute FID_impact to FID....or to permanently join the fields to the target poly fc, use the Join Field tool


Check this out:
Join Field
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000065000000


worked out fine - thank you!
king regards
andreas
0 Kudos