AnsweredAssumed Answered

Inaccurate Matches in Spatial Join (Precision Problem?)

Question asked by kaeldowdy on Jun 5, 2013
Latest reply on Jun 6, 2013 by kaeldowdy

I have two line features for which I need to determine if an end point on one line feature (which I'll call a leader line) touches anywhere on the other line feature (a pipeline system).  In Model Builder, I run the following steps:

  1. Run the Feature Vertices to Points tool against the leader line to create a vertex on each end point of this line feature.  That way, I have some geometry bound to the leader line's end points in order to perform a spatial join in a subsequent step.  The output feature class for this step is called Test Points.

  2. Run the Erase tool to remove one of the end point vertices from the newly created Test Points feature class in order to be left with a single vertex (test point) touching a pipeline.

  3. Run the Spatial Join tool to determine which test points join up to a particular pipeline.  I use the Test Points feature class as the Target Feature and the Pipelines feature class as the Join Feature.  My output feature class is Test Point Pipelines.

In most cases, the spatial join tool yields correct results when determining if a particular test point joins up to a particular pipeline.  However, I have several thousand instances where I'm getting a false positive -- meaning the tool believes a test point vertex "touches" a particular pipeline line feature, but if you zoom in very tight into the feature, you can see it does not touch.  The difference might be just 0.5 mm off or less, but still, it does not technically touch.  I can also turn off my Test Points feature class and just turn on my original leader line feature, and I can see that the end point comes just within a few tenths or hundredths of a mm from the pipeline line feature.  So, I concluded that it's not my Feature Vertices to Points step which is causing the problem, but rather during the Spatial Join step whereby I'm getting a false hit.

My first thought was that there was some type of tolerance or precision level set which tells the tool something to the effect of, "If the target feature comes within x mm of the join feature, then include it anyway..."  However, I have not found a setting in Model Builder or ArcGIS where I can specify whether or not to include joins if they are just "close"; I want them to match 100% perfectly even if I'm zoomed into a map scale of 1:0.

Two Examples of False Positive Hits from Spatial Join

Ex 1: Test Point .5 mm just before pipeline

Ex 2: Test Point .03 mm just past the pipeline

All feature classes are using the same coordinate system -- NAD83 State Plane Millimeter -- so I don't think that's the issue.

So, does anyone have any thoughts as to why I'm getting these false positive joins on my Spatial Join?  I haven't found any common thread on the ones which are getting false positive matches, but I'm looking into it.  Perhaps I need to use a different tool other than the Spatial Join so it gives me the highest level of precision? 

I'm relatively new to using Esri ArcMap, so hopefully my terminology and explanation of what I'm trying to do makes sense...  :o  Please let me know if you'd like any more info into what I'm trying to do.


Update 1:  I'm going to investigate the Match Option parameter.  I'm using the default of INTERSECT, but maybe there's another option that will give me a "tighter" match of a point feature to a line feature. Think I'm on the right track?

Update 2:  most of the Match Options are not applicable to the types of feature classes I'm joining, and of the ones that do work, none of them yielded different results.  However, I did try the Intersect tool instead of the Spatial Join tool and changed the XY Tolerance to 0.0001 mm.  In a small unit test, the feature class that shouldn't be part of the match did not show up!  Hopefully, I don't have any situations where the lines are < 0.001 mm away from one another, but this might be the ticket!  I just need to do more testing to make sure this is the way to go and then change my model to use the Intersect tool for this process...

Update 3:  so, after more unit testing, it appears that the Intersect tool did not work 100% of the time.  I'm still getting cases where the tool is saying I'm getting a hit or join, but when I zoom in really tight, my leader line is not touching the pipeline.  :mad:  It does yield a higher percentage than using the Spatial Join but I'm still not getting a 100% accurate match.  Hopefully someone else has run into similar problems.  At this point, I'm going to investigate other tools or approaches...