Beispiel #1
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)
Beispiel #2
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 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]))
Beispiel #4
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,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)
    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]))
 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
Beispiel #8
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)
Beispiel #9
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
    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 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
Beispiel #12
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
Beispiel #13
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]
Beispiel #14
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]