def uppoints(self): """Return""" name_map = self.name_map + "__Topo" topo = VectorTopo(name_map) topo.open("r", layer=1) pts_org = [] pts_chg = [] attrs = [] for i in range(1, len(topo) + 1): act = topo.read(i).attrs["action"] if act != "": cat = topo.read(i).attrs["cat"] pto_org = topo.cat(cat, "points", 1)[0] pto_chg = Point(pto_org.x, pto_org.y, pto_org.z) if topo.read(i).attrs["x"] is not None: pto_chg.x = float(topo.read(i).attrs["x"]) if topo.read(i).attrs["y"] is not None: pto_chg.y = float(topo.read(i).attrs["y"]) if topo.read(i).attrs["z"] is not None: pto_chg.z = float(topo.read(i).attrs["z"]) pts_org.append(pto_org) pts_chg.append(pto_chg) attrs.append( [ cat, topo.read(i).attrs["pk"], topo.read(i).attrs["name"], topo.read(i).attrs["azi"], topo.read(i).attrs["p_type"], topo.read(i).attrs["align"], topo.read(i).attrs["vparam"], topo.read(i).attrs["v_type"], topo.read(i).attrs["terr"], topo.read(i).attrs["t_type"], topo.read(i).attrs["dist_d"], pto_chg.x, pto_chg.y, pto_chg.z, "", ] ) topo.close() if pts_org != []: topo.open("rw", 1, with_z=True) for i, pto in enumerate(pts_org): topo.rewrite(pto, pts_chg[i], attrs[i][1:]) topo.table.conn.commit() topo.close()
def uppoints(self): """ Return """ name_map = self.name_map + '__Topo' topo = VectorTopo(name_map) topo.open('r', layer=1) pts_org = [] pts_chg = [] attrs = [] for i in range(1, len(topo) + 1): act = topo.read(i).attrs['action'] if act != '': cat = topo.read(i).attrs['cat'] pto_org = topo.cat(cat, 'points', 1)[0] pto_chg = Point(pto_org.x, pto_org.y, pto_org.z) if topo.read(i).attrs['x'] is not None: pto_chg.x = float(topo.read(i).attrs['x']) if topo.read(i).attrs['y'] is not None: pto_chg.y = float(topo.read(i).attrs['y']) if topo.read(i).attrs['z'] is not None: pto_chg.z = float(topo.read(i).attrs['z']) pts_org.append(pto_org) pts_chg.append(pto_chg) attrs.append([ cat, topo.read(i).attrs['pk'], topo.read(i).attrs['name'], topo.read(i).attrs['azi'], topo.read(i).attrs['p_type'], topo.read(i).attrs['align'], topo.read(i).attrs['vparam'], topo.read(i).attrs['v_type'], topo.read(i).attrs['terr'], topo.read(i).attrs['t_type'], topo.read(i).attrs['dist_d'], pto_chg.x, pto_chg.y, pto_chg.z, '' ]) topo.close() if pts_org != []: topo.open('rw', 1, with_z=True) for i, pto in enumerate(pts_org): topo.rewrite(pto, pts_chg[i], attrs[i][1:]) topo.table.conn.commit() topo.close()