示例#1
0
文件: plugin.py 项目: verzhak/sfire
    def op_3(self):

        self.__op_begin()

        try:

            (child, queue) = sfire.process(
                sat_dname=str(self.__ui.prepare_3.text().toUtf8()),
                result_fname=str(self.__ui.dst_3.text().toUtf8()),
                shp_aoi_fname=str(self.__ui.aoi_3.text().toUtf8()),
                shp_forest_fname=str(self.__ui.forest_3.text().toUtf8()),
                svm_fname=[str(self.__ui.svm_123_3.text().toUtf8()), str(self.__ui.svm_12_3.text().toUtf8())],
            )

            if self.__wait(child, queue) and self.__ui.is_load_3.isChecked():

                path = self.__ui.dst_3.text()
                layer = QgsRasterLayer(path, QFileInfo(path).baseName())

                if not layer.isValid():

                    raise

                QgsMapLayerRegistry.instance().addMapLayer(layer)

        except:

            self.__message("Fail")

        self.__op_end()
示例#2
0
文件: test.py 项目: verzhak/sfire
	(child, queue) = sfire.teach(in_fname = [ out_prefix + "/teach_0.bin", out_prefix + "/teach_1.bin", out_prefix + "/teach_2.bin" ],
						out_fname = [ out_prefix + "/svm_012.svm", out_prefix + "/svm_01.svm" ])

elif argv[1] == "3":

	# Обработка спутниковых снимков

	sat = "LT51760222006244MOR00" # 01.09.2006 - LandSat 5
#	sat = "LT51760222007167MOR00" # 16.06.2007 - LandSat 5
#	sat = "LT51760222010175MOR00" # 24.06.2010 - LandSat 5
#	sat = "LT51760222011210MOR00" # 29.07.2011 - LandSat 5

	sat_dname = data_prefix + "/" + sat + "/"
	result_fname = out_prefix + "/" + sat + ".tif"
		
	(child, queue) = sfire.process(sat_dname, result_fname, shp_aoi_fname = out_prefix + "/aoi/aoi.shp", shp_forest_fname = out_prefix + "/forest/forest.shp",
			svm_fname = [ out_prefix + "/svm_012.svm", out_prefix + "/svm_01.svm" ])

	print("---------------------->", sat_dname)

else:

	raise Exception("Неизвестный первый аргумент")

while child.is_alive():

	try:

		msg = queue.get(timeout = 1)
		print(msg)

	except: