[Liblas-commits] hg: 4 new changesets
liblas-commits at liblas.org
liblas-commits at liblas.org
Fri Oct 2 23:16:23 EDT 2009
changeset 3b1cd764d670 in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=3b1cd764d670
summary: apply frankie's patch for --enable-debug
changeset fbc7c5686a5c in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=fbc7c5686a5c
summary: wrong prototype
changeset a4b027b4b8c5 in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=a4b027b4b8c5
summary: SRS overrides
changeset 04cee30948ab in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=04cee30948ab
summary: merge
diffstat:
.hgignore | 17 ++++----
CMakeLists.txt | 14 +++++++
apps/las2las.c | 90 +++++++++++++++++++++++++++++++++++++++++++--
configure.ac | 7 ++-
include/liblas/capi/liblas.h | 6 +-
src/detail/writer.cpp | 8 ++--
test/CMakeLists.txt | 9 +++-
test/unit/CMakeLists.txt | 27 ++++++-------
8 files changed, 139 insertions(+), 39 deletions(-)
diffs (truncated from 358 to 300 lines):
diff -r f3bde1e79871 -r 04cee30948ab .hgignore
--- a/.hgignore Fri Oct 02 09:26:16 2009 -0500
+++ b/.hgignore Fri Oct 02 22:13:50 2009 -0500
@@ -1,15 +1,17 @@
syntax: glob
+.deps
+.libs
+*.dll
+*.exe
+*.exp
*.la
+*.lib
*.lo
*.o
*.obj
-.deps
-.libs
-*.exe
-*.exp
-*.lib
+*.pyc
*.res
-*.dll
+*.swp
aclocal.m4
apps/las2las
apps/las2txt
@@ -41,9 +43,8 @@
python/build/*
python/dist/*
python/libLAS.egg-info/*
-*.pyc
src/CMakeFiles
CMakeFiles
CMakeCache.txt
cmake_install.cmake
-src/liblas.a
\ No newline at end of file
+src/liblas.a
diff -r f3bde1e79871 -r 04cee30948ab CMakeLists.txt
--- a/CMakeLists.txt Fri Oct 02 09:26:16 2009 -0500
+++ b/CMakeLists.txt Fri Oct 02 22:13:50 2009 -0500
@@ -18,6 +18,9 @@
# Name of C library
SET(LIBLAS_C_LIB_NAME las_c)
+# Name of test suite runner
+SET(LIBLAS_UNIT_TEST liblas_test)
+
# Choose package components
SET(WITH_UTILITIES TRUE CACHE BOOL "Choose if libLAS utilities should be built")
SET(WITH_TESTS FALSE CACHE BOOL "Choose if libLAS unit tests should be built")
@@ -228,9 +231,20 @@
ADD_SUBDIRECTORY(src)
IF(WITH_UTILITIES)
+ MESSAGE(STATUS "Adding libLAS utilities to build - done")
ADD_SUBDIRECTORY(apps)
ENDIF()
IF(WITH_TESTS)
+ # TODO:
+ # Waiting for Mercurial support at cdash.org --mloskot
+ # Dashboard has been prepared for experiments
+ # http://my.cdash.org/index.php?project=libLAS
+ #INCLUDE(CTest)
+
+ MESSAGE(STATUS "Adding libLAS unit test suite to build - done")
+ ENABLE_TESTING()
ADD_SUBDIRECTORY(test)
ENDIF()
+
+# EOF
diff -r f3bde1e79871 -r 04cee30948ab apps/las2las.c
--- a/apps/las2las.c Fri Oct 02 09:26:16 2009 -0500
+++ b/apps/las2las.c Fri Oct 02 22:13:50 2009 -0500
@@ -104,12 +104,17 @@
int skip_invalid = FALSE;
int format = LAS_FORMAT_12;
+ int use_min_offset = FALSE;
+
LASReaderH reader = NULL;
LASHeaderH header = NULL;
LASHeaderH surviving_header = NULL;
LASPointH p = NULL;
LASWriterH writer = NULL;
-
+
+ LASSRSH in_srs = NULL;
+ LASSRSH out_srs = NULL;
+
int first_surviving_point = TRUE;
unsigned int surviving_number_of_point_records = 0;
unsigned int surviving_number_of_points_by_return[] = {0,0,0,0,0,0,0,0};
@@ -126,6 +131,9 @@
int eliminated_first_only = 0;
int eliminated_last_only = 0;
+ double xyz_scale[3] = {0.0, 0.0, 0.0};
+ double xyz_offset[3] = {0.0, 0.0, 0.0};
+
double minx, maxx, miny, maxy, minz, maxz;
LASPointSummary* summary = NULL;
@@ -274,6 +282,66 @@
{
remove_extra_header = TRUE;
}
+ else if ( strcmp(argv[i],"--s_srs") == 0 ||
+ strcmp(argv[i],"-s_srs") == 0
+ )
+ {
+ ++i;
+ if (LAS_IsGDALEnabled()) {
+ in_srs = LASSRS_Create();
+ LASSRS_SetFromUserInput(in_srs, argv[i]);
+ }
+ }
+ else if ( strcmp(argv[i],"--t_srs") == 0 ||
+ strcmp(argv[i],"-t_srs") == 0
+ )
+ {
+ ++i;
+ if (LAS_IsGDALEnabled()) {
+ out_srs = LASSRS_Create();
+ LASSRS_SetFromUserInput(out_srs, argv[i]);
+ }
+ }
+ else if ( strcmp(argv[i],"--scale") == 0 ||
+ strcmp(argv[i],"-scale") == 0
+ )
+ {
+
+ i++;
+ sscanf(argv[i], "%lf", &(xyz_scale[2]));
+ xyz_scale[0] = xyz_scale[1] = xyz_scale[2];
+ }
+ else if ( strcmp(argv[i],"--xyz_scale") == 0 ||
+ strcmp(argv[i],"-xyz_scale") == 0
+ )
+
+ {
+ i++;
+ sscanf(argv[i], "%lf", &(xyz_scale[0]));
+ i++;
+ sscanf(argv[i], "%lf", &(xyz_scale[1]));
+ i++;
+ sscanf(argv[i], "%lf", &(xyz_scale[2]));
+ }
+ else if ( strcmp(argv[i],"--xyz_offset") == 0 ||
+ strcmp(argv[i],"-xyz_offset") == 0
+ )
+ {
+
+ if (strncasecmp(argv[i], "min", 3)) {
+ i++;
+ use_min_offset = TRUE;
+ printf("Offset was !\n");
+ } else
+ {
+ i++;
+ sscanf(argv[i], "%lf", &(xyz_offset[0]));
+ i++;
+ sscanf(argv[i], "%lf", &(xyz_offset[1]));
+ i++;
+ sscanf(argv[i], "%lf", &(xyz_offset[2]));
+ }
+ }
else if (file_name_in == NULL && file_name_out == NULL)
{
file_name_in = argv[i];
@@ -297,7 +365,7 @@
if (!reader) {
LASError_Print("Could not open file to read");
exit(1);
- }
+ }
}
else
{
@@ -306,7 +374,14 @@
exit(1);
}
-
+ if (in_srs != NULL) {
+ LASReader_SetInputSRS(reader, in_srs);
+ }
+
+ if (out_srs != NULL) {
+ LASReader_SetOutputSRS(reader, out_srs);
+ }
+
header = LASReader_GetHeader(reader);
if (!header) {
LASError_Print("Could not fetch header");
@@ -605,7 +680,14 @@
exit(1);
}
-
+ if (in_srs != NULL) {
+ LASReader_SetInputSRS(reader, in_srs);
+ }
+
+ if (out_srs != NULL) {
+ LASReader_SetOutputSRS(reader, out_srs);
+ }
+
header = LASReader_GetHeader(reader);
if (!header) {
LASError_Print("Could not read header");
diff -r f3bde1e79871 -r 04cee30948ab configure.ac
--- a/configure.ac Fri Oct 02 09:26:16 2009 -0500
+++ b/configure.ac Fri Oct 02 22:13:50 2009 -0500
@@ -19,7 +19,8 @@
dnl Default compilation flags
dnl #########################################################################
-debug_default="no"
+m4_define([debug_default],[no])
+
CFLAGS="-Wall -Wno-long-long -pedantic $CFLAGS"
CXXFLAGS="-Wall -Wno-long-long -pedantic -std=c++98 $CXXFLAGS"
@@ -58,8 +59,8 @@
dnl #########################################################################
AC_ARG_ENABLE([debug],
- AC_HELP_STRING([--enable-debug=ARG], [Enable debug compilation mode @<:@yes|no@:>@, default=${debug_default}]),,)
-
+ AC_HELP_STRING([--enable-debug=ARG], [Enable debug compilation mode @<:@yes|no@:>@, default=debug_default]),,)
+
AC_MSG_CHECKING([for debug enabled])
if test "x$enable_debug" = "xyes"; then
diff -r f3bde1e79871 -r 04cee30948ab include/liblas/capi/liblas.h
--- a/include/liblas/capi/liblas.h Fri Oct 02 09:26:16 2009 -0500
+++ b/include/liblas/capi/liblas.h Fri Oct 02 22:13:50 2009 -0500
@@ -222,9 +222,9 @@
LAS_DLL LASHeaderH LASReader_GetHeader(const LASReaderH hReader);
-LAS_DLL LASError LASReader_SetSRS(LASHeaderH hReader, const LASSRSH hSRS);
-LAS_DLL LASError LASReader_SetInputSRS(LASHeaderH hReader, const LASSRSH hSRS);
-LAS_DLL LASError LASReader_SetOutputSRS(LASHeaderH hReader, const LASSRSH hSRS);
+LAS_DLL LASError LASReader_SetSRS(LASReaderH hReader, const LASSRSH hSRS);
+LAS_DLL LASError LASReader_SetInputSRS(LASReaderH hReader, const LASSRSH hSRS);
+LAS_DLL LASError LASReader_SetOutputSRS(LASReaderH hReader, const LASSRSH hSRS);
/****************************************************************************/
diff -r f3bde1e79871 -r 04cee30948ab src/detail/writer.cpp
--- a/src/detail/writer.cpp Fri Oct 02 09:26:16 2009 -0500
+++ b/src/detail/writer.cpp Fri Oct 02 22:13:50 2009 -0500
@@ -180,8 +180,9 @@
m_in_srs = srs;
}
-void Writer::CreateTransform(){
-
+void Writer::CreateTransform()
+{
+#ifdef HAVE_GDAL
if (m_transform)
{
OCTDestroyCoordinateTransformation(m_transform);
@@ -195,7 +196,6 @@
OSRDestroySpatialReference(m_out_ref);
}
-#ifdef HAVE_GDAL
m_in_ref = OSRNewSpatialReference(0);
m_out_ref = OSRNewSpatialReference(0);
@@ -218,7 +218,6 @@
}
m_transform = OCTNewCoordinateTransformation( m_in_ref, m_out_ref);
-
#endif
}
@@ -247,6 +246,7 @@
detail::ignore_unused_variable_warning(p);
#endif
}
+
Writer* WriterFactory::Create(std::ostream& ofs, LASHeader const& header)
{
if (!ofs)
diff -r f3bde1e79871 -r 04cee30948ab test/CMakeLists.txt
--- a/test/CMakeLists.txt Fri Oct 02 09:26:16 2009 -0500
+++ b/test/CMakeLists.txt Fri Oct 02 22:13:50 2009 -0500
@@ -1,5 +1,8 @@
-# $Id$
+###############################################################################
#
-# List of test and sample programs subprojects
More information about the Liblas-commits
mailing list