I want to write point's attribute to polygon data

by 박진호   Last Updated February 13, 2018 13:22 PM

test2 is point data and test is polygon data I will write test2's attribute to test table i want to make it

 i want 

 date|Num|add|결과|x|y|BUFF_DIST|contain  
 20170103|640272|강원도 인제군...|정좌표|318102|501346|30000.0000|86,91,235,2485...|

I want to use pyqgis and I wrote code but I don't know how to write point's attirbute to polygon table

my code is

#-*- coding: utf-8 -*-
from qgis.utils import iface
from PyQt4.QtCore import QVariant
NF = "FRMHS_NO"
f = iface.addVectorLayer("D:/2018/nonmoon/test/test.shp","test","ogr")
g = iface.addVectorLayer("D:/2018/nonmoon/test/test2.shp","test2","ogr")
f.startEditing()
res = f.dataProvider().addAttributes([QgsField("contain",QVariant.String)])
f.updateFields()

I have a image. first img is map second img is test(polygon data)'s table last img is test2(point data)'s table

mapping img polygon's table point's table



Related Questions


Deriving a New Value based on Attibutes

Updated July 17, 2015 15:09 PM



Cache file /home/queryxchang/public_html/apps/frontend/config/../cache/-q-23-271287-i-want-to-write-point-39-s-attribute-to-polygon-data- could not be written