Exemplo n.º 1
0
    def createShape(self,taskID):
        load=LoadTask()
        load.loadXML(taskID)
        connect =  ConnectionHandler()
        cur = connect.connect_Common()
        cur.execute("SELECT dataxml FROM t_task WHERE Taskid = '%s'" % (taskID))
        dataXML = cur.fetchall()[0][0].read()
        dirname = "Z:\\GMLFile\\"
        pathDir = os.path.dirname(dirname)
        if not os.path.exists(pathDir):
            os.makedirs(pathDir)
        save_path = 'Z:\\GMLFile\\'
        name_of_file = str(taskID)
        completeName = os.path.join(save_path, name_of_file+".gml")
        openFile = open(completeName, "w")
        openFile.write(dataXML)
        openFile.close()
        parsedGML = GMLParser()
        parsedGML.createXML(taskID)
        #self.gmlWrite()

        iface.addVectorLayer("Z:\\GMLFile\\ogrGML.gml","gmlToShape","ogr")
        layers=iface.legendInterface().layers()
        for layer in layers:
           if layer.name() == 'gmlToShape':
             iface.setActiveLayer(layer)
        _vlayer = iface.activeLayer()
        QgsVectorFileWriter.writeAsVectorFormat(_vlayer,"Z:\\GMLFile\\%s.shp"%(taskID),"utf-8",None,"ESRI Shapefile")
        layers = iface.legendInterface().layers()
        for layer in layers:
            if layer.name() == 'gmlToShape':
                #print layer.name()
                QgsMapLayerRegistry.instance().removeMapLayer(layer.id())
Exemplo n.º 2
0
    def populate(self, taskID):
        featuresOfTask = FeatureTask()
        lst_oid = featuresOfTask.taskOid(taskID)
        i = 1
        j = 0
        no_rows = len(lst_oid)
        no_column = 15
        x = ', '.join(lst_oid)
        #z='"'+'", "'.join(lst_oid)+'"'
        oids = "'" + "', '".join(lst_oid) + "'"
        self.currentTaskTable.setColumnCount(no_column)
        self.currentTaskTable.setRowCount(no_rows)
        self.currentTaskTable.setHorizontalHeaderLabels([
            'Unique Parcel ID', 'Block No', 'Street Name', 'Street No',
            'Woreda Code', ' Area', 'Area_D', 'Area_M', 'Perimeter',
            'Perimeter_D', 'Perimeter_M', 'OID', 'Begin Lifespan',
            'End Lifespan', 'Voided', 'Surveyed'
        ])

        con = ConnectionHandler()
        cur = con.connect_RECS()
        cur.execute(
            "select uniqueparcelid,block_no,street_name,street_no,woredacode, area,area_d,area_m,perimeter,perimeter_d,perimeter_m,oid,beginlifespan,endlifespan,voided,surveyed from v_l2_parcel where oid in (%s)"
            % (oids))

        fetchedData = cur.fetchall()
        print fetchedData
        for i in range(no_rows):
            for j in range(no_column):
                item = QtGui.QTableWidgetItem(str(fetchedData[i][j]))
                self.currentTaskTable.setItem(i, j, item)
                item.setFlags(QtCore.Qt.ItemIsSelectable
                              | QtCore.Qt.ItemIsEnabled)
