[GIS] Getting all Null when spatial joining lines with polygons (ArcGIS Desktop 10.5.1)

arcgis-10.5arcgis-desktoparcmapintersectspatial-join

I'm trying to append the attributes of the lines (0 or 1) to all the polygons that they intersect (take the mean if multiple lines exist), as shown below.
The polygons, lines and the DataFrame are all in the same Geographic coordinate system.

enter image description here

Then I ran a spatial join (see below) with the polygon as target feature, and the line graph as join feature.

enter image description here

The resulting attribute table, however, gives all Null values for all appended attributes ("Test_1" is the field where I put 1 and 0 for the lines).

enter image description here

I saw there's a bug related to the spatial join tool which should be fixed in version 10.5, and the coordinate systems I used for both feature classes are the same.


It worked when I use the "Join and Relate" – "Join" – "Join based on spatial location", however, the spatial join tool in the toolbox still couldn't solve the problem. Would love to know why or the difference between these two tools.

Best Answer

I recently had this issue when experimenting with a Spatial Join. My solution was to try a "real-world" scenario. I was initially trialing the Spatial Join at a large scale in a random Coordinate System. My results were similar to yours. I tried the join again in my study area with random lines and the join worked.

A potential work around if the Spatial Join still does not work, would be the following:

  1. Perform an intersect between the lines and polygons, ensure the output type is set to Line. enter image description here

  2. The output will be a series of lines which run through / over your polygon. Use the Feature to Point Geoprocessing Tool to create a point at the centre of your line.

  3. Try this new point file in for the Spatial Join