Skip to content

Commit

Permalink
Configured GeoWave drivers to run as plugins.
Browse files Browse the repository at this point in the history
  • Loading branch information
womeara committed Feb 11, 2015
1 parent 40707b9 commit dd63393
Show file tree
Hide file tree
Showing 20 changed files with 121 additions and 114 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Expand Up @@ -106,6 +106,10 @@ option(BUILD_PLUGIN_CPD "Choose if Coherent Point Drift kernel is built" FALSE)
add_feature_info("CPD plugin" BUILD_PLUGIN_CPD
"run Coherent Point Drift on two datasets")

option(BUILD_PLUGIN_GEOWAVE "Choose if GeoWave support should be built" FALSE)
add_feature_info("GeoWave plugin" BUILD_PLUGIN_GEOWAVE
"Read and Write data using GeoWave")

option(BUILD_PLUGIN_GREYHOUND "Choose if Greyhound support should be built" FALSE)
add_feature_info("Greyhound plugin" BUILD_PLUGIN_GREYHOUND
"read points from a Greyhound server")
Expand Down Expand Up @@ -196,9 +200,6 @@ include(${PDAL_CMAKE_DIR}/geos.cmake) # Optional
include(${PDAL_CMAKE_DIR}/geotiff.cmake) # Optional
include(${PDAL_CMAKE_DIR}/lazperf.cmake) # Optional
include(${PDAL_CMAKE_DIR}/laszip.cmake) # Optional
include(${PDAL_CMAKE_DIR}/JNI.cmake) # Optional
include(${PDAL_CMAKE_DIR}/Jace.cmake) # Optional
include(${PDAL_CMAKE_DIR}/GeoWave.cmake) # Optional
include(${PDAL_CMAKE_DIR}/threads.cmake)
include(${PDAL_CMAKE_DIR}/zlib.cmake)

Expand Down
17 changes: 0 additions & 17 deletions cmake/GeoWave.cmake

This file was deleted.

20 changes: 0 additions & 20 deletions cmake/JNI.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/boost.cmake
Expand Up @@ -13,7 +13,7 @@ if(WIN32)
endif(MSVC)
endif(WIN32)

find_package(Boost 1.53 REQUIRED COMPONENTS program_options iostreams filesystem system)
find_package(Boost 1.53 REQUIRED COMPONENTS program_options iostreams filesystem system thread)
set_package_properties(Boost PROPERTIES TYPE REQUIRED
PURPOSE "Boost provides fundamental functionality for PDAL")
if(Boost_FOUND)
Expand Down
17 changes: 17 additions & 0 deletions cmake/geowave.cmake
@@ -0,0 +1,17 @@
#
# GeoWave support
#

# GeoWave support - optional, default=OFF
option(BUILD_PLUGIN_GEOWAVE "Choose if GeoWave support should be built" FALSE)
if(BUILD_PLUGIN_GEOWAVE)
find_package(GeoWave 0.8.3)
if(GEOWAVE_FOUND)
mark_as_advanced(CLEAR GeoWave_RUNTIME_JAR)
add_definitions(-DGEOWAVE_RUNTIME_JAR=${GEOWAVE_RUNTIME_JAR})
set(PDAL_HAVE_GEOWAVE 1)
else()
set(GEOWAVE_RUNTIME_JAR "")
set(BUILD_PLUGIN_GEOWAVE FALSE)
endif()
endif()
11 changes: 5 additions & 6 deletions cmake/Jace.cmake → cmake/jace.cmake
Expand Up @@ -3,20 +3,19 @@
#

# Jace support - optional, default=OFF
option(WITH_JACE "Choose if JACE support should be built" FALSE)
if(WITH_JACE)
if(BUILD_PLUGIN_GEOWAVE)
find_package(Jace)
if(JACE_FOUND)
set(CMAKE_REQUIRED_LIBRARIES "${JACE_LIBRARY}")
include_directories(${JACE_INCLUDE_DIR})
mark_as_advanced(CLEAR JACE_INCLUDE_DIR)
mark_as_advanced(CLEAR JACE_LIBRARY)
mark_as_advanced(CLEAR JACE_RUNTIME_JAR)
add_definitions(-DJACE_RUNTIME_JAR=${JACE_RUNTIME_JAR})
mark_as_advanced(CLEAR JACE_RUNTIME_JAR)
add_definitions(-DJACE_RUNTIME_JAR=${JACE_RUNTIME_JAR})
set(PDAL_HAVE_JACE 1)
else()
set(JACE_LIBRARY "")
set(JACE_RUNTIME "")
set(WITH_JACE FALSE)
set(JACE_RUNTIME "")
set(BUILD_PLUGIN_GEOWAVE FALSE)
endif()
endif()
19 changes: 19 additions & 0 deletions cmake/jni.cmake
@@ -0,0 +1,19 @@
#
# JNI support
#

