Spatial Joining 2 polygon layers based on centroids

2839
8
Jump to solution
10-19-2016 07:30 AM
TheoFaull
Occasional Contributor III

Hello,

The spatial join tool in ArcMap is rather limited. It only looks for intersecting polygons or 'fall completely inside of' polygons:

I want to spatially join a polygon to another polygon based on whether the centroid falls within it. Is there another way to do this? Python script maybe?

0 Kudos
1 Solution

Accepted Solutions
DarrenWiens2
MVP Honored Contributor

The Spatial Join geoprocessing tool has many more options than the menu spatial join tool, one of which is HAVE_THEIR_CENTER_IN.

View solution in original post

8 Replies
DanPatterson_Retired
MVP Esteemed Contributor

Why not produce the centroid layer, then spatially join it to the other layer.

TheoFaull
Occasional Contributor III

Hmmm yes I could create a whole new centroid layer... Could you tell me (or point me in the right direction) how to go about this? I only have a basic license bear in mind. Dan_Patterson

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Sadly FeatureToPoint requires an advanced license... so as suggested below, But everyone has Add XY coordinates, then you just add the table back in (File, Add Data, Add XY data) and save it back out to its own feature class.

Such unnecessary steps.  You can do this by other means, but the workflow is only 10s of seconds to complete

LesiMai3
Occasional Contributor

Hi Theo,

Under the select by location tool, there is an option to select features that have their centroids falling in the source layer feature.

 

Lesi

0 Kudos
TheoFaull
Occasional Contributor III

I know, and that's useful for Selecting. But I'm looking to do a spatial join. I have hundreds and thousands of shapes within each layer, all with multiple attribute variation. Lesi Mai

0 Kudos
LesiMai3
Occasional Contributor

Sorry for misreading your question.You can use calculate geometry to get the xy coordinates of the centroid and make an xy event layer based on the coordinates.

DarrenWiens2
MVP Honored Contributor

The Spatial Join geoprocessing tool has many more options than the menu spatial join tool, one of which is HAVE_THEIR_CENTER_IN.

TheoFaull
Occasional Contributor III

dkwiens‌ thank you so much. This is the answer I was hoping for! You've saved me having to go through all the steps of converting polygons to XY event layer points, then joining that to my join layer.

Cheers.

0 Kudos