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.

I wish to develop a simple plugin for QGIS, which will open some data, and some specific processing.

I have quite a it of development experience with ESRI's Arcojects, but haven't developed with QGIS before.

I tried searching on the QGIS wiki, but only found this link :

http://www.qgis.org/wiki/Writing_C++_Plugins

which seems to be obsolete. There were also a few blog posts from 2006.

I also saw something about Python plugins, but I am not sure whether I need to work with the C++ plugin or a Python plugin.

Can Anyone guide me to the documentation, or tutorials that would help me get started

share|improve this question
1  
Also subscribe to the user/dev list and send emails there if you have any questions –  dassouki Oct 20 '11 at 18:24
add comment

3 Answers

up vote 19 down vote accepted

C++ plugins are less and less common these days. Most likely because they are more difficult to develop. Most documentation effort has been put into Python plugins. C++ still has it's place for performance critical things and functionality that is supposed to be merged into QGIS core (like new renderers for example).

This workshop is a pretty good resource developing Python plugins: http://www.qgisworkshop.org/html/workshop/index.html. It covers:

  • Introduction to QGIS, Python, QT and PyQT
  • How Python can be used in QGIS
  • Building Python Plugins
  • Event-Driven Notes / Debugging / Plugin Repositories

The PyQGIS Cookbook offers a lot of code snippets for Python plugins: http://www.qgis.org/pyqgis-cookbook/index.html

If you get stuck, the QGIS developer mailing list is there to help you.

share|improve this answer
    
The workshop link is an excellent resources. I require just a small clarification: What are the C++ plugin for? Is it obsolete? –  Devdatta Tengshe Oct 20 '11 at 13:58
1  
C++ plugins are not obsolete per se, but most documentation effort has been put into Python plugins. C++ still has it's place for performance critical things and functionality that is supposed to be merged into QGIS core. –  underdark Oct 20 '11 at 14:03
    
thanks for the quick answer. –  Devdatta Tengshe Oct 20 '11 at 14:10
add comment

Basically you need to know 3 things:
1) Python : http://www.python.org/
2) PyQT (to make the user interface, if you want one) : http://www.riverbankcomputing.co.uk/software/pyqt/intro
3) Qgis API : http://doc.qgis.org/head/

They are all very well documented, to get started I recommend you to browse through the modules of the Qgis API and play with the python console doing basic things like accessing the features of a vector layer.

Later, after you get the feel of the api, you can ask more specific questions here on GISse.
An Example: Using Qgis API and python, how can I return latitude and longitude of a point?

share|improve this answer
5  
browsing the ftools code is usually a good point of start as it covers most of the vector functions used by the api and python –  dassouki Oct 20 '11 at 18:28
add comment

There is also a QGIS Plugin-Creator, which prepares a basic skeleton of a plugin to get you started. It creates all necessary files for you.

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.