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 am developing a few scripts in Python for QGIS 1.8 to automate some geo-tasks and one of them would be to calculate the shortest distance from a hospital to each building in a town.

I would like to take advantage of the already existing Qgis plugin but, as it is a C++ plugin, I am not sure whether it is possible to access it from Python? Is there a binding or a trick for that?

If not, any further advice would be appreciated! As the base data is OpenStreetMap data stored in a PostGIS DB, I may also try with pgRouting. But the Qgis plugin would be my favourite choice if possible.

Thanks in advance!

PS: this question is close to this one: Is there a way to access QGIS plugins in Python? but I believe it's still different enough to be worth a new thred.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

gis-lab.info has a tutorial on using the network analysis library in QGIS using Python. It's not in English but Google Translate should be able to make it comprehensible. Good luck!

share|improve this answer
    
Thanks a lot, I will give it a try! –  Stéphane Henriod May 1 '13 at 11:49
1  
The Google translation doesn't really help, cause it's a very poor translation. But using your examples of code, I somehow manage to get it through. спасибо –  Stéphane Henriod May 2 '13 at 6:19
    
Btw, that wasn't my blog post. I just linked it. Glad to know it helped though. Did it answer your question? –  R.K. May 2 '13 at 6:58
    
I'm still working on it but I think it did solve it yes, thx –  Stéphane Henriod May 2 '13 at 11:39

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.