# JNI support - optional, default=OFF
if(BUILD_PLUGIN_GEOWAVE)
find_package(JNI)
if(JNI_FOUND)
set(CMAKE_REQUIRED_LIBRARIES "${JNI_LIBRARIES}")
include_directories(${JNI_INCLUDE_DIRS})
mark_as_advanced(CLEAR JNI_INCLUDE_DIRS)
mark_as_advanced(CLEAR JNI_LIBRARIES)
add_definitions(-DJAVA_EXECUTABLE_PATH=${Java_JAVA_EXECUTABLE})
set(PDAL_HAVE_JNI 1)
else()
set(JNI_LIBRARIES "")
set(BUILD_PLUGIN_GEOWAVE FALSE)
endif()
endif()
8 changes: 4 additions & 4 deletions cmake/modules/FindGeoWave.cmake
Expand Up @@ -9,12 +9,12 @@
###############################################################################
MESSAGE(STATUS "Searching for GeoWave")

IF(GeoWave_RUNTIME_JAR)
IF(GEOWAVE_RUNTIME_JAR)
# Already in cache, be silent
SET(GeoWave_FIND_QUIETLY TRUE)
SET(GEOWAVE_FIND_QUIETLY TRUE)
ENDIF()

FIND_FILE(GeoWave_RUNTIME_JAR
FIND_FILE(GEOWAVE_RUNTIME_JAR
geowave-deploy-${GeoWave_FIND_VERSION}-accumulo-singlejar.jar
PATHS
/usr/bin
Expand All @@ -24,4 +24,4 @@ FIND_FILE(GeoWave_RUNTIME_JAR
# Handle the QUIETLY and REQUIRED arguments and set GeoWave_FOUND to TRUE
# if all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GeoWave DEFAULT_MSG GeoWave_RUNTIME_JAR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GeoWave DEFAULT_MSG GEOWAVE_RUNTIME_JAR)
2 changes: 0 additions & 2 deletions include/pdal/Drivers.hpp
Expand Up @@ -52,5 +52,3 @@
#include <terrasolid/TerrasolidReader.hpp>
#include <text/TextWriter.hpp>

#include <geowave/GeoWaveReader.hpp>
#include <geowave/GeoWaveWriter.hpp>
1 change: 0 additions & 1 deletion io/CMakeLists.txt
Expand Up @@ -5,6 +5,5 @@ add_subdirectory(qfit)
add_subdirectory(sbet)
add_subdirectory(text)
add_subdirectory(terrasolid)
add_subdirectory(geowave)

set(PDAL_TARGET_OBJECTS ${PDAL_TARGET_OBJECTS} PARENT_SCOPE)
35 changes: 0 additions & 35 deletions io/geowave/CMakeLists.txt

This file was deleted.

4 changes: 4 additions & 0 deletions plugins/CMakeLists.txt
Expand Up @@ -6,6 +6,10 @@ if(BUILD_PLUGIN_CPD)
add_subdirectory(cpd)
endif(BUILD_PLUGIN_CPD)

if(BUILD_PLUGIN_GEOWAVE)
add_subdirectory(geowave)
endif(BUILD_PLUGIN_GEOWAVE)

if(BUILD_PLUGIN_GREYHOUND)
add_subdirectory(greyhound)
endif()
Expand Down
47 changes: 47 additions & 0 deletions plugins/geowave/CMakeLists.txt
@@ -0,0 +1,47 @@
#
# GeoWave driver CMake configuration
#

include(${PDAL_CMAKE_DIR}/jni.cmake)
include(${PDAL_CMAKE_DIR}/jace.cmake)
include(${PDAL_CMAKE_DIR}/geowave.cmake)

set(GEOWAVE_LIBRARIES "")
set(GEOWAVE_LIBRARIES ${GEOWAVE_LIBRARIES} ${Boost_LIBRARIES})
set(GEOWAVE_LIBRARIES ${GEOWAVE_LIBRARIES} ${JNI_LIBRARIES})
set(GEOWAVE_LIBRARIES ${GEOWAVE_LIBRARIES} ${JACE_LIBRARY})
set(GEOWAVE_LIBRARIES ${GEOWAVE_LIBRARIES} ${JAVA_AWT_LIBRARY})
set(GEOWAVE_LIBRARIES ${GEOWAVE_LIBRARIES} ${JAVA_JVM_LIBRARY})

set(objs "")

#
# GeoWave Reader
#
set(srcs
io/GeoWaveReader.cpp
)

set(incs
io/GeoWaveReader.hpp
)

PDAL_ADD_PLUGIN(reader_libname reader geowave
FILES "${srcs}" "${incs}"
LINK_WITH ${GEOWAVE_LIBRARIES})

#
# GeoWave Writer
#
set(srcs
io/GeoWaveWriter.cpp
)

set(incs
io/GeoWaveWriter.hpp
)

PDAL_ADD_PLUGIN(writer_libname writer geowave
FILES "${srcs}" "${incs}"
LINK_WITH ${GEOWAVE_LIBRARIES})

Expand Up @@ -127,6 +127,7 @@ using jace::proxy::mil::nga::giat::geowave::accumulo::AccumuloDataStore;
#include "jace/proxy/mil/nga/giat/geowave/accumulo/metadata/AccumuloAdapterStore.h"
using jace::proxy::mil::nga::giat::geowave::accumulo::metadata::AccumuloAdapterStore;

CREATE_READER_PLUGIN(geowave, pdal::GeoWaveReader)

#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
Expand All @@ -140,12 +141,12 @@ namespace pdal

Option zookeeperUrl("zookeeperUrl", "", "The comma-delimited URLs for all zookeeper servers, this will be directly used to instantiate a ZookeeperInstance");
Option instanceName("instanceName", "", "The zookeeper instance name, this will be directly used to instantiate a ZookeeperInstance");
Option username("username", "", "The username for an account to establish an Accumulo connector");
Option username("username", "", "The username for the account to establish an Accumulo connector");
Option password("password", "", "The password for the account to establish an Accumulo connector");
Option tableNamespace("tableNamespace", "", "The table name to be used when querying GeoWave");
Option featureTypeName("featureTypeName", "", "The feature type name to be used when querying GeoWave");
Option dataAdapter("dataAdapter", "FeatureCollectionDataAdapter", "FeatureCollectionDataAdapter stores multiple points per accumulo entry. FeatureDataAdapter stores a single point per accumulo entry.");
Option pointsPerEntry("pointsPerEntry", 5000u, "Sets the maximum number of points per accumulo entry when using FeatureCollectionDataAdapter.");
Option tableNamespace("tableNamespace", "", "The table name to be used when interacting with GeoWave");
Option featureTypeName("featureTypeName", "", "The feature type name to be used when interacting with GeoWave");
Option dataAdapter("dataAdapter", "FeatureCollectionDataAdapter", "FeatureCollectionDataAdapter stores multiple points per Accumulo entry. FeatureDataAdapter stores a single point per Accumulo entry.");
Option pointsPerEntry("pointsPerEntry", 5000u, "Sets the maximum number of points per Accumulo entry when using FeatureCollectionDataAdapter.");
Option bounds("bounds", "", "The extent of the bounding rectangle to use to query points, expressed as a string, eg: ([xmin, xmax], [ymin, ymax], [zmin, zmax])");

options.add(zookeeperUrl);
Expand Down
Expand Up @@ -35,6 +35,7 @@
#pragma once

#include <pdal/Reader.hpp>
#include <pdal/StageFactory.hpp>
#include <pdal/util/Bounds.hpp>

#ifdef PDAL_HAVE_GEOS
Expand All @@ -50,8 +51,9 @@ namespace pdal
class PDAL_DLL GeoWaveReader : public Reader
{
public:
SET_STAGE_NAME("readers.geowave", "Geowave Reader")
SET_STAGE_NAME("readers.geowave", "GeoWave Reader")
SET_STAGE_LINK("http://pdal.io/stages/drivers.geowave.reader.html")
SET_PLUGIN_VERSION("1.0.0")

static Options getDefaultOptions();
static Dimension::IdList getDefaultDimensions();
Expand Down
Expand Up @@ -133,6 +133,8 @@ using jace::proxy::mil::nga::giat::geowave::accumulo::AccumuloDataStore;
#include "jace/proxy/mil/nga/giat/geowave/accumulo/AccumuloIndexWriter.h"
using jace::proxy::mil::nga::giat::geowave::accumulo::AccumuloIndexWriter;

CREATE_WRITER_PLUGIN(geowave, pdal::GeoWaveWriter)

#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)

Expand All @@ -145,12 +147,12 @@ namespace pdal

Option zookeeperUrl("zookeeperUrl", "", "The comma-delimited URLs for all zookeeper servers, this will be directly used to instantiate a ZookeeperInstance.");
Option instanceName("instanceName", "", "The zookeeper instance name, this will be directly used to instantiate a ZookeeperInstance.");
Option username("username", "", "The username for an account to establish an Accumulo connector.");
Option username("username", "", "The username for the account to establish an Accumulo connector.");
Option password("password", "", "The password for the account to establish an Accumulo connector.");
Option tableNamespace("tableNamespace", "", "The table name to be used when querying GeoWave.");
Option featureTypeName("featureTypeName", "PDAL_Point", "The feature type name to be used when querying GeoWave.");
Option dataAdapter("dataAdapter", "FeatureCollectionDataAdapter", "FeatureCollectionDataAdapter stores multiple points per accumulo entry. FeatureDataAdapter stores a single point per accumulo entry.");
Option pointsPerEntry("pointsPerEntry", 5000u, "Sets the maximum number of points per accumulo entry when using FeatureCollectionDataAdapter.");
Option tableNamespace("tableNamespace", "", "The table name to be used when interacting with GeoWave.");
Option featureTypeName("featureTypeName", "PDAL_Point", "The feature type name to be used when interacting with GeoWave.");
Option dataAdapter("dataAdapter", "FeatureCollectionDataAdapter", "FeatureCollectionDataAdapter stores multiple points per Accumulo entry. FeatureDataAdapter stores a single point per Accumulo entry.");
Option pointsPerEntry("pointsPerEntry", 5000u, "Sets the maximum number of points per Accumulo entry when using FeatureCollectionDataAdapter.");

options.add(zookeeperUrl);
options.add(instanceName);
Expand Down
Expand Up @@ -35,6 +35,7 @@
#pragma once

#include <pdal/Writer.hpp>
#include <pdal/StageFactory.hpp>

#include <vector>
#include <string>
Expand All @@ -45,8 +46,9 @@ namespace pdal
class PDAL_DLL GeoWaveWriter : public Writer
{
public:
SET_STAGE_NAME("writers.geowave", "Geowave Writer")
SET_STAGE_NAME("writers.geowave", "GeoWave Writer")
SET_STAGE_LINK("http://pdal.io/stages/drivers.geowave.writer.html")
SET_PLUGIN_VERSION("1.0.0")

static Options getDefaultOptions();

Expand Down
2 changes: 1 addition & 1 deletion plugins/pcl/CMakeLists.txt
Expand Up @@ -37,7 +37,7 @@ if (NOT WIN32)
endif()

# PCL's configuration clobbers Boost find_package - do it again
find_package(Boost QUIET 1.52 COMPONENTS program_options iostreams filesystem system)
find_package(Boost QUIET 1.52 COMPONENTS program_options iostreams filesystem system thread)

if (PCL_VISUALIZATION_FOUND)
#
Expand Down
8 changes: 0 additions & 8 deletions src/CMakeLists.txt
Expand Up @@ -199,14 +199,6 @@ if (WITH_LASZIP)
target_link_libraries(${PDAL_LIB_NAME} ${LASZIP_LIBRARY})
endif()

if (WITH_JNI)
target_link_libraries(${PDAL_LIB_NAME} ${JNI_LIBRARIES})
endif()

if (WITH_JACE)
target_link_libraries(${PDAL_LIB_NAME} ${JACE_LIBRARY})
endif()

if (PDAL_HAVE_PYTHON)
target_link_libraries(${PDAL_LIB_NAME} ${PYTHON_LIBRARY})
endif()
Expand Down

0 comments on commit dd63393

Please sign in to comment.