Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Has anyone created a Python version/model of this VBA script from ArcScripts which populates the to and from street names at street intersections? A logical workflow is outlined quite nicely in this ESRI thread, but it requires ArcInfo, and I would like to know if there is another way to do it.

The end result would be, for example, if there are lines intersecting at First Street and Third Street, and First Street and Main Street, the record for First Street would have to = Third Street and from = Main Street (the order does not matter).

Using Select By Location to select connected roads seems like it would work, and could even possibly replace the need to create points in the aforementioned workflow (looping over each street, writing to separate fields the streets it touches based on the output of the select by location, then extracting the two street names which are different). Does anyone have any other ideas?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I implemented the workflow above by creating a main model and a submodel. Main model Steps:

  1. Add fields TO_ROAD and FROM_ROAD
  2. Spatial Join with the streets layer as the target and join features. The join operation is one_to_many and the match option is boundary_touches to ensure that all streets touching a single street are joined to that street.

The output of the spatial join and the streets feature class is used as the inputs for the submodel. Submodel

  1. Iterate Feature Selection groups the features according to each unique street_id.
  2. A list (multivalue) of the all the street names joined to the selected features is created.
  3. The street name of the currently selected feature is removed from the list, and the remaining names are written to the two fields added in the main model. If only one street name is found to be touching, "Cul de sac" is written to TO_ROAD.

This solution is not optimised - I needed something quickly to solve my problem. All the processing for the touching streets in the submodel can be put into a single script, but I prefer doing the process visually in ModelBuilder so that I can see my workflow clearly before changing it to Python scripts.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.