Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to draw line with arrow head or after drawn the line i need to make it as arrow head line by using python. or can we set any arrow head symbol for line features by using python? Kindly help me with some sample codes.

share|improve this question
why do you need to do it with python. why not in print composer? – Ger Apr 30 '13 at 13:01
print composer means? i'm very new to this..could you plz explain – venkat Apr 30 '13 at 13:04
Putting as an answer below. – Ger Apr 30 '13 at 13:07

Ok well print composer is one of the very basics. Look for some tutorials on it.

File>new print composer, opens a new window designed for printing. It allows you to format your "drawing" for printing onto any paper size and printing to pdf or image.

enter image description here

the high lighted button show you the one to add the map. click, click one corner and drag to fill up the required area.

Experiment with the buttons along the top and look at the panel to the right side for properties.

share|improve this answer
Thanks but this one i cannt save as QgsVectorLayer. i need to make line feature with arrow head in QgsVectorLayer. plz help me – venkat May 2 '13 at 4:26

OK Having reviewed what you said. Create a new vector layer. Make it a point.

Place your points in the viewer, ensuring that each point can be attributed at least one 1, 2, 3, 4..etc.

Open the properties box of the layer. In Style, change single symbol to categorised, change the symbol to show point as an arrow.

Classify and you will have a list of different arrows for each point.

Click on each, you can adjust their size and rotation seperately.

See imageenter image description here

share|improve this answer
thanks for your response.. actually i need this for line feature. – venkat May 2 '13 at 12:03

I'm three years late, but hopefully whoever else might be stuck on an issue like this will benefit from my answer.

 # adds a LineLayerStyle (Arrow, dotted)  
 # layer being a vector layer object of QgsVectorLayer()
   def setLineLayerStyle(self, layer, style):  
     if(style == "arrow"):  
         sl = QgsSymbolLayerV2Registry.instance().symbolLayerMetadata("LineDecoration").createSymbolLayer({ 'width' : '0.26', 'color' : '0,0,0' })  
         symbollist = layer.rendererV2().symbols()  
         symbol = symbollist[0]  

Following this code, you will get a line that looks like the pink arrow.

Following this code, you will get a line that looks like the pink arrow. All of this information is from here

share|improve this answer
Also, there is an Arrows plugin ( by Gregoire Piffault that creates a stylized arrow. It has some issues but it works, just delete the existing arrows shape file between iterations. – marcp Jul 21 at 16:55

Your Answer


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.