ign-pdal-tools 1.7.10__py3-none-any.whl → 1.7.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ign_pdal_tools-1.7.10.dist-info → ign_pdal_tools-1.7.11.dist-info}/METADATA +1 -1
- {ign_pdal_tools-1.7.10.dist-info → ign_pdal_tools-1.7.11.dist-info}/RECORD +7 -7
- pdaltools/_version.py +1 -1
- pdaltools/add_points_in_pointcloud.py +20 -22
- {ign_pdal_tools-1.7.10.dist-info → ign_pdal_tools-1.7.11.dist-info}/WHEEL +0 -0
- {ign_pdal_tools-1.7.10.dist-info → ign_pdal_tools-1.7.11.dist-info}/licenses/LICENSE.md +0 -0
- {ign_pdal_tools-1.7.10.dist-info → ign_pdal_tools-1.7.11.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
ign_pdal_tools-1.7.
|
|
2
|
-
pdaltools/_version.py,sha256=
|
|
1
|
+
ign_pdal_tools-1.7.11.dist-info/licenses/LICENSE.md,sha256=iVzCFZTUXeiqP8bP474iuWZiWO_kDCD4SPh1Wiw125Y,1120
|
|
2
|
+
pdaltools/_version.py,sha256=lXuB5yCoqB_XdA0YVaGjTGc2J_sFF0RE_IJePTMnyjI,75
|
|
3
3
|
pdaltools/add_points_in_las.py,sha256=TGbt5JUkszjmbQiA2LCUntsjz6A8DHb7QPIXGDuEgWA,3643
|
|
4
|
-
pdaltools/add_points_in_pointcloud.py,sha256=
|
|
4
|
+
pdaltools/add_points_in_pointcloud.py,sha256=UHdC8tFagsehGggkLJCcmBCi8gknJOL4s99f_2TJjsA,12538
|
|
5
5
|
pdaltools/color.py,sha256=-a0ramyLMkZX4-M3siPq1zIio5u-a0p8UzvgcfoU6zU,8313
|
|
6
6
|
pdaltools/las_add_buffer.py,sha256=sBpTywlfsHHS8KuCUa-eydB2hylshEvjrMQt5TrqXb8,11275
|
|
7
7
|
pdaltools/las_clip.py,sha256=GvEOYu8RXV68e35kU8i42GwSkbo4P9TvmS6rkrdPmFM,1034
|
|
@@ -12,7 +12,7 @@ pdaltools/pcd_info.py,sha256=NIAH5KGikVDQLlbCcw9FuaPqe20UZvRfkHsDZd5kmZA,3210
|
|
|
12
12
|
pdaltools/replace_attribute_in_las.py,sha256=po1F-fi8s7iilqKWaryW4JRbsmdMOUe0yGvG3AEKxtk,4771
|
|
13
13
|
pdaltools/standardize_format.py,sha256=gqm2GJbtDkT4k4oC_NX2LIPh9R2BLh4sMHLKYgfKrMc,3973
|
|
14
14
|
pdaltools/unlock_file.py,sha256=pIThdWMNkTph0xgJVVRaM1o9aUMQhM6804PscScB3JI,1963
|
|
15
|
-
ign_pdal_tools-1.7.
|
|
16
|
-
ign_pdal_tools-1.7.
|
|
17
|
-
ign_pdal_tools-1.7.
|
|
18
|
-
ign_pdal_tools-1.7.
|
|
15
|
+
ign_pdal_tools-1.7.11.dist-info/METADATA,sha256=Bh4cFjnGLLt4DpiPw8GQuknhDTrLQqx3H5EjkFzV1n4,5745
|
|
16
|
+
ign_pdal_tools-1.7.11.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
17
|
+
ign_pdal_tools-1.7.11.dist-info/top_level.txt,sha256=KvGW0ZzqQbhCKzB5_Tp_buWMZyIgiO2M2krWF_ecOZc,10
|
|
18
|
+
ign_pdal_tools-1.7.11.dist-info/RECORD,,
|
pdaltools/_version.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import argparse
|
|
2
|
-
import
|
|
2
|
+
from shutil import copy2
|
|
3
3
|
|
|
4
4
|
import geopandas as gpd
|
|
5
5
|
import laspy
|
|
@@ -127,25 +127,22 @@ def add_points_to_las(
|
|
|
127
127
|
crs (str): CRS of the data.
|
|
128
128
|
virtual_points_classes (int): The classification value to assign to those virtual points (default: 66).
|
|
129
129
|
"""
|
|
130
|
-
|
|
131
130
|
if input_points_with_z.empty:
|
|
132
131
|
print(
|
|
133
132
|
"No points to add. All points of the geojson file are outside the tile. Copying the input file to output"
|
|
134
133
|
)
|
|
135
|
-
shutil.copy(input_las, output_las)
|
|
136
|
-
|
|
137
134
|
return
|
|
138
135
|
|
|
139
136
|
# Extract XYZ coordinates and additional attribute (classification)
|
|
137
|
+
nb_points = len(input_points_with_z.geometry.x)
|
|
140
138
|
x_coords = input_points_with_z.geometry.x
|
|
141
139
|
y_coords = input_points_with_z.geometry.y
|
|
142
140
|
z_coords = input_points_with_z.geometry.z
|
|
143
|
-
classes = virtual_points_classes * np.ones(
|
|
141
|
+
classes = virtual_points_classes * np.ones(nb_points)
|
|
144
142
|
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
# Open the input LAS file to check and possibly update the header of the output
|
|
144
|
+
with laspy.open(input_las) as las:
|
|
147
145
|
header = las.header
|
|
148
|
-
|
|
149
146
|
if not header:
|
|
150
147
|
header = laspy.LasHeader(point_format=8, version="1.4")
|
|
151
148
|
if crs:
|
|
@@ -155,20 +152,21 @@ def add_points_to_las(
|
|
|
155
152
|
raise ValueError(f"Invalid CRS: {crs}")
|
|
156
153
|
header.add_crs(crs_obj)
|
|
157
154
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
155
|
+
# Copy data pointcloud
|
|
156
|
+
copy2(input_las, output_las)
|
|
157
|
+
|
|
158
|
+
# Add the new points with 3D points
|
|
159
|
+
nb_points = len(x_coords)
|
|
160
|
+
with laspy.open(output_las, mode="a", header=header) as output_las: # mode `a` for adding points
|
|
161
|
+
# create nb_points points with "0" everywhere
|
|
162
|
+
new_points = laspy.ScaleAwarePointRecord.zeros(nb_points, header=header) # use header for input_las
|
|
163
|
+
# then fill in the gaps (X, Y, Z an classification)
|
|
164
|
+
new_points.x = x_coords.astype(new_points.x.dtype)
|
|
165
|
+
new_points.y = y_coords.astype(new_points.y.dtype)
|
|
166
|
+
new_points.z = z_coords.astype(new_points.z.dtype)
|
|
167
|
+
new_points.classification = classes.astype(new_points.classification.dtype)
|
|
168
|
+
|
|
169
|
+
output_las.append_points(new_points)
|
|
172
170
|
|
|
173
171
|
|
|
174
172
|
def line_to_multipoint(line, spacing: float, z_value: float = None):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|