Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm using python to build a plug-in in Qgis. I need to extract the edges of each line feature of a vector layer to create a new point layer of all edges. Someone can help me? My data input is a vector line shapefile that represent the roads of a city.

Thanks, Raffaele

share|improve this question
Do you mean that you want to extract the line nodes instead of edges? Do you need start and end node or all intermediate nodes? – underdark Apr 16 '12 at 10:58

1 Answer

If you want just the points (nodes/vertices) then use: Vector->Geometry Tools->Extract nodes.

Alternatively, if you want the edges between nodes (i.e. the result is a data set with lines defined by no more than two nodes, the total of which combine to represent the original line), then you want the "Split Features" plugin. Go to Plugins->Fetch Plugins. Then type 'split' into the search box and you should find it (you may have to enable 3rd party repositories). Install the plugin and then you will find it here: Plugins->Split Featutres.

share|improve this answer
I need the code in Python. THANKS! – raffalba May 21 '12 at 16:25

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.