Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support RDB #1538

Merged
merged 6 commits into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gdal/GDALmake.opt.in
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ LIBLZMA_SETTING = @LIBLZMA_SETTING@
WEBP_SETTING = @WEBP_SETTING@
ZSTD_SETTING = @ZSTD_SETTING@
TILEDB_SETTING = @TILEDB_SETTING@
RDB_SETTING = @RDB_SETTING@

#
# DDS via Crunch Support.
Expand Down
129 changes: 129 additions & 0 deletions gdal/configure
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ HAVE_OPENSSL_CRYPTO
USE_ONLY_CRYPTODLL_ALG
HAVE_CRYPTOPP
HAVE_ARMADILLO
RDB_SETTING
RASDAMAN_LIB
RASDAMAN_INC
RASDAMAN_ENABLED
Expand Down Expand Up @@ -1216,6 +1217,7 @@ with_mdb
with_jvm_lib
with_jvm_lib_add_rpath
with_rasdaman
with_rdb
with_armadillo
with_cryptopp
with_crypto
Expand Down Expand Up @@ -2223,6 +2225,7 @@ Optional Packages:
--with-jvm-lib=ARG ARG is dlopen or points to Java libjvm path
--with-jvm-lib-add-rpath Add the libjvm path to the RPATH (no by default)
--with-rasdaman=DIR Include rasdaman support (DIR is rasdaman's install dir).
--with-rdb=ARG Include RDB support (ARG=no, yes or RDB SDK root path)
--with-armadillo=ARG Include Armadillo support for faster TPS transform computation (ARG=yes/no/path to armadillo install root) [default=no]
--with-cryptopp=ARG Include cryptopp support (ARG=yes, no or path)
--with-crypto=ARG Include crypto (from openssl) support (ARG=yes, no or path)
Expand Down Expand Up @@ -41520,6 +41523,129 @@ RASDAMAN_LIB=$RASDAMAN_LIB



# Check whether --with-rdb was given.
if test "${with_rdb+set}" = set; then :
withval=$with_rdb;
fi


RDB_SETTING=no

if test "$with_rdb" = "yes" -o "$with_rdb" = "" ; then

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rdb_library_name in -lrdb" >&5
$as_echo_n "checking for rdb_library_name in -lrdb... " >&6; }
if ${ac_cv_lib_rdb_rdb_library_name+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lrdb $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char rdb_library_name ();
int
main ()
{
return rdb_library_name ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_rdb_rdb_library_name=yes
else
ac_cv_lib_rdb_rdb_library_name=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rdb_rdb_library_name" >&5
$as_echo "$ac_cv_lib_rdb_rdb_library_name" >&6; }
if test "x$ac_cv_lib_rdb_rdb_library_name" = xyes; then :
RDB_SETTING=yes
else
RDB_SETTING=no
fi


if test "$RDB_SETTING" = "yes" ; then
LIBS="-lrdb $LIBS"
else
echo "librdb not found - RDB support disabled"
fi

elif test "$with_rdb" != "no" -a "$with_rdb" != ""; then

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rdb_library_name in -lrdb" >&5
$as_echo_n "checking for rdb_library_name in -lrdb... " >&6; }
if ${ac_cv_lib_rdb_rdb_library_name+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lrdb -L$with_rdb/library -lrdb $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char rdb_library_name ();
int
main ()
{
return rdb_library_name ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_rdb_rdb_library_name=yes
else
ac_cv_lib_rdb_rdb_library_name=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rdb_rdb_library_name" >&5
$as_echo "$ac_cv_lib_rdb_rdb_library_name" >&6; }
if test "x$ac_cv_lib_rdb_rdb_library_name" = xyes; then :
RDB_SETTING=yes
else
RDB_SETTING=no
fi


if test "$RDB_SETTING" = "yes" ; then
LIBS="-L$with_rdb/library -lrdb $LIBS"
EXTRA_INCLUDES="-I$with_rdb/interface/cpp/ -I$with_rdb/interface/c/ $EXTRA_INCLUDES"
else
echo "librdb not found - RDB support disabled"
fi

fi

RDB_SETTING=$RDB_SETTING


if test "$RDB_SETTING" != "no" ; then
OPT_GDAL_FORMATS="rdb $OPT_GDAL_FORMATS"
fi




# Check whether --with-armadillo was given.
if test "${with_armadillo+set}" = set; then :
withval=$with_armadillo;
Expand Down Expand Up @@ -44388,6 +44514,9 @@ echo " SDE support: ${SDE_ENABLED}"
echo " Rasdaman support: ${RASDAMAN_ENABLED}"


echo " RDB support: ${RDB_SETTING}"


echo " DODS support: ${HAVE_DODS}"


Expand Down
39 changes: 39 additions & 0 deletions gdal/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5653,6 +5653,44 @@ AC_SUBST(RASDAMAN_ENABLED,$RASDAMAN_ENABLED)
AC_SUBST(RASDAMAN_INC, $RASDAMAN_INC)
AC_SUBST(RASDAMAN_LIB, $RASDAMAN_LIB)

dnl ---------------------------------------------------------------------------
dnl RDB support
dnl ---------------------------------------------------------------------------

AC_ARG_WITH(rdb,[ --with-rdb[=ARG] Include RDB support (ARG=no, yes or RDB SDK root path)],,)

RDB_SETTING=no

if test "$with_rdb" = "yes" -o "$with_rdb" = "" ; then

AC_CHECK_LIB(rdb,rdb_library_name,RDB_SETTING=yes,RDB_SETTING=no,)

if test "$RDB_SETTING" = "yes" ; then
LIBS="-lrdb $LIBS"
else
echo "librdb not found - RDB support disabled"
fi

elif test "$with_rdb" != "no" -a "$with_rdb" != ""; then

AC_CHECK_LIB(rdb,rdb_library_name,RDB_SETTING=yes,RDB_SETTING=no,-L$with_rdb/library -lrdb)

if test "$RDB_SETTING" = "yes" ; then
LIBS="-L$with_rdb/library -lrdb $LIBS"
EXTRA_INCLUDES="-I$with_rdb/interface/cpp/ -I$with_rdb/interface/c/ $EXTRA_INCLUDES"
else
echo "librdb not found - RDB support disabled"
fi

fi

AC_SUBST(RDB_SETTING,$RDB_SETTING)

if test "$RDB_SETTING" != "no" ; then
OPT_GDAL_FORMATS="rdb $OPT_GDAL_FORMATS"
fi


dnl ---------------------------------------------------------------------------
dnl Armadillo support
dnl ---------------------------------------------------------------------------
Expand Down Expand Up @@ -6009,6 +6047,7 @@ LOC_MSG([ OCI support: ${HAVE_OCI}])
LOC_MSG([ GEORASTER support: ${HAVE_GEORASTER}])
LOC_MSG([ SDE support: ${SDE_ENABLED}])
LOC_MSG([ Rasdaman support: ${RASDAMAN_ENABLED}])
LOC_MSG([ RDB support: ${RDB_SETTING}])
LOC_MSG([ DODS support: ${HAVE_DODS}])
LOC_MSG([ SQLite support: ${HAVE_SQLITE}])
LOC_MSG([ PCRE support: ${HAVE_PCRE}])
Expand Down
1 change: 1 addition & 0 deletions gdal/doc/source/drivers/raster/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Raster drivers
rasterlite2
r
rda
rdb
rik
rmf
roi_pac
Expand Down
78 changes: 78 additions & 0 deletions gdal/doc/source/drivers/raster/rdb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
.. _raster.rdb:

================================================================================
RDB - *RIEGL* Database
================================================================================

.. shortname:: RDB

.. versionadded:: 3.1

GDAL can read \*.mpx files in the RDB format, the in-house format used by `RIEGL Laser Measurement Systems GmbH <http://www.riegl.com>`__ through the RDB library.

The driver relies on the RDB library, which can be downloaded `here <http://riegl.com/members-area/>`__. The minimum version required of the rdblib is 2.2.0.

Driver capabilities
-------------------

.. supports_georeferencing::

Provided Bands
-------------------

All attributes stored in the RDB, but the coordinates, are provided in bands. Vector attributes are split up into multiple bands.
The attributes are currently mapped as follows:

+----------------------------+-------------------------+
| RDB attribute | GDAL Band |
+============================+=========================+
| riegl.surface_normal[0], | Band 1 |
| | |
| riegl.surface_normal[1], | Band 2 |
| | |
| riegl.surface_normal[2] | Band 3 |
+----------------------------+-------------------------+
| riegl.reflectance | Band 4 |
+----------------------------+-------------------------+
| riegl.amplitude | Band 5 |
+----------------------------+-------------------------+
| riegl.deviation | Band 6 |
+----------------------------+-------------------------+
| riegl.point_count | Band 7 |
+----------------------------+-------------------------+
| riegl.pca_thickness | Band 8 |
+----------------------------+-------------------------+
| riegl.std_dev | Band 9 |
+----------------------------+-------------------------+
| riegl.height_center | Band 10 |
+----------------------------+-------------------------+
| riegl.height_mean | Band 11 |
+----------------------------+-------------------------+
| riegl.height_min | Band 12 |
+----------------------------+-------------------------+
| riegl.height_max | Band 13 |
+----------------------------+-------------------------+
| pixel_linear_sums[0] | Band 14 |
| | |
| pixel_linear_sums[1] | Band 15 |
| | |
| pixel_linear_sums[2] | Band 16 |
+----------------------------+-------------------------+
| pixel_square_sums[0] | Band 17 |
| | |
| pixel_square_sums[1] | Band 18 |
| | |
| pixel_square_sums[2] | Band 19 |
| | |
| pixel_square_sums[3] | Band 20 |
| | |
| pixel_square_sums[4] | Band 21 |
| | |
| pixel_square_sums[5] | Band 22 |
+----------------------------+-------------------------+
| riegl.voxel_count | Band 23 |
+----------------------------+-------------------------+
| riegl.id | Band 24 |
+----------------------------+-------------------------+
| riegl.point_count_grid_cell| Band 25 |
+----------------------------+-------------------------+
3 changes: 3 additions & 0 deletions gdal/frmts/gdalallregister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ void CPL_STDCALL GDALAllRegister()
GDALRegister_TileDB();
#endif

#ifdef FRMT_rdb
GDALRegister_RDB();
#endif
/* -------------------------------------------------------------------- */
/* Put raw formats at the end of the list. These drivers support */
/* various ASCII-header labeled formats, so the driver could be */
Expand Down
3 changes: 3 additions & 0 deletions gdal/frmts/makefile.vc
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_jpegls
EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_tiledb
!ENDIF

!IFDEF RDB_ENABLED
EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_rdb
!ENDIF

default: o\gdalallregister.obj subdirs

Expand Down
13 changes: 13 additions & 0 deletions gdal/frmts/rdb/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

include ../../GDALmake.opt

OBJ = rdbdataset.o

CPPFLAGS := -I../../ogr/ogrsf_frmts/geojson $(JSON_INCLUDE) $(CPPFLAGS)

default: $(OBJ:.o=.$(OBJ_EXT))

clean:
rm -f *.o $(O_OBJ)

install-obj: $(O_OBJ:.o=.$(OBJ_EXT))
15 changes: 15 additions & 0 deletions gdal/frmts/rdb/makefile.vc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

OBJ = ./rdbdataset.obj

EXTRAFLAGS = -I..\..\ogr\ogrsf_frmts\geojson -I../../ogr/ogrsf_frmts/geojson/libjson $(RDB_CFLAGS)

GDAL_ROOT = ..\..

!INCLUDE $(GDAL_ROOT)\nmake.opt

default: $(OBJ)
xcopy /D /Y *.obj ..\o

clean:
-del *.obj

Loading