当前位置: 首页>>代码示例>>Python>>正文


Python Library.konversi_titik_ke_garis方法代码示例

本文整理汇总了Python中library.Library.konversi_titik_ke_garis方法的典型用法代码示例。如果您正苦于以下问题:Python Library.konversi_titik_ke_garis方法的具体用法?Python Library.konversi_titik_ke_garis怎么用?Python Library.konversi_titik_ke_garis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在library.Library的用法示例。


在下文中一共展示了Library.konversi_titik_ke_garis方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from library import Library [as 别名]
# 或者: from library.Library import konversi_titik_ke_garis [as 别名]

#.........这里部分代码省略.........
        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
        self.adj_lib = Library(self.layer_a, self.layer_b, 10, jarak_klaim)
        list_g_eq, list_g_cc, list_g_gk = self.adj_lib.proses_sb(t_awal_a,
                                                                 t_awal_b,
                                                                 ttk_akhir,
                                                                 list_feat)
开发者ID:ivanbusthomi,项目名称:EqDistant,代码行数:70,代码来源:eq_distant.py


注:本文中的library.Library.konversi_titik_ke_garis方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。