[Liblas-commits] libpc: start of prototype API
liblas-commits at liblas.org
liblas-commits at liblas.org
Fri Feb 4 19:08:49 EST 2011
details: http://hg.liblas.orglibpc/rev/74cffc71d096
changeset: 3:74cffc71d096
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Feb 04 16:08:23 2011 -0800
description:
start of prototype API
Subject: libpc: merge
details: http://hg.liblas.orglibpc/rev/9e9f48aeacb1
changeset: 4:9e9f48aeacb1
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Feb 04 16:08:40 2011 -0800
description:
merge
diffstat:
.hgignore | 13 +++
copyright.txt | 33 ++++++++
doc/notes/apps.txt | 24 +++++-
doc/notes/goals.txt | 2 +-
doc/notes/io.txt | 15 +++
doc/notes/misc.txt | 40 +++++++---
doc/notes/stages.txt | 13 ++-
include/libpc/CropFilter.hpp | 50 ++++++++++++
include/libpc/Field.hpp | 94 ++++++++++++++++++++++++
include/libpc/Header.hpp | 60 +++++++++++++++
include/libpc/LasReader.hpp | 53 +++++++++++++
include/libpc/LasWriter.hpp | 56 ++++++++++++++
include/libpc/Layout.hpp | 64 ++++++++++++++++
include/libpc/Point.hpp | 55 ++++++++++++++
include/libpc/PointBuffer.hpp | 59 +++++++++++++++
include/libpc/PointData.hpp | 67 +++++++++++++++++
include/libpc/Reader.hpp | 61 +++++++++++++++
include/libpc/Stage.hpp | 60 +++++++++++++++
include/libpc/Writer.hpp | 60 +++++++++++++++
prototype.sln | 25 ++++++
src/CropFilter.cpp | 40 ++++++++++
src/Field.cpp | 162 ++++++++++++++++++++++++++++++++++++++++++
src/Header.cpp | 79 ++++++++++++++++++++
src/LasReader.cpp | 97 +++++++++++++++++++++++++
src/LasWriter.cpp | 68 +++++++++++++++++
src/Layout.cpp | 139 ++++++++++++++++++++++++++++++++++++
src/Point.cpp | 43 +++++++++++
src/PointBuffer.cpp | 57 ++++++++++++++
src/PointData.cpp | 76 +++++++++++++++++++
src/Reader.cpp | 41 ++++++++++
src/Stage.cpp | 52 +++++++++++++
src/Writer.cpp | 67 +++++++++++++++++
src/main.cpp | 50 ++++++++++++
src/prototype.vcxproj | 109 ++++++++++++++++++++++++++++
34 files changed, 1964 insertions(+), 20 deletions(-)
diffs (truncated from 2229 to 300 lines):
diff -r b909e7ef42a9 -r 9e9f48aeacb1 .hgignore
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore Fri Feb 04 16:08:40 2011 -0800
@@ -0,0 +1,13 @@
+syntax: glob
+
+# rst outputs
+*.pdf
+
+# visual studio cruft
+Debug/
+ipch/
+*.vcxproj.filters
+*.vcxproj.user
+*.sdf
+*.suo
+*.opensdf
diff -r b909e7ef42a9 -r 9e9f48aeacb1 copyright.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/copyright.txt Fri Feb 04 16:08:40 2011 -0800
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of the Martin Isenburg or Iowa Department
+ * of Natural Resources nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ ****************************************************************************/
diff -r b909e7ef42a9 -r 9e9f48aeacb1 doc/notes/apps.txt
--- a/doc/notes/apps.txt Thu Feb 03 15:37:07 2011 -0800
+++ b/doc/notes/apps.txt Fri Feb 04 16:08:40 2011 -0800
@@ -14,6 +14,10 @@
Converts from one file format to another, optionally with some (relatively
simple) filtering or processing.
+Input format detection should reside in the app, not in the library. There
+will be no equivalent meta GDALOpen-like function to do this work for you.
+Too expensive and too easy to screw up.
+
pcinfo
======
@@ -28,10 +32,16 @@
* summary statistics about the points
+* the plain text format should be reStructured text if possible to allow
+ a user to retransform the output into whatever they want with ease
+
+* the xml format needs an XSD or XMLSchema for validation.
+
The dump should go the stdout, but options should be provided to dump to
XML or similar, where it makes sense to do so.
+
pcview
======
@@ -40,19 +50,25 @@
wants to do something too.
+
+
pcindex
=======
-Creates a spatial index for a point cloud. (Could be moved into pc2pc.)
+Creates a serialized spatial index for a point cloud. First pass at this
+is to repurpose liblas::Index which supports serialization.
pcmosaic
========
-Merges multiple files together. (Could be moved into pc2pc.)
+Merges multiple files together.
+Does mosaic imply something that merge doesn't?
-pcdemosaic
+
+pctile
==========
-Chops one file up into multiple files. (Could be moved into pc2pc.)
+Chops one file up into multiple files. This could be the liblas::Chipper,
+leaf nodes of an index like an R-tree, or a simple quadtree build.
diff -r b909e7ef42a9 -r 9e9f48aeacb1 doc/notes/goals.txt
--- a/doc/notes/goals.txt Thu Feb 03 15:37:07 2011 -0800
+++ b/doc/notes/goals.txt Fri Feb 04 16:08:40 2011 -0800
@@ -12,7 +12,7 @@
2. It is a library which provides APIs for reading, writing, and processing
point cloud data of various formats. As GDAL is to 2D pixels, libPC is
- to 3D points.
+ to xD points.
3. It has high performance, yet remains flexible. We recognize that
these two goals will conflict at times and will weigh the tradeoffs
diff -r b909e7ef42a9 -r 9e9f48aeacb1 doc/notes/io.txt
--- a/doc/notes/io.txt Thu Feb 03 15:37:07 2011 -0800
+++ b/doc/notes/io.txt Fri Feb 04 16:08:40 2011 -0800
@@ -9,12 +9,27 @@
* Is C's unix-style I/O generally faster/slower/same-as C++'s stream-style
I/O?
+
+ They should be equivalent if used "right". Mateusz did a bunch of work
+ on this last summer to check for comparison. std::fstream was found to be
+ sensitive to setting its buffer, but that was it.
* Are boost's streams any faster than the native compiler's streams?
+No. Boost's streams provide a consistent interface to the native compiler's
+streams. They also provide additional functionality like a gzip stream, etc.
+
* Is it worth providing our own simple unix-style binary stream interface,
which we use internally, and then letting the choice of underlying
implementation be made up at the app level? (LizardTech does this.
Maybe GDAL too sometimes?)
+
+ I'd rather offload this to boost's iostreams if we can. What do we
+ get for the extra pain of adding another layer here? Can we have the boost
+ take on the maintenance of this layer for us?
* Do we want to spend some time investigating this issue up front?
+
+ libLAS does not use boost's streams because it didn't have the boost
+ dependency until later in its life. To do it again, I would assume boost
+ was in the mix and would use boost's iostreams by default.
diff -r b909e7ef42a9 -r 9e9f48aeacb1 doc/notes/misc.txt
--- a/doc/notes/misc.txt Thu Feb 03 15:37:07 2011 -0800
+++ b/doc/notes/misc.txt Fri Feb 04 16:08:40 2011 -0800
@@ -41,20 +41,24 @@
libPC will use these libraries:
-* GDAL - for spatial reference support (and rasterization)
-* Boost - for C++ library needs, such as streams or parsers
+* Boost - for C++ library needs, such as streams or parsers (required)
-* laszip - for compressed LAS support
+* libxml2 - Schema description, validation, and serialization (required)
-* MrSID - for LizardTech's MG4 lidar format
+* GDAL - for spatial reference support (and rasterization) (optional)
-* Oracle - ...?
+* libLAS - for LAS (compressed if available to libLAS) support. (optional)
+
+* MrSID - for LizardTech's MG4 lidar format (optional)
+
+* Oracle - OCI (optional)
+
+* libspatialindex - Rtree support, maybe quadtree if someone implements it for libspatialindex (optional)
* *others?*
-Some of these libraries may be required (such as Boost); some may be
-configurable at build time, such as laszip.
+Some of these libraries may be required (such as Boost).
Project Dependencies - Builds/Infrastructure
@@ -95,11 +99,11 @@
We will support these platforms initially, corresponding to what the
developers are using regularly:
-* Windows - VS2010 (32- and 64-bit)
+* Windows - VS2010 (32- and 64-bit) - 2008 32-bit
-* Linux - *gcc x.y?*
+* Linux - gcc 4.x+
-* Mac - *stuff*
+* Mac - gcc 4.0.1+
By virtue of CMake, other platforms may be supported such as VS 2008 or
Solaris, but we aren't targeting those specifically.
@@ -123,10 +127,16 @@
* filenames must match class name
-* *layout/organization of source tree?*
+* *layout/organization of source tree?*
+
+ public headers in ./include
+ private headers alongside source files in src/
-* *use of namespaces?*
+* *use of namespaces?* (copy boost)
+ libpc::
+ libpc::detail::
+
libPC Position on (Non)conformance
==================================
@@ -152,6 +162,10 @@
option would never be the default behavior, however.
*We should also have a guiding principle about files that are conformant but
-which lie, such as the extents in the header being wrong. Specifically, is
+which lie, such as the extents in the header being wrong.
+
+Specifically, is
our default path to propagate the wrong info or to helpfully correct it on
the fly?*
+
+ Do both, but more often than not try to helpfully correct it.
diff -r b909e7ef42a9 -r 9e9f48aeacb1 doc/notes/stages.txt
--- a/doc/notes/stages.txt Thu Feb 03 15:37:07 2011 -0800
+++ b/doc/notes/stages.txt Fri Feb 04 16:08:40 2011 -0800
@@ -21,7 +21,11 @@
* MrSID/MG4
-* Oracle database
+* Oracle Point Cloud
+
+* BAG, Fledermaus, other bathy formats
+
+* Pointools?
* Auto - creates points randomly, or as a constant pattern; used only for
testing
@@ -40,7 +44,9 @@
* MrSID/MG4
-* Oracle database
+* Oracle Point Cloud
+
+* BAG, Fledermaus, other bathy formats
* Null - dumps output to /dev/null; used only for testing
@@ -59,6 +65,9 @@
* Cache - maintains points in memory, only reaching "behind" to the previous
stage if the point needed is not in the cache
+* Expression engine - "classification=3;0<=x<=100"
+
+* Transformation engine - "intensity=classification * 2; x = x*3.2808399"
Other
=====
diff -r b909e7ef42a9 -r 9e9f48aeacb1 include/libpc/CropFilter.hpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/libpc/CropFilter.hpp Fri Feb 04 16:08:40 2011 -0800
@@ -0,0 +1,50 @@
+/******************************************************************************
+* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following
+* conditions are met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in
+* the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of the Martin Isenburg or Iowa Department
+* of Natural Resources nor the names of its contributors may be
+* used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
More information about the Liblas-commits
mailing list