本文整理汇总了Python中library.Library.proses_hdp方法的典型用法代码示例。如果您正苦于以下问题:Python Library.proses_hdp方法的具体用法?Python Library.proses_hdp怎么用?Python Library.proses_hdp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类library.Library
的用法示例。
在下文中一共展示了Library.proses_hdp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from library import Library [as 别名]
# 或者: from library.Library import proses_hdp [as 别名]
#.........这里部分代码省略.........
self.list_feat_garis_a = [feat for feat in self.layer_a.getFeatures()]
self.update_poi_info_a()
def update_poi_info_a(self):
self.layer_ttk_a = self.lib.konversi_garis_ke_titik(self.list_feat_garis_a, "A")
self.list_feat_ttk_a = [feat for feat in self.layer_ttk_a.getFeatures()]
jml_ttk_a = len(self.list_feat_ttk_a)
self.dlg.labelTitikA.setText(str(jml_ttk_a) + " points")
def cek_terpilih_b(self):
if self.dlg.checkBox_pilihB.isChecked():
self.list_feat_garis_b = [feat for feat in self.layer_b.selectedFeatures()]
else:
self.list_feat_garis_b = [feat for feat in self.layer_b.getFeatures()]
self.update_poi_info_b()
def update_poi_info_b(self):
self.layer_ttk_b = self.lib.konversi_garis_ke_titik(self.list_feat_garis_b, "B")
self.list_feat_ttk_b = [feat for feat in self.layer_ttk_b.getFeatures()]
jml_ttk_b = len(self.list_feat_ttk_b)
self.dlg.labelTitikB.setText(str(jml_ttk_b) + " points")
# --- eksekusi algoritma
def hdp_deploy(self):
list_geom_a = [feat.geometry() for feat in self.list_feat_garis_a]
list_geom_b = [feat.geometry() for feat in self.list_feat_garis_b]
list_ft = self.list_feat_ttk_a + self.list_feat_ttk_b
# pendefinisian titik awal
t_awal_a = self.lib.titik_pada_garis(self.dlg.start_a, list_geom_a)
t_akhr_a = self.lib.titik_pada_garis(self.dlg.end_a, list_geom_a)
t_awal_b = self.lib.titik_pada_garis(self.dlg.start_b, list_geom_b)
t_akhr_b = self.lib.titik_pada_garis(self.dlg.end_b, list_geom_b)
# iterasi
list_g_eq, list_g_cc, list_g_grs_k = self.lib.proses_hdp(t_awal_a,
t_awal_b,
t_akhr_a,
t_akhr_b,
list_ft)
self.lib.konversi_titik_ke_garis(list_g_cc)
if self.dlg.checkBox_cLine.isChecked():
self.lib.buat_layer_garis_k(list_g_grs_k)
if self.dlg.checkBox_titikEq.isChecked():
self.lib.buat_layer_titik(list_g_cc)
def sblh_deploy(self):
list_geom_a = [feat.geometry() for feat in self.list_feat_garis_a]
list_geom_b = [feat.geometry() for feat in self.list_feat_garis_b]
list_feat = self.list_feat_ttk_a + self.list_feat_ttk_b
t_awal_a = self.lib.titik_pada_garis(self.dlg.adj_start_a, list_geom_a)
t_awal_b = self.lib.titik_pada_garis(self.dlg.adj_start_b, list_geom_b)
list_t_akhir = []
for a in list_geom_a:
for b in list_geom_b:
if a.intersects(b):
t_akhir = a.intersection(b)
list_t_akhir.append(t_akhir)
else:
pass
if len(list_t_akhir) == 0:
raise ValueError("No end point detected")
elif len(list_t_akhir) > 1:
raise ValueError("More than one end point detected")
else:
g_akhir = list_t_akhir[0]
ttk_akhir = g_akhir.asPoint()
jarak_klaim = int(self.dlg.adj_claim_dist.text())*1852