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`ve developed an algorithm that generated an two dimensional array with points. Each subList of this array must be displayed as an polygon on the map view, and the recently created Vectors should be displayed in the map legend. And the points must be connected in the order that they stand within the lists.

Info: I`m using Quantum GIS 1.8.0 with Python 2.7.2 installed on it.

The code is basically this:

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
vlayer = qgis.utils.iface.activeLayer()
provider = vlayer.dataProvider()
feat = QgsFeature()
allAttrs = provider.attributeIndexes()
provider.select(allAttrs)
provider.nextFeature(feat)
geom = feat.geometry()
x = geom.asPolygon()
#after this i make some processing with points within the vector layer
#And i do this to create the two dimentsional array (this is just an example)
layersPoints = []
layersPoints.append([])
layersPoints[a].append(x[0][i])

So, what i need is to create a polygon layer connecting the points for each a in layersPoints[a], and display it on the map view.

Thanks in advance.

share|improve this question
    
Welcome to gis.SE, which is a Q&A site. Is there a question you have? What do you need to know? What have you tried? What worked? What didn't work? What do you need instead? What versions do you have? Is there some code that is applicable? Please edit your question (just click edit above) to include these details so we can help you. –  BradHards Sep 2 '13 at 22:18

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.