def constructBuildingClicked(): footProcessClicked() global draw_flag draw_flag = 1 inputPath = os.path.join(projPath, "input") flag = True if (len(inputPath) != 0): print wrk_drr os.chdir(wrk_drr + '\\3d-modelling') fw = open('temp.txt', 'w') s = inputPath.replace("\\", "\\\\") print "Str replaced" print s fw.write(s) fw.close() full_path = os.path.join(wrk_drr, r'resources/Google SketchUp 8/SketchUp.exe') print full_path ## subprocess.Popen(full_path) subprocess.call(full_path) unzip(os.path.join(projPath, "output")) #os.startfile("SketchUp.exe") threeD.pushButton_8.setEnabled(True) addPlacemark_new.main() print "\n\n\nEntering values in the database.. Please Wait\n" database_enter.run() print "\n All values have been added please move to the query section" threeD.pushButton_6.setStyleSheet(_fromUtf8("color: rgb(0, 85,0);")) return True
def constructBuildingClicked(): footProcessClicked(); global draw_flag draw_flag=1 inputPath=os.path.join(projPath,"input") flag = True if(len(inputPath) != 0): print wrk_drr os.chdir(wrk_drr+'\\3d-modelling') fw = open('temp.txt','w') s = inputPath.replace("\\", "\\\\" ) print "Str replaced" print s fw.write(s) fw.close() full_path=os.path.join(wrk_drr,r'resources/Google SketchUp 8/SketchUp.exe') print full_path ## subprocess.Popen(full_path) subprocess.call(full_path) unzip(os.path.join(projPath,"output")) #os.startfile("SketchUp.exe") threeD.pushButton_8.setEnabled(True) addPlacemark_new.main() print "\n\n\nEntering values in the database.. Please Wait\n" database_enter.run() print "\n All values have been added please move to the query section" threeD.pushButton_6.setStyleSheet(_fromUtf8("color: rgb(0, 85,0);")) return True
def constructBuildingClicked(): footProcessClicked(); global draw_flag draw_flag=1 inputPath=os.path.join(projPath,"input") outputPath=os.path.join(projPath,"output") flag = True files=os.listdir(inputPath) for filename in files: countJPG=0; hght=0.0; print "inside for loop",filename os.chdir(inputPath) if os.path.isdir(filename): print "inside first if" for files_build in os.listdir(os.path.join(inputPath,filename)): os.chdir(os.path.join(inputPath,filename)) with open("heights.txt",'r')as ht: print "ht is",ht ## build_ht=str(ht.readlines()) for lines in ht: list_ht=lines.split("\t") print "list_ht is",list_ht with open(filename+".txt") as fp: line= fp.readline() list_co= line.split("\t") x= list_co[1:9:2] y= list_co[2:9:2] import numpy as np import math import UTM as con ## x1 =float(x[0]) ## y1 = float(y[0]) ## print "coord x",x1 ## print "coord y",y1 ## ## np.savetxt('Outputcoordinates.txt', (x1,y1),fmt = '%.14f') ## x= np.array(x,float) y= np.array(y,float) print "x coordinates is", x print "y coordinates is", y (z, x[0], y[0]) = con.LLtoUTM(23,x[0],y[0]) (z, x[1], y[1]) = con.LLtoUTM(23,x[1],y[1]) (z, x[2], y[2]) = con.LLtoUTM(23,x[2],y[2]) (z, x[3], y[3]) = con.LLtoUTM(23,x[3],y[3]) x=x-x[0] y=y-y[0] print "x coordinates is", x print "y coordinates is", y #print(repr(z)) #a = float(z) if files_build.endswith('.jpg'): countJPG=countJPG+1; outputFileName=files_build.split(".")[0] print "inside if jpg","calling testpycollada",list_ht[countJPG] testpycollada.makeKML(os.path.join(inputPath,filename),os.path.join(outputPath,outputFileName) ,files_build,list_ht[countJPG],hght,x,y,filename,inputPath); hght=hght+float(list_ht[countJPG]) print "height of floor is",outputFileName,hght threeD.pushButton_8.setEnabled(True) #addPlacemark_new.main() print "\n\n\nEntering values in the database.. Wait\n" database_enter.run() print "\n All values have been added move to the query section" threeD.pushButton_6.setStyleSheet(_fromUtf8("color: rgb(0, 85,0);\n""font: 14pt \"Times New Roman\";")) return True
def constructBuildingClicked(): footProcessClicked(); global draw_flag draw_flag=1 inputPath=os.path.join(projPath,"input") outputPath=os.path.join(projPath,"output") flag = True files=os.listdir(inputPath) for filename in files: countJPG=0; hght=0.0; print "inside for loop",filename os.chdir(inputPath) if os.path.isdir(filename): print "inside first if" for files_build in os.listdir(os.path.join(inputPath,filename)): os.chdir(os.path.join(inputPath,filename)) with open("heights.txt",'r')as ht: print "ht is",ht for lines in ht: list_ht=lines.split("\t") print "list_ht is",list_ht with open(filename+".txt") as fp: line= fp.readline() list_co= line.split("\t") x= list_co[1:9:2] y= list_co[2:9:2] import numpy as np import math import UTM as con x= np.array(x,float) y= np.array(y,float) print "x coordinates is", x print "y coordinates is", y (z, x[0], y[0]) = con.LLtoUTM(23,x[0],y[0]) (z, x[1], y[1]) = con.LLtoUTM(23,x[1],y[1]) (z, x[2], y[2]) = con.LLtoUTM(23,x[2],y[2]) (z, x[3], y[3]) = con.LLtoUTM(23,x[3],y[3]) x=x-x[0] y=y-y[0] print "x coordinates is", x print "y coordinates is", y if files_build.endswith('.jpg'): countJPG=countJPG+1; outputFileName=files_build.split(".")[0] print "inside if jpg","calling testpycollada",list_ht[countJPG] testpycollada.makeKML(os.path.join(inputPath,filename),os.path.join(outputPath,outputFileName) ,files_build,list_ht[countJPG],hght,x,y,filename,inputPath); hght=hght+float(list_ht[countJPG]) print "height of floor is",outputFileName,hght threeD.pushButton_8.setEnabled(True) addPlacemark_new.main() print "\n\n\nEntering values in the database.. Wait\n" database_enter.run() print "\n All values have been added move to the query section" threeD.pushButton_6.setStyleSheet(_fromUtf8("color: rgb(0, 85,0);\n""font: 14pt \"Times New Roman\";")) return True