Skip to content

Commit

Permalink
Merge pull request OpenDroneMap#850 from pierotofy/messfix
Browse files Browse the repository at this point in the history
Replayed laz support commit
  • Loading branch information
Stephen Mather authored Jun 18, 2018
2 parents 189b93a + a84a04d commit d80d0b2
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ When the process finishes, the results will be organized as follows:
|-- texture_N.jpg # Associated textured images used by the model
|-- odm_georeferencing/
|-- odm_georeferenced_model.ply # A georeferenced dense point cloud
|-- odm_georeferenced_model.ply.laz # LAZ format point cloud
|-- odm_georeferenced_model.laz # LAZ format point cloud
|-- odm_georeferenced_model.csv # XYZ format point cloud
|-- odm_georeferencing_log.txt # Georeferencing log
|-- odm_georeferencing_transform.txt# Transform used for georeferencing
Expand Down
1 change: 1 addition & 0 deletions SuperBuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ set(custom_libs OpenGV
CMVS
Catkin
Ecto
LASzip
PDAL
MvsTexturing
)
Expand Down
26 changes: 26 additions & 0 deletions SuperBuild/cmake/External-LASzip.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
set(_proj_name laszip)
set(_SB_BINARY_DIR "${SB_BINARY_DIR}/${_proj_name}")

ExternalProject_Add(${_proj_name}
DEPENDS
PREFIX ${_SB_BINARY_DIR}
TMP_DIR ${_SB_BINARY_DIR}/tmp
STAMP_DIR ${_SB_BINARY_DIR}/stamp
#--Download step--------------
DOWNLOAD_DIR ${SB_DOWNLOAD_DIR}
URL https://github.com/LASzip/LASzip/releases/download/3.2.2/laszip-src-3.2.2.tar.gz
#--Update/Patch step----------
UPDATE_COMMAND ""
#--Configure step-------------
SOURCE_DIR ${SB_SOURCE_DIR}/${_proj_name}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${SB_INSTALL_DIR}
#--Build step-----------------
BINARY_DIR ${_SB_BINARY_DIR}
#--Install step---------------
INSTALL_DIR ${SB_INSTALL_DIR}
#--Output logging-------------
LOG_DOWNLOAD OFF
LOG_CONFIGURE OFF
LOG_BUILD OFF
)
5 changes: 2 additions & 3 deletions SuperBuild/cmake/External-PDAL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ set(_proj_name pdal)
set(_SB_BINARY_DIR "${SB_BINARY_DIR}/${_proj_name}")

ExternalProject_Add(${_proj_name}
DEPENDS hexer
DEPENDS hexer laszip
PREFIX ${_SB_BINARY_DIR}
TMP_DIR ${_SB_BINARY_DIR}/tmp
STAMP_DIR ${_SB_BINARY_DIR}/stamp
#--Download step--------------
DOWNLOAD_DIR ${SB_DOWNLOAD_DIR}
URL https://github.com/PDAL/PDAL/archive/e881b581e3b91a928105d67db44c567f3b6d1afe.tar.gz
URL_MD5 cadbadf1c83d69d6525cfffd41473323
URL https://github.com/PDAL/PDAL/releases/download/1.7.2/PDAL-1.7.2-src.tar.gz
#--Update/Patch step----------
UPDATE_COMMAND ""
#--Configure step-------------
Expand Down
9 changes: 5 additions & 4 deletions opendm/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,18 @@ def convert_to_las(self, _file, _file_out, json_file):
'srs': self.projection.srs,
'json': json_file}

# create pipeline file transform.xml to enable transformation
# create pipeline file las.json to write odm_georeferenced_model.laz point cloud
pipeline = '{{' \
' "pipeline":[' \
' "untransformed.ply",' \
' {{' \
' "type":"writers.las",' \
' "a_srs":"{srs}",' \
' "offset_x":"{east}",' \
' "offset_y":"{north}",' \
' "offset_z":"0",' \
' "filename":"transformed.las"' \
' "compression":"laszip",' \
' "filename":"{f_out}"' \
' }}' \
' ]' \
'}}'.format(**kwargs)
Expand All @@ -273,8 +275,7 @@ def convert_to_las(self, _file, _file_out, json_file):
f.write(pipeline)

# call pdal
system.run('{bin}/pdal pipeline -i {json} --readers.ply.filename={f_in} '
'--writers.las.filename={f_out}'.format(**kwargs))
system.run('{bin}/pdal pipeline -i {json} --readers.ply.filename={f_in}'.format(**kwargs))

def utm_to_latlon(self, _file, _photo, idx):

Expand Down
2 changes: 1 addition & 1 deletion tests/test_odm.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test_georef(self):

def test_las_out(self):
self.assertTrue(os.path.isfile(os.path.join(self.app.georeferencing.inputs.tree.odm_georeferencing,
"odm_georeferenced_model.ply.las")))
"odm_georeferenced_model.laz")))


class TestOrthophoto(unittest.TestCase):
Expand Down

0 comments on commit d80d0b2

Please sign in to comment.