Exemplo n.º 3
0
    def searchClicked(self):

        try:

            UPID = self.fetrID.text()
            connect = ConnectionHandler()
            cur = connect.connect_RECS()
            cur.execute(
                "SELECT ID FROM RECS.T_PARCEL WHERE UNIQUEPARCELID = '%s'" %
                (UPID))
            ID = cur.fetchall()
            if not ID:
                QMessageBox.information(
                    self, "Message",
                    "Invalid Unique Parcel ID ! \n Please enter a valid unique parcel ID!"
                )
                return None
            active_layer = iface.activeLayer()
            ids = []
            ids.append(ID[0][0])
            print ids
            active_layer.setSelectedFeatures(ids)
            mCanvas = iface.mapCanvas()
            mCanvas.zoomToSelected()
        except:
            QMessageBox.information(self, "Message", "Select a Parcel!")
    def dateChanged(self):
        try:
                modDate=self.dateTimeEdit.text()
                modDateValue = modDate.upper()
                system="RECS"
                connect =  ConnectionHandler()
                cur = connect.connect_Common()
                cur.execute("select taskid, createdby,status,beginlifespan,endlifespan,comments from v_l1_task where system like '%s' AND MODIFICATIONDATE like '%s'"%(system,modDateValue))
                rows = cur.fetchall()
                print rows
                xrows = len(rows)
                print xrows
                xcolumn = len(rows[0])
                i = 1
                j = 0
                model2 = QtGui.QStandardItemModel(xrows, xcolumn)
                model2.setHorizontalHeaderLabels(['TaskID','Created By','Status','Valid From Date','Valid To Date','Comment'])
                for i in range(xrows):
                    for j in range(xcolumn):
                        item = QtGui.QStandardItem(str(rows[i][j]))
                        model2.setItem(i, j, item)
                        item.setFlags(QtCore.Qt.ItemIsSelectable| QtCore.Qt.ItemIsEnabled)
                self.taskListTable.setModel(model2)

        except:
            QMessageBox.information(self, "Message", "No Result Found!")
Exemplo n.º 5
0
 def getAttribData(self, taskID):
     from feature_curent_task_dialog import taskFeatures
     obj = taskFeatures()
     print obj.rowClicked()
     global fetchedData
     global t_id
     t_id = taskID
     obj = FinishTask()
     oid = obj.getOldOid(t_id)
     con = ConnectionHandler()
     cur = con.connect_RECS()
     cur.execute(
         "select block_no,street_name,street_no,woredacode, area,area_d,area_m,perimeter,perimeter_d,perimeter_m,beginlifespan,endlifespan,voided,surveyed,uniqueparcelid  from v_l2_parcel where oid='%s'"
         % (oid[0]))
     fetchedData = cur.fetchall()
     print len(fetchedData[0])
     print fetchedData
     self.lineEdit.setText(str(fetchedData[0][14]))
     self.lineEdit_3.setText(str(fetchedData[0][0]))
     self.lineEdit_4.setText(str(fetchedData[0][1]))
     self.lineEdit_5.setText(str(fetchedData[0][2]))
     self.lineEdit_6.setText(str(fetchedData[0][3]))
     self.lineEdit_7.setText(str(fetchedData[0][4]))
     self.lineEdit_8.setText(str(fetchedData[0][5]))
     self.lineEdit_9.setText(str(fetchedData[0][6]))
     self.lineEdit_10.setText(str(fetchedData[0][7]))
     self.lineEdit_14.setText(str(fetchedData[0][10]))
     self.lineEdit_13.setText(oid[0])
     self.lineEdit_15.setText(str(fetchedData[0][11]))
Exemplo n.º 6
0
    def populate(self):
        try:

            system = "RECS"
            connect = ConnectionHandler()
            cur = connect.connect_Common()
            cur.execute(
                "select taskid, transactiontype,createdby,beginlifespan,endlifespan,status,comments from v_l1_task where system like '%s' and taskid like '%s' "
                % (system, taskId))
            rows = cur.fetchall()
            print rows
            xrows = len(rows)
            print xrows
            xcolumn = len(rows[0])

            model = QtGui.QStandardItemModel(xrows, xcolumn)
            model.setHorizontalHeaderLabels([
                'TaskID', 'Created By', 'Status', 'Valid From Date',
                'Valid To Date', 'Comment'
            ])
            for i in range(xrows):
                for j in range(xcolumn):
                    item = QtGui.QStandardItem(str(rows[i][j]))
                    model.setItem(i, j, item)
                    item.setFlags(QtCore.Qt.ItemIsSelectable
                                  | QtCore.Qt.ItemIsEnabled)
            self.taskInfoTable.setModel(model)

        except:
            QMessageBox.information(self, "Message", "No Result Found!")
