1

I want to replicate the manual Spatial join (R-click Join) using 'count' in ModelBuilder.

I have 2 datasets:

  • Historic Road Traffic Collisions (RTC) locations - Point feature (gdb) - 3,398 rows
  • Road Network in segments - polyline (Shp) - 149,775 rows

and I want to count the number of RTC per road segment so I can display only sections that have more than 1 historic RTC and show different thickness of line based on the value returned.

It works fine when I do it manually. However the Spatial join in the ModelBuilder does not bring back a count. I am also unsure of the results.

  • If I use 'Intersect' it does not bring back anything
  • If I choose 'Closest' it attributes a value to all my segments (which it should not).

Sometimes it also bugs and "null" all my table fields apart from the 1st row. Anybody have any idea of what I am doing wrong?

  • What value are you using for your search radius? That setting should work to make the Intersect option your best option. – Richard Fairhurst Sep 29 '14 at 13:10
  • I used 50m... maybe I'll try again with something less large. I'll get back to you. – Olive Sep 29 '14 at 14:54
  • I have done it with 20 m and it works... but not all the time. For example, it would work first time but then the second time I run it, it would make all value "null" apart from the first row as stated above. Why is that? – Olive Sep 29 '14 at 15:34
  • Sine you are using 10.0 you probably have SP4 without the Spatial Join Tool Patch. See: support.esri.com/cn/knowledgebase/techarticles/detail/40174 – Richard Fairhurst Sep 29 '14 at 16:38
1

I have resolved the issue so I thoughht i'd close this by sharing the answer.

1) the "null" values on all rows but the first one

Thanks to Richard Fairhurst in the commenting section on the Patch tip. The patch fixed it.

2) returning the count value of points per line segment in my model, I had to:

  • use the 'Repeat Victimsation (Geographical) tool from the ESRI UK Crime Analyst extension: To count the number of stacked point at one location. This created a new layer with summarized features with a count value for each geographic location.

  • Use the Spatial join with the following criteria:

    1. Target feature is my Line feature
    2. Join Features is my RTC
    3. join operation is Join_one_to_many
    4. Left the 'Keep All target features' ticked off
    5. Right click on my Count value (from Previous layer) and use the merge rule to 'SUM'
    6. Choose Intersect
    7. Search radius of 10 m

And it seems to work ok (touch wood)

Thanks a lot.

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.