交通安全に係るビッグデータを活用するためのデータプラットフォーム構築の試み
97/110

91 rng = QgsRendererRangeV2(lower, upper, sym, label) ranges.append(rng) field = "Count" renderer = QgsGraduatedSymbolRendererV2(field, ranges) category_layer.setRendererV2(renderer) category_layer.setLayerTransparency(60) QgsMapLayerRegistry.instance().addMapLayer(category_layer) map_canvas.freeze(False) map_canvas.repaint() self.iface.zoomToActiveLayer () def run(self): """Run method that performs all the real work""" #set the deflault value in the form self.tab_reSet() # show the dialog self.dlg.show() # change the contents into default valves when the tab_selected is changed self.dlg.crash_map.currentChanged.connect(self.tab_reSet) self.dlg.mesh_comboBox_start.currentIndexChanged.connect(self.year_compare) self.dlg.mesh_comboBox_end.currentIndexChanged.connect(self.year_compare) self.dlg.plot_comboBox_start.currentIndexChanged.connect(self.year_compare) self.dlg.plot_comboBox_end.currentIndexChanged.connect(self.year_compare) # Run the dialog event loop result = self.dlg.exec_() # See if OK was pressed if result: QgsMapLayerRegistry.instance().removeAllMapLayers() if self.dlg.crash_map.currentIndex()==0: #load the mesh statistical data_start if self.dlg.radioButton_500mesh.isChecked()==True: mesh_size=500 else: if self.dlg.radioButton_250mesh.isChecked()==True: mesh_size=250 else: mesh_size=100 start_year=self.dlg.mesh_comboBox_start.currentText() end_year=self.dlg.mesh_comboBox_end.currentText() if self.dlg.mesh_radioButton_narrow.isChecked()==True: narrow_flag=1 else: narrow_flag=0 self.load_mesh(mesh_size,start_year,end_year,narrow_flag) #load the mesh statistical data_end else : #load the plot data_start if self.dlg.radioButton_school.isChecked()==True: zone_size=1 else : if self.dlg.radioButton_choaza.isChecked()==True: zone_size=2 else: zone_size=3

元のページ  ../index.html#97

このブックを見る