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.

In the map shown below, I have manually created the dummy lines (in green). Using python, and without using PostGIS or sextante, I would like to automate the creation of these dummy links between a point and a line layer, based on the following criteria:

  • Depending on the polygon size, I should be able to add an X amount of dummy links between the centroid (point) and its nearest projection(s) onto the roadway layer.
  • The script so that the largest polygons get the most amount of dummy links and the smallest get the least amount.
  • The script should connect the newly created dummy link to nearest highway based on a classifications scheme, i.e. connect to "busier" highways first
  • If a polygon does not have any roads/links in it, the script should allow the centroid of that polygon to connect to roads outside of its boundaries within Y units of distance
  • The dummy links must be connected to the roadway layer in such a way that this roadway layer could be potentially used for routing including the dummy links.
  • Therefore, the dummy link layer must have the same attributes as the road layer
  • Create a new layer with all the new dummy links

Question: Is this possible using Qgis and Python alone? any pointers as to where to start or can you help in providing a pseudocode to assist me to solve this problem?

enter image description here

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.