ign-pdal-tools 1.15.2__py3-none-any.whl → 1.15.4__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.15.2.dist-info → ign_pdal_tools-1.15.4.dist-info}/METADATA +1 -1
- {ign_pdal_tools-1.15.2.dist-info → ign_pdal_tools-1.15.4.dist-info}/RECORD +7 -7
- pdaltools/_version.py +1 -1
- pdaltools/replace_area_in_pointcloud.py +19 -4
- {ign_pdal_tools-1.15.2.dist-info → ign_pdal_tools-1.15.4.dist-info}/WHEEL +0 -0
- {ign_pdal_tools-1.15.2.dist-info → ign_pdal_tools-1.15.4.dist-info}/licenses/LICENSE.md +0 -0
- {ign_pdal_tools-1.15.2.dist-info → ign_pdal_tools-1.15.4.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
ign_pdal_tools-1.15.
|
|
2
|
-
pdaltools/_version.py,sha256=
|
|
1
|
+
ign_pdal_tools-1.15.4.dist-info/licenses/LICENSE.md,sha256=iVzCFZTUXeiqP8bP474iuWZiWO_kDCD4SPh1Wiw125Y,1120
|
|
2
|
+
pdaltools/_version.py,sha256=v1-P-Ov-24Bdx7-zaJ7QUAVXDpuCxPkaM1l4VOXLOSA,75
|
|
3
3
|
pdaltools/add_points_in_pointcloud.py,sha256=UJTwoOjC0WKnp_ynNHpwUh1fmbIgw7hq5xoNN8_FxQQ,12965
|
|
4
4
|
pdaltools/color.py,sha256=s-_rmLK6fIK3UwkUzHVZPEkm6r1LliG5ftGr-jkqyjM,9549
|
|
5
5
|
pdaltools/create_random_laz.py,sha256=XuHH4G8Nrs8DB-F8bkcIeto7JtmrlrNGF_R66oxGCbQ,6069
|
|
@@ -12,11 +12,11 @@ pdaltools/las_merge.py,sha256=tcFVueV9X9nNEaoAl5zCduY5DETlBg63MAgP2SuKiNo,4121
|
|
|
12
12
|
pdaltools/las_remove_dimensions.py,sha256=f8imGhN6LNTuQ1GMJQRzIIV3Wab_oRPOyEnKi1CgfiM,2318
|
|
13
13
|
pdaltools/las_rename_dimension.py,sha256=FEWIcq0ZZiv9xWbCLDRE9Hzb5K0YYfoi3Z8IZFEs-uU,2887
|
|
14
14
|
pdaltools/pcd_info.py,sha256=NIAH5KGikVDQLlbCcw9FuaPqe20UZvRfkHsDZd5kmZA,3210
|
|
15
|
-
pdaltools/replace_area_in_pointcloud.py,sha256=
|
|
15
|
+
pdaltools/replace_area_in_pointcloud.py,sha256=4JyWWDtPUqtzE3zMh7eHwjGAupLclvjxKg8ScgIC4-4,8714
|
|
16
16
|
pdaltools/replace_attribute_in_las.py,sha256=MHpIizSupgWtbizteoRH8FKDE049hrAh4v_OhmRmSPU,4318
|
|
17
17
|
pdaltools/standardize_format.py,sha256=I2oNiwhSMtr4e5ZK9qbB_yKmy3twOoO6QLiSFu4_AaI,3905
|
|
18
18
|
pdaltools/unlock_file.py,sha256=G2odk0cpp_X9r49Y90oK88v3qlihaMfg6acwmWqblik,1958
|
|
19
|
-
ign_pdal_tools-1.15.
|
|
20
|
-
ign_pdal_tools-1.15.
|
|
21
|
-
ign_pdal_tools-1.15.
|
|
22
|
-
ign_pdal_tools-1.15.
|
|
19
|
+
ign_pdal_tools-1.15.4.dist-info/METADATA,sha256=kBr1Y0CwOciH9Gjw4HxpYiYy5eQpcHqbSxQ_zXnZr3M,6146
|
|
20
|
+
ign_pdal_tools-1.15.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
21
|
+
ign_pdal_tools-1.15.4.dist-info/top_level.txt,sha256=KvGW0ZzqQbhCKzB5_Tp_buWMZyIgiO2M2krWF_ecOZc,10
|
|
22
|
+
ign_pdal_tools-1.15.4.dist-info/RECORD,,
|
pdaltools/_version.py
CHANGED
|
@@ -102,21 +102,29 @@ def get_writer_params(input_file):
|
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
def pipeline_read_from_cloud(filename):
|
|
105
|
+
print("source cloud: ", filename)
|
|
105
106
|
pipeline_source = pdal.Pipeline()
|
|
106
107
|
pipeline_source |= pdal.Reader.las(filename=filename)
|
|
107
108
|
return pipeline_source
|
|
108
109
|
|
|
109
110
|
|
|
110
111
|
def pipeline_read_from_DSM(dsm, ground_mask, classification):
|
|
112
|
+
print("DSM: ", dsm)
|
|
113
|
+
print("ground_mask: ", ground_mask)
|
|
114
|
+
print("classification: ", classification)
|
|
115
|
+
|
|
111
116
|
# get nodata value
|
|
112
117
|
ds = gdal.Open(dsm)
|
|
113
118
|
band = ds.GetRasterBand(1)
|
|
114
119
|
nodata_value = band.GetNoDataValue()
|
|
120
|
+
print("DSM: nodata:", nodata_value)
|
|
115
121
|
ds.Close()
|
|
116
122
|
|
|
117
123
|
pipeline = pdal.Pipeline()
|
|
118
124
|
pipeline |= pdal.Reader.gdal(filename=dsm, header="Z")
|
|
119
|
-
|
|
125
|
+
|
|
126
|
+
if nodata_value is not None: # nodata_value may be None and cause bugs
|
|
127
|
+
pipeline |= pdal.Filter.expression(expression=f"Z != {nodata_value}")
|
|
120
128
|
|
|
121
129
|
pipeline |= pdal.Filter.ferry(dimensions="=> ground")
|
|
122
130
|
pipeline |= pdal.Filter.assign(assignment="ground[:]=-1")
|
|
@@ -134,6 +142,11 @@ def pipeline_read_from_DSM(dsm, ground_mask, classification):
|
|
|
134
142
|
def replace_area(
|
|
135
143
|
target_cloud, pipeline_source, replacement_area, output_cloud, source_pdal_filter="", target_pdal_filter=""
|
|
136
144
|
):
|
|
145
|
+
print("target cloud: ", target_cloud)
|
|
146
|
+
print("replacement area: ", replacement_area)
|
|
147
|
+
print("output cloud: ", output_cloud)
|
|
148
|
+
print("source pdal filter: ", source_pdal_filter)
|
|
149
|
+
print("target pdal filter: ", target_pdal_filter)
|
|
137
150
|
crops = []
|
|
138
151
|
# pipeline to read target_cloud and remove points inside the polygon
|
|
139
152
|
pipeline_target = pdal.Pipeline()
|
|
@@ -146,7 +159,8 @@ def replace_area(
|
|
|
146
159
|
pipeline_target |= pdal.Filter.overlay(column="fid", dimension="geometryFid", datasource=replacement_area)
|
|
147
160
|
# Keep only points out of the area
|
|
148
161
|
pipeline_target |= pdal.Filter.expression(expression="geometryFid==-1", tag="A")
|
|
149
|
-
pipeline_target.execute()
|
|
162
|
+
target_count = pipeline_target.execute()
|
|
163
|
+
print("Step 1: target count: ", target_count)
|
|
150
164
|
|
|
151
165
|
# get input dimensions dtype from target
|
|
152
166
|
if pipeline_target.arrays:
|
|
@@ -177,10 +191,11 @@ def replace_area(
|
|
|
177
191
|
pipeline_source |= pdal.Filter.overlay(column="fid", dimension="geometryFid", datasource=replacement_area)
|
|
178
192
|
# Keep only points in the area
|
|
179
193
|
pipeline_source |= pdal.Filter.expression(expression="geometryFid>=0", tag="B")
|
|
180
|
-
pipeline_source.execute()
|
|
194
|
+
source_count = pipeline_source.execute()
|
|
195
|
+
print("Step 2: source count: ", source_count)
|
|
181
196
|
|
|
182
197
|
# add source to the result
|
|
183
|
-
if
|
|
198
|
+
if source_count:
|
|
184
199
|
# eventually add dimensions in source to have same dimensions as target cloud
|
|
185
200
|
# we do that in numpy (instead of PDAL filter) to keep dimension types
|
|
186
201
|
source_cloud_crop = pipeline_source.arrays[0]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|