Exemplo n.º 7
0
    def zoomtoUPID(self,upid):
        try:
            connect = ConnectionHandler()
            cur = connect.connect_RECS()
            cur.execute("SELECT ID FROM RECS.T_PARCEL WHERE UNIQUEPARCELID = '%s'" % (upid))
            ID = cur.fetchall()
            if not ID:
                QMessageBox.information(self, "Invalid Parcel ID", "Invalid Unique Parcel ID !")
                return

            ids = []
            ids.append(ID[0][0])
            # print ids
            layers = iface.legendInterface().layers()  # All the Layers
            for layer in layers: # Extract the parcel layer from the given layers
                if layer.name() == 'PARCEL':
                    iface.setActiveLayer(layer)
            active_layer = iface.activeLayer()
            # print active_layer.name()
            active_layer.setSelectedFeatures(ids)
            mCanvas = iface.mapCanvas()
            mCanvas.zoomToSelected()

        except:
            print "There is an Exception !!"
    def populate(self):

            global model
            system='RECS'
            connect =  ConnectionHandler()
            cur = connect.connect_Common()
            cur.execute("select taskid, createdby,status,beginlifespan,endlifespan,MODIFICATIONDATE,comments from v_l1_task where system like '%s'"%(system))
            rows = cur.fetchall()
            xrows = len(rows)
            xcolumn = len(rows[0])
            i = 1
            j = 0
            model = QtGui.QStandardItemModel(xrows, xcolumn)
            model.setHorizontalHeaderLabels(['TaskID','Created By','Status','Valid From Date','Valid To Date','Date of Change','Comment'])
            for i in range(xrows):
                for j in range(xcolumn):
                    item = QtGui.QStandardItem(str(rows[i][j]))
                    model.setItem(i, j, item)
                    item.setFlags(QtCore.Qt.ItemIsSelectable| QtCore.Qt.ItemIsEnabled)
            self.taskListTable.setModel(model)
            filter_proxy_model = QtGui.QSortFilterProxyModel()
            filter_proxy_model.setSourceModel(model)
            filter_proxy_model.setFilterKeyColumn(1)
            filter_proxy_model2 = QtGui.QSortFilterProxyModel()
            filter_proxy_model2.setSourceModel(filter_proxy_model)
            filter_proxy_model2.setFilterKeyColumn(2)
            filter_proxy_model3 = QtGui.QSortFilterProxyModel()
            filter_proxy_model3.setSourceModel(filter_proxy_model2)
            filter_proxy_model3.setFilterKeyColumn(5)
            self.createdByText.textChanged.connect(filter_proxy_model.setFilterRegExp)
            self.taskListTable.setModel(filter_proxy_model)
            self.connect(self.comboBoxTaskStatus,SIGNAL("currentIndexChanged(QString)"),filter_proxy_model2.setFilterRegExp)
            self.taskListTable.setModel(filter_proxy_model2)
    def populate(self,taskID):
        featuresOfTask=FeatureTask()
        lst_oid=featuresOfTask.taskOid(taskID)
        i = 1
        j = 0
        no_rows = len(lst_oid)
        no_column=15
        x= ', '.join(lst_oid)
        #z='"'+'", "'.join(lst_oid)+'"'
        oids="'"+"', '".join(lst_oid)+"'"
        self.currentTaskTable.setColumnCount(no_column)
        self.currentTaskTable.setRowCount(no_rows)
        self.currentTaskTable.setHorizontalHeaderLabels(['Unique Parcel ID','Block No', 'Street Name', 'Street No', 'Woreda Code', ' Area', 'Area_D','Area_M','Perimeter','Perimeter_D','Perimeter_M','OID','Begin Lifespan','End Lifespan','Voided','Surveyed'])

        con=ConnectionHandler()
        cur=con.connect_RECS()
        cur.execute( "select uniqueparcelid,block_no,street_name,street_no,woredacode, area,area_d,area_m,perimeter,perimeter_d,perimeter_m,oid,beginlifespan,endlifespan,voided,surveyed from v_l2_parcel where oid in (%s)" % (oids))

        fetchedData=cur.fetchall()
        print fetchedData
        for i in range(no_rows):
            for j in range(no_column):
                item = QtGui.QTableWidgetItem(str(fetchedData[i][j]))
                self.currentTaskTable.setItem(i, j, item)
                item.setFlags(QtCore.Qt.ItemIsSelectable| QtCore.Qt.ItemIsEnabled)
Exemplo n.º 10
0
    def getAttribData(self,taskID):
		from feature_curent_task_dialog import taskFeatures
		obj=taskFeatures()
		print obj.rowClicked()
		global fetchedData
		global t_id
		t_id = taskID
		obj = FinishTask()
		oid = obj.getOldOid(t_id)
		con=ConnectionHandler()
		cur=con.connect_RECS()
		cur.execute( "select block_no,street_name,street_no,woredacode, area,area_d,area_m,perimeter,perimeter_d,perimeter_m,beginlifespan,endlifespan,voided,surveyed,uniqueparcelid  from v_l2_parcel where oid='%s'"%(oid[0]))
		fetchedData=cur.fetchall()
		print len(fetchedData[0])
		print fetchedData
		self.lineEdit.setText(str(fetchedData[0][14]))
		self.lineEdit_3.setText(str(fetchedData[0][0]))
		self.lineEdit_4.setText(str(fetchedData[0][1]))
		self.lineEdit_5.setText(str(fetchedData[0][2]))
		self.lineEdit_6.setText(str(fetchedData[0][3]))
		self.lineEdit_7.setText(str(fetchedData[0][4]))
		self.lineEdit_8.setText(str(fetchedData[0][5]))
		self.lineEdit_9.setText(str(fetchedData[0][6]))
		self.lineEdit_10.setText(str(fetchedData[0][7]))
		self.lineEdit_14.setText(str(fetchedData[0][10]))
		self.lineEdit_13.setText(oid[0])
		self.lineEdit_15.setText(str(fetchedData[0][11]))
Exemplo n.º 11
0
 def isLocked(self,upid):
     connect = ConnectionHandler()
     cur = connect.connect_RECS()
     cur.execute(u"select taskidfk from t_spatialunit where id in( select spatialunitidfk from t_parcel where uniqueparcelid like " + "'%" + upid +"%'" " )"  )
     retval = cur.fetchall()
     if retval[0][0] == None:
         return False
     else:
         return True
Exemplo n.º 12
0
 def getUpi(self,Oid):
     con = ConnectionHandler()
     cur = con.connect_RECS()
     cur.execute("select id from t_spatialunit where oid = '%s'" % (Oid))
     id = cur.fetchall()
     ids=id[0][0]
     cur.execute("select uniqueparcelid from t_parcel where spatialunitidfk in '%s'" % (ids))
     upi = cur.fetchall()
     upiV=upi[0][0]
     # print upiV
     self.zoomtoUPID(upiV)
Exemplo n.º 13
0
 def isLocked(self, upid):
     connect = ConnectionHandler()
     cur = connect.connect_RECS()
     cur.execute(
         u"select taskidfk from t_spatialunit where id in( select spatialunitidfk from t_parcel where uniqueparcelid like "
         + "'%" + upid + "%'"
         " )")
     retval = cur.fetchall()
     if retval[0][0] == None:
         return False
     else:
         return True
Exemplo n.º 14
0
    def getInitXml(self,taskid):
        con = ConnectionHandler()
        cur = con.connect_Common()
        cur.execute("select INITXML from T_TASK where TASKID = '%s'" % (taskid))
        rows = cur.fetchall()
        xmlData = rows[0][0].read()
        print xmlData
        xmlDoc = ET.fromstring(xmlData)
        task = (xmlDoc[1][7])[1][0].text

        # print task
        self.getUpi(task)
