Do you know whether it is possible to summarize the attribute values of lines which have the same start- an endpoint?
This is my sitaution: I have ONE layer with lots of buslines between german cities. Now I want ArcGIS to summarize all lines which run between two cities to one line with the summarized frequentation attribut value. An this for all city to city relations.
Example - actual date situation:
Line 1: Stuttgart-München -> 5 times a week
Line 2: Stuttgart-München -> 2 times a week
Line 3: Stutgart-Hamburg -> 3 times a week
Line 4: Stutgart-Hamburg -> 3 times a week
Line 5: Stutgart-Hamburg -> 3 times a week
Result shall be:
one line between Stuttgart and München with attribut value 7 times a week and one line between Stuttgart and Hamburg wit attribut value 9 times a week.
I already tried lots of options, but none worked (including Dissolve).
Thank you very much for ideas,
Johannes
Solved! Go to Solution.
No, as far as I know there is no common value between these...
I think I kind of understand what you are working with. You split a larger bus route into multiple lines based on city intermediate stops, but did not insert the intermediate stops into the table. Presumably different several bus lines connect the same intermediate destination pairs for at least part of their route so they should have a way to be summarized to get counts from your data.
Assuming the points shown on your exhibit are the intermediate stops you mentioned, you can use the Spatial Join tool to get their attributes on to the lines. Use the Spatial Join Tool with the One To One option and make the Lines the Target features and the Points the Join Features. Any points that do not actually represent stops that you split the lines with should be excluded when the tool is run so that only the points at the start and end of each line are used.
In the Field Map of the Spatial Join tool right click the field to adjust the properties for the City Name field (or whatever field works to identify each intermediate stop) to make it a Text Field with 254 characters and use Join as the Merge Rule Option with a delimiter character, such as a semicolon or a dash. This will concatenate the two stop names together into a new field on the lines. You may want to alter the Name order in the field, since the concatenation won't really be based on any kind of driving directions or alphabetical order, just the order it encountered the points. You then should be able to use those to summarize the intermediate stop segments based on that field.
Thank you very much, Richard! Thats exactly the problem I have!
Your solution sounds great, I just tried it. But could you describe more exactly, who I can alter the name order in the field? One line ist now for example called "Stuttgart;München" an another "München; Stuttgart". Is it possible to make both to "München; Stuttgart"? For example, by putting the names within each cell in an alphabetically order?
First check that no more than 2 names got concatenated, since if you have cases where more than that occur you probably should figure out why manually. For ordering the cities alphabetically; first select all records that contain a semicolon and space in the output (i.e., CITY_NAME Like '%; %') to make sure no records with just a single name are included, then you can do the following Python calculation to reorder the two names alphabetically (make the field name match your field name of course):
sorted(!CITY_NAME!.split('; '))[0] + '; ' + sorted(!CITY_NAME!.split('; '))[1]