[Liblas-commits] hg: turn tests on
liblas-commits at liblas.org
liblas-commits at liblas.org
Thu Jan 27 15:07:21 EST 2011
details: http://hg.liblas.orghg/rev/4435bdf3d62f
changeset: 2831:4435bdf3d62f
user: Howard Butler <hobu.inc at gmail.com>
date: Thu Jan 27 14:05:27 2011 -0600
description:
turn tests on
Subject: hg: merge
details: http://hg.liblas.orghg/rev/a82bf8a16b16
changeset: 2832:a82bf8a16b16
user: Howard Butler <hobu.inc at gmail.com>
date: Thu Jan 27 14:07:16 2011 -0600
description:
merge
diffstat:
doc/utilities/las2las.txt | 6 ++++++
hobu-config.bat | 9 +++++----
python/liblas/core.py | 9 +++++++++
python/liblas/point.py | 7 +++++++
python/tests/SRS-GDAL.txt | 9 +++++++--
src/c_api.cpp | 12 ++++++++++--
src/spatialreference.cpp | 5 +++--
7 files changed, 47 insertions(+), 10 deletions(-)
diffs (165 lines):
diff -r 941c259f8c63 -r a82bf8a16b16 doc/utilities/las2las.txt
--- a/doc/utilities/las2las.txt Wed Jan 26 13:03:31 2011 -0600
+++ b/doc/utilities/las2las.txt Thu Jan 27 14:07:16 2011 -0600
@@ -234,6 +234,12 @@
escaped arguments that are larger than 64k in size will cause an error
to be thrown. Automatic truncation will not happen.
+.. note::
+ If you attempt to add VLRs with an ID of 34735, 34736, or 34737, your
+ VLR will not be added. This is because libLAS expects to manage the
+ GeoTIFF keys for you. You should use the SRS handling facilities if
+ you need to set GeoTIFF keys instead of attempting to overwrite them
+ directly.
VLR removal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff -r 941c259f8c63 -r a82bf8a16b16 hobu-config.bat
--- a/hobu-config.bat Wed Jan 26 13:03:31 2011 -0600
+++ b/hobu-config.bat Thu Jan 27 14:07:16 2011 -0600
@@ -17,10 +17,10 @@
cmake -G %G% ^
-DBOOST_INCLUDEDIR=%BOOST% ^
- -DWITH_GDAL=ON ^
+ -DWITH_GDAL=ON= ^
-DWITH_GEOTIFF=ON ^
-DWITH_ORACLE=ON ^
- -DWITH_LASZIP=ON ^
+ -DWITH_LASZIP=OFF ^
-DTIFF_INCLUDE_DIR=%OSGEO4W%\include ^
-DTIFF_LIBRARY=%OSGEO4W%\lib\libtiff_i.lib ^
-DGEOTIFF_INCLUDE_DIR=%OSGEO4W%\include ^
@@ -29,9 +29,10 @@
-DGDAL_LIBRARY=%OSGEO4W%\apps\gdal-dev\lib\gdal_i.lib ^
-DORACLE_INCLUDE_DIR=%ORACLE_HOME%\include ^
-DORACLE_OCI_LIBRARY=%ORACLE_HOME%\lib\oci.lib ^
- -DLASZIP_INCLUDE_DIR=d:\laszip\include ^
- -DLASZIP_LIBRARY=d:\laszip\bin\Debug\laszip.lib ^
+ -DLASZIP_INCLUDE_DIR=%OSGEO4W%\include ^
+ -DLASZIP_LIBRARY=%OSGEO4W%\lib\laszip.lib ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
-DCMAKE_VERBOSE_MAKEFILE=OFF ^
-DWITH_STATIC_LASZIP=FALSE ^
+ -DENABLE_CTEST=ON ^
%LIBLAS%
diff -r 941c259f8c63 -r a82bf8a16b16 python/liblas/core.py
--- a/python/liblas/core.py Wed Jan 26 13:03:31 2011 -0600
+++ b/python/liblas/core.py Thu Jan 27 14:07:16 2011 -0600
@@ -674,6 +674,15 @@
las.LASPoint_SetColor.argtypes = [ctypes.c_void_p, ctypes.c_void_p]
las.LASPoint_SetColor.errcheck = check_return
+las.LASPoint_SetHeader.restype = None
+las.LASPoint_SetHeader.argtypes = [ctypes.c_void_p,
+ ctypes.c_void_p]
+las.LASPoint_SetHeader.errcheck = check_void_done
+
+las.LASPoint_GetHeader.restype = ctypes.c_void_p
+las.LASPoint_GetHeader.argtypes = [ctypes.c_void_p]
+las.LASPoint_GetHeader.errcheck = check_void
+
las.LASPoint_Destroy.argtypes = [ctypes.c_void_p]
las.LASPoint_Destroy.errcheck = check_void_done
las.LASPoint_Destroy.restype = None
diff -r 941c259f8c63 -r a82bf8a16b16 python/liblas/point.py
--- a/python/liblas/point.py Wed Jan 26 13:03:31 2011 -0600
+++ b/python/liblas/point.py Thu Jan 27 14:07:16 2011 -0600
@@ -48,6 +48,7 @@
import color
import ctypes
+import header
class Point(object):
def __init__(self, owned=True, handle=None, copy=False):
@@ -468,6 +469,12 @@
"""
color = property(get_color, set_color, None, doc)
+ def get_header(self):
+ return header.Header(handle=core.las.LASPoint_GetHeader(self.handle))
+
+ def set_header(self, value):
+ return core.las.LASPoint_SetHeader(self.handle, value.handle)
+ header = property(get_header, set_header, None, None)
# def descale(self, header):
# """Descales the point with a given :obj:`liblas.header.Header` instance
#
diff -r 941c259f8c63 -r a82bf8a16b16 python/tests/SRS-GDAL.txt
--- a/python/tests/SRS-GDAL.txt Wed Jan 26 13:03:31 2011 -0600
+++ b/python/tests/SRS-GDAL.txt Thu Jan 27 14:07:16 2011 -0600
@@ -72,7 +72,7 @@
# >>> utm_header.scale = [0.000001,0.000001,0.000001]
>>> utm_header.srs = s_utm
- >>> dd_header.scale = [0.000001,0.000001,0.000001]
+# >>> dd_header.scale = [0.000001,0.000001,0.000001]
>>> dd_header.srs = s_dd
>>> f = file.File('../test/data/1.2_3.las',mode='r', header = utm_header)
@@ -100,6 +100,11 @@
>>> f_project = file.File('junk_srs_project.las',mode='w',header=dd_header)
+
+ >>> p.header = dd_header
+ >>> p.x, p.y
+ (-93.350000000000009, 41.579999999999998)
+
>>> dd_header.srs.proj4
'+proj=longlat +datum=WGS84 +no_defs '
>>> f_project.write(p);f_project.write(p);f_project.write(p)
@@ -107,7 +112,7 @@
>>> del f_project
>>> f3 = file.File('junk_srs_project.las')
>>> f3.header.data_offset
- 477L
+ 789L
>>> s_utm = srs.SRS()
>>> s_utm.wkt = utm_wkt
diff -r 941c259f8c63 -r a82bf8a16b16 src/c_api.cpp
--- a/src/c_api.cpp Wed Jan 26 13:03:31 2011 -0600
+++ b/src/c_api.cpp Thu Jan 27 14:07:16 2011 -0600
@@ -441,7 +441,11 @@
transforms.end());
liblas::TransformPtr srs_transform = liblas::TransformPtr(new liblas::ReprojectionTransform(in_ref, *out_ref, liblas::HeaderPtr(new liblas::Header(h))));
- transforms.insert(transforms.begin(), srs_transform);
+ if (transforms.size())
+ transforms.insert(transforms.begin(), srs_transform);
+ else
+ transforms.push_back(srs_transform);
+ reader->SetTransforms(transforms);
// ((liblas::Reader*) hReader)->SetOutputSRS(*((liblas::SpatialReference*)hSRS));
}
@@ -1729,7 +1733,11 @@
transforms.end());
liblas::TransformPtr srs_transform = liblas::TransformPtr(new liblas::ReprojectionTransform(in_ref, *out_ref, liblas::HeaderPtr(new liblas::Header(h))));
- transforms.insert(transforms.begin(), srs_transform);
+ if (transforms.size())
+ transforms.insert(transforms.begin(), srs_transform);
+ else
+ transforms.push_back(srs_transform);
+ writer->SetTransforms(transforms);
}
catch (std::exception const& e) {
LASError_PushError(LE_Failure, e.what(), "LASWriter_SetOutputSRS");
diff -r 941c259f8c63 -r a82bf8a16b16 src/spatialreference.cpp
--- a/src/spatialreference.cpp Wed Jan 26 13:03:31 2011 -0600
+++ b/src/spatialreference.cpp Thu Jan 27 14:07:16 2011 -0600
@@ -714,8 +714,9 @@
throw std::runtime_error("The geotiff keys could not be written");
}
- // TODO: Should we clear WKT so it gets regenerated?
-
+ // Clear WKT so it gets regenerated
+ m_wkt = std::string("");
+
ResetVLRs();
#else
boost::ignore_unused_variable_warning(citation);
More information about the Liblas-commits
mailing list