Exemplo n.º 15
0
 def getOldOid(self,taskid):
     con = ConnectionHandler()
     cur = con.connect_Common()
     cur.execute("select INITXML from T_TASK where TASKID = '%s'" % (taskid))
     rows = cur.fetchall()
     xmlData = rows[0][0].read()
     print xmlData
     xmlDoc = ET.fromstring(xmlData)
     print xmlDoc
     oid = (xmlDoc[1][7])[1][0].text
     bls = (xmlDoc[1][7])[1][1].text
     els = (xmlDoc[1][7])[1][2].text
     return [oid,bls,els]
    def loadTaskClicked(self,taskID):
        print taskID
        layers = iface.legendInterface().layers()
        for layer in layers:
           if layer.name() == 'TaskLayer':
               QgsMapLayerRegistry.instance().removeMapLayer(layer.id())
        load=LoadTask()
        load.loadXML(taskID)
        connect =  ConnectionHandler()
        cur = connect.connect_Common()
        cur.execute("SELECT dataxml FROM t_task WHERE Taskid = '%s'" % (taskID))
        dataXML = cur.fetchall()[0][0].read()
        dirname = "Z:\\GMLFile\\"
        pathDir = os.path.dirname(dirname)
        if not os.path.exists(pathDir):
            os.makedirs(pathDir)
        save_path = 'Z:\\GMLFile\\'
        name_of_file = str(taskID)
        completeName = os.path.join(save_path, name_of_file+".gml")
        openFile = open(completeName, "w")
        openFile.write(dataXML)
        openFile.close()
        parsedGML = GMLParser()
        parsedGML.createXML(taskID)
        #self.gmlWrite()

        iface.addVectorLayer("Z:\\GMLFile\\ogrGML.gml","gmlToShape","ogr")
        for layer in layers:
           if layer.name() == 'gmlToShape':
             iface.setActiveLayer(layer)
        _vlayer = iface.activeLayer()	
        QgsVectorFileWriter.writeAsVectorFormat(_vlayer,"Z:\\GMLFile\\%s.shp"%(taskID),"utf-8",None,"ESRI Shapefile")
        layers = iface.legendInterface().layers()
        for layer in layers:
            if layer.name() == 'gmlToShape':
                print layer.name()
                QgsMapLayerRegistry.instance().removeMapLayer(layer.id())
		
        #QgsMapLayerRegistry.instance().removeAllMapLayers()
        iface.addVectorLayer("Z:\\GMLFile\\%s.shp"%(taskID),"TaskLayer","ogr")
        vLayer=iface.activeLayer()
        canvas = iface.mapCanvas()
        extent = vLayer.extent()
        canvas.setExtent(extent)
        symbols=vLayer.rendererV2().symbols()
        symbol=symbols[0]
        symbol.setColor(QtGui.QColor.fromRgb(255,248,220))
        vLayer.setLayerTransparency(50)
Exemplo n.º 17
0
 def taskOid(self,taskid):
     con = ConnectionHandler()
     cur = con.connect_Common()
     cur.execute("select INITXML from T_TASK where TASKID = '%s'" % (taskid))
     rows = cur.fetchall()
     xmlData = rows[0][0].read()
     # y="""<?xml version="1.0" encoding="utf-8"?><InitTask xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://hansaluftbild.de/InitTaskTPF.xsd"><Metadata><SystemName>RECS</SystemName><TPFProxyId>Bole</TPFProxyId></Metadata><Task><TASKID>Bole-1003</TASKID><CREATEDBY>yarecs</CREATEDBY><MODIFIEDBY>yarecs</MODIFIEDBY><CREATIONDATE>2016-06-30T17:05:20.3064695+03:00</CREATIONDATE><MODIFICATIONDATE>2016-06-30T17:05:20.3064695+03:00</MODIFICATIONDATE><BEGINLIFESPAN>2016-06-30</BEGINLIFESPAN><TRANSACTIONTYPEIDFK>14</TRANSACTIONTYPEIDFK><TaskObject><Type>Parcel</Type><ExistingObjectIdentifier><OID>ETH0001000000-00000157677</OID><BEGINLIFESPAN>2012-03-30</BEGINLIFESPAN><ENDLIFESPAN>3000-12-31</ENDLIFESPAN></ExistingObjectIdentifier><ExistingObjectIdentifier><OID>ETH0001000000-00000157674</OID><BEGINLIFESPAN>2012-03-30</BEGINLIFESPAN><ENDLIFESPAN>3000-12-31</ENDLIFESPAN></ExistingObjectIdentifier></TaskObject><COMMENTS /><SubCityCode>06</SubCityCode></Task></InitTask>"""
     #xmlDoc = ET.fromstring(y)
     import xml.dom.minidom
     doc = xml.dom.minidom.parseString(xmlData);
     parcels = doc.getElementsByTagName("ExistingObjectIdentifier")
     lst_oid=[]
     for parcel in parcels:
         OID = parcel.getElementsByTagName('OID')[0]
         OIDValue = OID.childNodes[0].data
         lst_oid.append(OIDValue)
     #print len(lst_oid)
     return lst_oid
    def rowClicked(self):
        global rows
        global taskID
        model = self.taskListTable.model()
        print model.rowCount()
        #x=model.data(1,1)
        #print str(x)
        indexes = self.taskListTable.selectionModel().selectedRows()

        for index in sorted(indexes):
            rowIndex=index.row()
            index = model.index(rowIndex, 0)
            itm=str(model.data(index))
        taskID = itm
        self.currentTaskLabel.setText("Current Task: "+str(taskID))

        try:
            connect =  ConnectionHandler()
            cur = connect.connect_Common()
            cur.execute(
                "select taskid, createdby,status,beginlifespan,endlifespan,comments from v_l1_task WHERE taskid = '%s'" % (
                    taskID))
            rows = cur.fetchall()
            xrows = len(rows)
            xcolumn = len(rows[0])

            self.propertiesTable.setColumnCount(xrows)
            self.propertiesTable.setRowCount(xcolumn)
            self.propertiesTable.setVerticalHeaderLabels(
                ['TaskID', 'Created By','Status', 'Modified By', 'Creation Date', 'Modification Date', 'Begin Life Span',
                 'End Life Span', 'Task Status', 'Comment'])
            for column in range(xcolumn):
                for row in range(xrows):
                    item = QtGui.QTableWidgetItem(str(rows[row][column]))
                    self.propertiesTable.setItem(row, column, item)
                    item.setFlags(QtCore.Qt.ItemIsEnabled)

        except:
            QMessageBox.information(self, "Connection Error", "Unable to Connect!")
