设置了缩放因数
This commit is contained in:
parent
b5e17a3b9e
commit
308259306f
14
dem.py
14
dem.py
|
|
@ -46,6 +46,8 @@ class Dem:
|
|||
return dem_row, dem_col, dem_band, dem_gt, dem_proj
|
||||
|
||||
def write_dxf(self):
|
||||
# TODO:不应该设置缩放因数
|
||||
zoom_factor=1
|
||||
excel_pfs = self._read_path_file()
|
||||
segments = []
|
||||
plate_doc = ezdxf.new(dxfversion="R2010")
|
||||
|
|
@ -53,8 +55,8 @@ class Dem:
|
|||
toml_dict = self._toml_dict
|
||||
out_dxf_file_dir = toml_dict["parameter"]["out_dxf_file_dir"]
|
||||
for foo in range(len(excel_pfs) - 1):
|
||||
start_point_name: str = excel_pfs.iloc[foo, 0]
|
||||
end_point_name: str = excel_pfs.iloc[foo + 1, 0]
|
||||
start_point_name: str = excel_pfs.iloc[foo, 3]
|
||||
end_point_name: str = excel_pfs.iloc[foo + 1, 3]
|
||||
point_x_s = float(excel_pfs.iloc[foo, 1])
|
||||
point_y_s = float(excel_pfs.iloc[foo, 2])
|
||||
point_x_e = float(excel_pfs.iloc[foo + 1, 1])
|
||||
|
|
@ -81,20 +83,20 @@ class Dem:
|
|||
x_axis.append(dem_utils.distance(cord, cord_0))
|
||||
dm_msp.add_polyline2d(
|
||||
[
|
||||
(x_axis[i] / 5, left_elevation[i] * 2)
|
||||
(x_axis[i] / 5/zoom_factor, left_elevation[i] * 2/zoom_factor)
|
||||
for i in range(len(left_elevation))
|
||||
],
|
||||
dxfattribs={"color": 1},
|
||||
) # 红色
|
||||
dm_msp.add_polyline2d(
|
||||
[
|
||||
(x_axis[i] / 5, center_elevation[i] * 2)
|
||||
(x_axis[i] / 5/zoom_factor, center_elevation[i] * 2/zoom_factor)
|
||||
for i in range(len(center_elevation))
|
||||
]
|
||||
)
|
||||
dm_msp.add_polyline2d(
|
||||
[
|
||||
(x_axis[i] / 5, right_elevation[i] * 2)
|
||||
(x_axis[i] / 5/zoom_factor, right_elevation[i] * 2/zoom_factor)
|
||||
for i in range(len(right_elevation))
|
||||
],
|
||||
dxfattribs={"color": 5},
|
||||
|
|
@ -104,7 +106,7 @@ class Dem:
|
|||
if self._tree_height > 0:
|
||||
dm_msp.add_polyline2d(
|
||||
[
|
||||
(x_axis[i] / 5, ( np.max( (center_elevation[i],left_elevation[i],right_elevation[i])) + self._tree_height) * 2)
|
||||
(x_axis[i] / 5/zoom_factor, ( np.max( (center_elevation[i],left_elevation[i],right_elevation[i])) + self._tree_height) * 2/zoom_factor)
|
||||
for i in range(len(center_elevation))
|
||||
]
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue