Added lidar2dems superbuild module, modified dockerfile, configure.sh to install lidar2dems deps

pull/612/head
Piero Toffanin 2017-06-20 14:53:17 -04:00
rodzic 5fb9967368
commit fed4cb95dc
8 zmienionych plików z 31 dodań i 54 usunięć

3
.gitmodules vendored
Wyświetl plik

@ -1,3 +0,0 @@
[submodule "modules/lidar2dems"]
path = modules/lidar2dems
url = https://github.com/pierotofy/lidar2dems

Wyświetl plik

@ -19,7 +19,7 @@ jhead liblas-bin python-matplotlib libatlas-base-dev libgmp-dev libmpfr-dev swig
RUN apt-get remove libdc1394-22-dev
RUN pip install --upgrade pip
RUN pip install setuptools
RUN pip install -U PyYAML exifread gpxpy xmltodict catkin-pkg appsettings https://github.com/Applied-GeoSolutions/gippy/archive/v0.3.9.tar.gz
RUN pip install -U PyYAML exifread gpxpy xmltodict catkin-pkg appsettings https://github.com/pierotofy/gippy/archive/v0.3.9.tar.gz
ENV PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python2.7/dist-packages"
ENV PYTHONPATH="$PYTHONPATH:/code/SuperBuild/src/opensfm"
@ -49,12 +49,6 @@ COPY VERSION /code/VERSION
RUN cd SuperBuild && mkdir build && cd build && cmake .. && make -j$(nproc) && cd ../.. && mkdir build && cd build && cmake .. && make -j$(nproc)
# Update and initialize git submodules
RUN git submodule update --init
# Setup lidar2dems
RUN CPLUS_INCLUDE_PATH=/usr/include/gdal C_INCLUDE_PATH=/usr/include/gdal /code/modules/lidar2dems/setup.py install && ln -s /code/SuperBuild/build/pdal/bin/pdal /usr/bin/pdal
RUN apt-get -y remove libgl1-mesa-dri git cmake python-pip build-essential
RUN apt-get install -y libvtk5-dev

Wyświetl plik

@ -114,6 +114,7 @@ set(custom_libs OpenGV
Ecto
PDAL
MvsTexturing
Lidar2dems
)
# Dependencies of the SLAM module

Wyświetl plik

@ -0,0 +1,25 @@
set(_proj_name lidar2dems)
set(_SB_BINARY_DIR "${SB_BINARY_DIR}/${_proj_name}")
ExternalProject_Add(${_proj_name}
PREFIX ${_SB_BINARY_DIR}
TMP_DIR ${_SB_BINARY_DIR}/tmp
STAMP_DIR ${_SB_BINARY_DIR}/stamp
#--Download step--------------
DOWNLOAD_DIR ${SB_DOWNLOAD_DIR}/${_proj_name}
URL https://github.com/pierotofy/lidar2dems/archive/master.zip
URL_MD5 6cfe2d081cda1680e6e98a9925651b03
#--Update/Patch step----------
UPDATE_COMMAND ""
#--Configure step-------------
SOURCE_DIR ${SB_SOURCE_DIR}/${_proj_name}
CONFIGURE_COMMAND ""
#--Build step-----------------
BUILD_COMMAND ""
#--Install step---------------
INSTALL_COMMAND "${SB_SOURCE_DIR}/${_proj_name}/install.sh"
#--Output logging-------------
LOG_DOWNLOAD OFF
LOG_CONFIGURE OFF
LOG_BUILD OFF
)

Wyświetl plik

@ -72,7 +72,7 @@ install() {
appsettings
echo "Installing CGAL dependencies"
sudo apt-get install libgmp-dev libmpfr-dev
sudo apt-get install -y -qq libgmp-dev libmpfr-dev
echo "Installing Ecto Dependencies"
sudo pip install -U catkin-pkg
@ -92,17 +92,8 @@ install() {
libboost-log-dev \
libxslt-dev
echo "Updating and initializing git submodules"
git submodule update --init
sudo pip install -U https://github.com/pierotofy/gippy/archive/v0.3.9.tar.gz
echo "Installing lidar2dems"
cd ${RUNPATH}/modules/lidar2dems
CPLUS_INCLUDE_PATH=/usr/include/gdal C_INCLUDE_PATH=/usr/include/gdal ./setup.py install
if [ ! -f /usr/bin/pdal ]; then
ln -s ${RUNPATH}/SuperBuild/build/pdal/bin/pdal /usr/bin/pdal
fi
echo "Compiling SuperBuild"
cd ${RUNPATH}/SuperBuild
mkdir -p build && cd build

@ -1 +0,0 @@
Subproject commit fe0710bd68e6add3be5621e94f20f56c1e99fd00

Wyświetl plik

@ -196,7 +196,7 @@ class ODM_GeoRef(object):
system.run('{bin}/pdal pipeline -i {json} --readers.ply.filename={f_in} '
'--writers.las.filename={f_out}'.format(**kwargs))
def convert_to_dem(self, _file, _file_out, pdalJSON, sample_radius, gdal_res, gdal_radius):
def convert_to_dem(self, _file, _file_out, sample_radius, gdal_res, gdal_radius):
# Check if exists f_in
if not io.file_exists(_file):
log.ODM_ERROR('LAS file does not exist')
@ -208,36 +208,9 @@ class ODM_GeoRef(object):
'sample_radius': sample_radius,
'gdal_res': gdal_res,
'gdal_radius': gdal_radius,
'f_out': _file_out,
'json': pdalJSON
'f_out': _file_out
}
pipelineJSON = '{{' \
' "pipeline":[' \
' "input.las",' \
' {{' \
' "type":"filters.sample",' \
' "radius":"{sample_radius}"' \
' }},' \
' {{' \
' "type":"filters.pmf"' \
' }},' \
' {{' \
' "type":"filters.range",' \
' "limits":"Classification[2:2]"' \
' }},' \
' {{' \
' "resolution": {gdal_res},' \
' "radius": {gdal_radius},' \
' "output_type":"idw",' \
' "filename":"outputfile.tif"' \
' }}' \
' ]' \
'}}'.format(**kwargs)
with open(pdalJSON, 'w') as f:
f.write(pipelineJSON)
system.run('{bin}/pdal pipeline {json} --readers.las.filename={f_in} '
'--writers.gdal.filename={f_out}'.format(**kwargs))
@ -454,8 +427,6 @@ class ODM_Tree(object):
self.odm_georeferencing, 'odm_georeferenced_model.las')
self.odm_georeferencing_dem = io.join_paths(
self.odm_georeferencing, 'odm_georeferencing_model_dem.tif')
self.odm_georeferencing_dem_json = io.join_paths(
self.odm_georeferencing, 'dem.json')
# odm_orthophoto
self.odm_orthophoto_file = io.join_paths(self.odm_orthophoto, 'odm_orthophoto.png')

Wyświetl plik

@ -179,7 +179,6 @@ class ODMGeoreferencingCell(ecto.Cell):
if args.dem:
demcreated = geo_ref.convert_to_dem(tree.odm_georeferencing_model_las,
tree.odm_georeferencing_dem,
tree.odm_georeferencing_dem_json,
self.params.sample_radius,
self.params.gdal_res,
self.params.gdal_radius)