Exemplo n.º 19
0
    def searchClicked(self):

      try:


         UPID = self.fetrID.text()
         connect =  ConnectionHandler()
         cur = connect.connect_RECS()
         cur.execute("SELECT ID FROM RECS.T_PARCEL WHERE UNIQUEPARCELID = '%s'" % (UPID))
         ID = cur.fetchall()
         if not ID:
           QMessageBox.information(self, "Message", "Invalid Unique Parcel ID ! \n Please enter a valid unique parcel ID!")
           return None
         active_layer = iface.activeLayer()
         ids = []
         ids.append(ID[0][0])
         print ids
         active_layer.setSelectedFeatures(ids)
         mCanvas = iface.mapCanvas()
         mCanvas.zoomToSelected()
      except:
          QMessageBox.information(self, "Message", "Select a Parcel!")
Exemplo n.º 20
0
    def populate(self):
        try:

                system="RECS"
                connect =  ConnectionHandler()
                cur = connect.connect_Common()
                cur.execute("select taskid, transactiontype,createdby,beginlifespan,endlifespan,status,comments from v_l1_task where system like '%s' and taskid like '%s' "%(system,taskId))
                rows = cur.fetchall()
                print rows
                xrows = len(rows)
                print xrows
                xcolumn = len(rows[0])

                model = QtGui.QStandardItemModel(xrows, xcolumn)
                model.setHorizontalHeaderLabels(['TaskID','Created By','Status','Valid From Date','Valid To Date','Comment'])
                for i in range(xrows):
                    for j in range(xcolumn):
                        item = QtGui.QStandardItem(str(rows[i][j]))
                        model.setItem(i, j, item)
                        item.setFlags(QtCore.Qt.ItemIsSelectable| QtCore.Qt.ItemIsEnabled)
                self.taskInfoTable.setModel(model)

        except:
            QMessageBox.information(self, "Message", "No Result Found!")
