QEsg_20Sancad.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:QEsg 作者: jorgealmerio 项目源码 文件源码
def ExtendToMont(self,Geom, dist=4):#Retorna geometria com linha estendida #x1,y1,x2,y2
        poli=Geom.asPolyline()
        pto1=poli[0]
        pto2=poli[1]
        x1=pto1.x()
        y1=pto1.y()
        x2=pto2.x()
        y2=pto2.y()
        Alfa=math.atan2(y2-y1,x2-x1)
        dx=dist*math.cos(Alfa)
        dy=dist*math.sin(Alfa)
        xp=x1-dx
        yp=y1-dy
        pto1_est=QgsPoint(xp,yp)
        newGeo=QgsGeometry.fromPolyline([pto1_est,pto2])
        return newGeo
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号