Jump to content

 
Photo

Split Lines at Vertices

- - - - -

  • Please log in to reply
10 replies to this topic

#1
cmdrico7812

cmdrico7812

    Key Contributor

  • Validated Member
  • PipPipPip
  • 68 posts
  • United States

I have a polyline shapefile that I need split at its vertices. I only have an ArcView license and the Split Lines at Vertices tool is not available to me. Would someone be willing to do this task for me? I have attached a zip folder containing the shapefile. Thanks in advance for your help.

Eric

Attached Files



#2
BEAVER

BEAVER

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 185 posts
  • Location:Middletown, NY
  • United States

Not exactly sure where you want the lines to split. Wouldn't explode do the job?

#3
CHART

CHART

    Chart

  • Validated Member
  • PipPipPipPipPip
  • 358 posts
  • No Country Selected

You can try to use the free Edit Tool for ArcView to get the job done... look up the clean command
(the only problem is you get to do the work yourself ....)

http://www.ian-ko.com/
Chart

#4
benbakelaar

benbakelaar

    Ultimate Contributor

  • Associate Admin
  • PipPipPipPipPipPip
  • 658 posts
  • Gender:Male
  • Location:North Brunswick, NJ
  • Interests:maps, information, technology, scripting, computers
  • United States

Here's the DIY/scripting solution. I think even if you aren't a programmer you can probably make it through the instructions and cut/pasting the code. As long as that code works... :) Make sure you try it on a copy of the original layer first!

http://support.esri....l...how&d=24483

#5
cmdrico7812

cmdrico7812

    Key Contributor

  • Validated Member
  • PipPipPip
  • 68 posts
  • United States

I've tried using the free edit tools for 3.2 but I can't get it to work and my free trial period has run out for the Edit Tools for 9.1. I don't do this kind of thing very often so I didn't want to buy the full Edit Tools or an ArcEditor license cause it wouldn't be cost effective.

As far as the Edit, Explode function is concerned, I enter an editing session, select a polyline feature, and click the Explode button on the Advanced Edit toolbar and it gives me the following error: "No multi-part features selected."

#6
cmdrico7812

cmdrico7812

    Key Contributor

  • Validated Member
  • PipPipPip
  • 68 posts
  • United States

Ok, so I created a new button and pasted the code into the source and did everything on the ESRI page you linked. When I run the program I immediately get a "Compile error: Expected End Sub at the beginning. I'm not a programmer so debugging is really not my thing. Any thoughts? Thanks.

#7
benbakelaar

benbakelaar

    Ultimate Contributor

  • Associate Admin
  • PipPipPipPipPipPip
  • 658 posts
  • Gender:Male
  • Location:North Brunswick, NJ
  • Interests:maps, information, technology, scripting, computers
  • United States

OK, got it working. First, the link:
http://64.202.170.23...litvertices.txt

It is _crucial_ that you delete the first line in my text file when pasting in to the "View Source" editor:
Private Sub BreakVertices_Click()

Because when you create the UI button, and then right-click and select View Source, it automatically inserts that line with the name of your UIbutton. The default is Project.UIButtonControl1, so the code you will see in the "View Source" editor is

Private Sub UIButtonControl1_click()

There were also a few syntax errors related to split lines and the custom AddFields sub. Anyway, as long as you copy my code and delete the first line (and paste the remainder _underneath_ the first Private Sub UIButton_click() line), it should work for ya! No pop-ups, best way to test if it worked is go to direct select tool and start clicking on line. Again, run this on a separate copy of your original dataset.

#8
Martin Gamache

Martin Gamache

    Ultimate Contributor

  • Associate Admin
  • PipPipPipPipPipPip
  • 980 posts
  • Gender:Male
  • Location:Washington DC
  • Interests:History of Topographic Cartography
    Topographic Mapping
    History of Relief Depiction
    Thematic Cartography
    Demographic Cartography
    Cartographic techniques, methods, and tools
    Orienteering
    Panoramic & Kite Photography
  • United States

Here is the split data using Edit Tools....

Attached Files



#9
benbakelaar

benbakelaar

    Ultimate Contributor

  • Associate Admin
  • PipPipPipPipPipPip
  • 658 posts
  • Gender:Male
  • Location:North Brunswick, NJ
  • Interests:maps, information, technology, scripting, computers
  • United States

Yea you might want to try Martin's. One more thing about mine, you must also delete the final line "End Sub", because that gets automatically created as well when you go to the "View Source" editor.

And, as a warning, I'm just running it now, and it may run on ALL layers, not just the selected layer. What I did was take my NJ roads shapefile, highlight a little section, "Create Layer From Selected Features", and select that new layer - but the function is taking forever so I suspect it is running on the original layer. May have something to do with the way "Create Layer from Selected Features" works.

[Edit: Also, the script just finished running on my road layer, and while it worked, the zoom levels are messed up. Meaning, if I "select all", I can see the lines... but if I deselect, nothing appears on the screen at various zoom levels. So I would say that now my official recommendation is to just take Martin's file and run! :D]

#10
cmdrico7812

cmdrico7812

    Key Contributor

  • Validated Member
  • PipPipPip
  • 68 posts
  • United States

Thank you for the split and for the code. They both worked exactly the same. I appreciate all your help.

#11
DaveB

DaveB

    Hall of Fame

  • Validated Member
  • PipPipPipPipPipPipPip
  • 1,036 posts
  • Gender:Not Telling
  • Location:Redlands, CA
  • United States

and while it worked, the zoom levels are messed up. Meaning, if I "select all", I can see the lines... but if I deselect, nothing appears on the screen at various zoom levels.


You might need to update the spatial index, or even delete it and create a new one. Or you might need to run repair geometry on the shapefile.
Dave Barnes
Esri
Product Engineer
Map Geek




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->