Exemplo n.º 21
0
    def createShape(self, taskID):
        load = LoadTask()
        load.loadXML(taskID)
        connect = ConnectionHandler()
        cur = connect.connect_Common()
        cur.execute("SELECT dataxml FROM t_task WHERE Taskid = '%s'" %
                    (taskID))
        dataXML = cur.fetchall()[0][0].read()
        dirname = "Z:\\GMLFile\\"
        pathDir = os.path.dirname(dirname)
        if not os.path.exists(pathDir):
            os.makedirs(pathDir)
        save_path = 'Z:\\GMLFile\\'
        name_of_file = str(taskID)
        completeName = os.path.join(save_path, name_of_file + ".gml")
        openFile = open(completeName, "w")
        openFile.write(dataXML)
        openFile.close()
        parsedGML = GMLParser()
        parsedGML.createXML(taskID)
        #self.gmlWrite()

        iface.addVectorLayer("Z:\\GMLFile\\ogrGML.gml", "gmlToShape", "ogr")
        layers = iface.legendInterface().layers()
        for layer in layers:
            if layer.name() == 'gmlToShape':
                iface.setActiveLayer(layer)
        _vlayer = iface.activeLayer()
        QgsVectorFileWriter.writeAsVectorFormat(
            _vlayer, "Z:\\GMLFile\\%s.shp" % (taskID), "utf-8", None,
            "ESRI Shapefile")
        layers = iface.legendInterface().layers()
        for layer in layers:
            if layer.name() == 'gmlToShape':
                #print layer.name()
                QgsMapLayerRegistry.instance().removeMapLayer(layer.id())
Exemplo n.º 22
0
    def populate(self):
        taskMgrDlg=TaskManagerDialog()
        OID=taskMgrDlg.oid_value()
        print OID
        con=ConnectionHandler()
        cur=con.connect_RECS()
        cur.execute(
                "select block_no,street_name,street_no,woredacode, area,area_d,area_m,perimeter,perimeter_d,perimeter_m,beginlifespan,endlifespan,voided,surveyed,uniqueparcelid  from v_l2_parcel where oid='%s'"%(OID))

        fetchedData=cur.fetchall()
        print fetchedData
        self.lineEdit.setText(str(fetchedData[0][14]))
        self.lineEdit_3.setText(str(fetchedData[0][0]))
        self.lineEdit_4.setText(str(fetchedData[0][1]))
        self.lineEdit_5.setText(str(fetchedData[0][2]))
        self.lineEdit_6.setText(str(fetchedData[0][3]))
        self.lineEdit_7.setText(str(fetchedData[0][4]))
        self.lineEdit_8.setText(str(fetchedData[0][5]))
        self.lineEdit_9.setText(str(fetchedData[0][6]))
        self.lineEdit_10.setText(str(fetchedData[0][7]))
        self.lineEdit_14.setText(str(fetchedData[0][10]))
        self.lineEdit_13.setText(OID)
        self.lineEdit_15.setText(str(fetchedData[0][11]))
        print fetchedData
Exemplo n.º 23
0
 def query_Oracle(self,upid):
     connect = ConnectionHandler()
     cur = connect.connect_RECS()
     cur.execute(u"select oid,beginlifespan,endlifespan  from t_spatialunit where id in ( select spatialunitidfk from t_parcel where uniqueparcelid like " + "'%" + upid +"%'" " )"  )
     retval = cur.fetchall()
     return retval
Exemplo n.º 24
0
 def getParcelType(self,uiParcelTypeChoosed):
     con = ConnectionHandler()
     cur = con.connect_RECS()
     cur.execute("select id from t_parceltype where parceltype = '%s'" % (uiParcelTypeChoosed))
     retval = cur.fetchall()
     return retval[0][0]
Exemplo n.º 25
0
 def getSizeData(self,oid):
     connect = ConnectionHandler()
     cur = connect.connect_RECS()
     cur.execute(u"select area,perimeter from t_parcel where spatialunitidfk in (select id from t_spatialunit where oid = '%s')"%(str(oid)))
     retval = cur.fetchall()
     return retval[0]
Exemplo n.º 26
0
 def getNewOid(self):
     con = ConnectionHandler()
     cur = con.connect_Common()
     cur.execute("select OID_SEQ.nextval from DUAL")
     retval = cur.fetchall()
     return 'ETH0001006000-'+ '{:011d}'.format(retval[0][0])
Exemplo n.º 27
0
 def getAdminData(self,taskId):
     connect = ConnectionHandler()
     cur = connect.connect_Common()
     cur.execute(u"select createdby,modifiedby, creationdate,modificationdate  from t_task where taskid = '%s'" % (taskId) )
     retval = cur.fetchall()
     return retval[0]