I am doing a project where I have to export file from shapefile to SVG format using PyQGIS.

I have read some articles regarding SimpleSvg plugin but I don't know how can we achieve the same task using PyQGIS.

  • if you know any document or website please point towards that.. this will also help, i will try that. Jul 5 '15 at 15:39

SimpleSVG is a Python plugin https://plugins.qgis.org/plugins/simplesvg/ --> using PyQGIS!

Therefore its source code should be the perfect example of how to export SVG from QGIS.

  • 2
    It's all in root / src / simplesvg / oudesvg.py NewBee do you understand python well enough to read the source? It can be a bit daunting trying to decyper existing utilities but it's only just over 300 lines (with comments and whitespace) head straight for def go(self, foo): which calls WriteXML... that breaks it down to around a dozen lines to read and understand to write your own call to creating an SVG from the canvas. It would only get difficult if there was something in the WriteXML method you didn't like and needed to change. Jul 5 '15 at 22:57
  • Thanks Michael.but i am not that much into python, its very complex code, but i will try my best to complete the task. Jul 6 '15 at 3:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.