Skip to content

Commit

Permalink
Merge branch 'master' into i3sbinary
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemann16 committed Sep 22, 2018
2 parents 9192c79 + 3726879 commit c4f0539
Show file tree
Hide file tree
Showing 15 changed files with 1,194 additions and 821 deletions.
46 changes: 46 additions & 0 deletions doc/stages/readers.i3s.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.. _readers.i3s:

readers.i3s
===========

`Indexed 3d Scene Layer (I3S)`_ and `Scene Layer Packages (SLPK)`_ are
specifications created by Esri as a format for their 3D Scene Layer and scene services. The I3S reader both handles the reading of SLPK archived files locally as well as data stored in the I3S format remotely.

Example
--------------------------------------------------------------------------------
This example will download the Autzen dataset from the arcgis scene server, reproject it to another spatial reference, and output it to a las file. This is done through PDAL's command line interface or through the pipeline.

.. code-block:: json
{
"pipeline":[
{
"type": "readers.i3s",
"filename": "https://tiles.arcgis.com/tiles/8cv2FuXuWSfF0nbL/arcgis/rest/services/AUTZEN_LiDAR/SceneServer"
"bounds": "([-123.075542,-123.06196],[44.049719,44.06278])"
}
]
}
``pdal traslate i3s://https://tiles.arcgis.com/tiles/8cv2FuXuWSfF0nbL/arcgis/rest/services/AUTZEN_LiDAR/SceneServer \
autzen.las \
--reprojection filters.reprojection.out_srs=EPSG:3857 \
--readers.i3s.threads=64 \
--readers.i3s.bounds="([-123.075542,-123.06196],[44.049719,44.06278])"``

Options
--------------------------------------------------------------------------------
filename
I3S file stored remotely, or a SLPK file stored locally. Remote files must be prefaced with an "i3s://", and local files must have the ".slpk" file extension.
Exmaple remote file: ``pdal translate i3s://https://tiles.arcgis.com/tiles/8cv2FuXuWSfF0nbL/arcgis/rest/services/AUTZEN_LiDAR/SceneServer autzen.las``
Example local file: ``pdal info /PDAL/test/data/i3s/SMALL_AUTZEN_LAS_ALL.slpk``

threads
This specifies the number of threads that you would like to use while reading. The default number of threads to buse used is 8. This affects the speed at which files are fetched and added to the PDAL view.
Example: ``--readers.i3s.threads=numThreads``

bounds
The bounds refers to the extents of the resource in X, Y, Z coordinates with the Z dimension being optional. This must be input as a string.
Example:``readers.i3s.bounds="([xmin,xmax],[ymin,ymax],[zmin,zmax])"``

.. _Indexed 3d Scene Layer (I3S): https://github.com/Esri/i3s-spec/blob/master/format/Indexed%203d%20Scene%20Layer%20Format%20Specification.md
.. _Scene Layer Packages (SLPK): https://github.com/Esri/i3s-spec/blob/master/format/Indexed%203d%20Scene%20Layer%20Format%20Specification.md#_8_1
3 changes: 2 additions & 1 deletion pdal/StageExtensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ R"PDALEXTENSIONS(
"readers.mrsid" : "sid",
"readers.rxp" : "rxp",
"readers.fbx" : "fbx",
"readers.i3s" : "i3s"
"readers.i3s" : "i3s",
"readers.slpk" : "slpk"
}
)PDALEXTENSIONS"
Expand Down
2 changes: 0 additions & 2 deletions pdal/StageFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ std::string StageFactory::inferReaderDriver(const std::string& filename)

if (protocol != protocols.end())
ext = "." + *protocol;
else if (filename.find(".slpk") != std::string::npos)
ext = ".i3s";
else
ext = FileUtils::extension(filename);
// Strip off '.' and make lowercase.
Expand Down
49 changes: 39 additions & 10 deletions plugins/i3s/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,60 @@ if (WIN32)
add_definitions("-DARBITER_DLL_IMPORT")
endif()

add_subdirectory(lepcc)
add_subdirectory(lepcc)
set_property(TARGET lepcc PROPERTY POSITION_INDEPENDENT_CODE TRUE)


PDAL_ADD_PLUGIN(reader_libname reader i3s
PDAL_ADD_PLUGIN(i3s_reader_libname reader i3s
FILES
io/i3sReader.cpp
io/i3sReceiver.cpp
io/I3SReader.cpp
io/EsriReceiver.cpp
io/SlpkExtractor.cpp
io/EsriReader.cpp
LINK_WITH
${PDAL_JSONCPP_LIB_NAME}
${WINSOCK_LIBRARY}
)

target_link_libraries(${reader_libname} PRIVATE
PDAL_ADD_PLUGIN(slpk_reader_libname reader slpk
FILES
io/SlpkReader.cpp
io/EsriReceiver.cpp
io/EsriReader.cpp
io/SlpkExtractor.cpp
LINK_WITH
${PDAL_JSONCPP_LIB_NAME}
${WINSOCK_LIBRARY}
)


target_link_libraries(${i3s_reader_libname} PRIVATE
${GDAL_LIBRARY}
${ZLIB_LIBRARY}
${ZLIB_LIBRARY}
lepcc
)

target_link_libraries(${slpk_reader_libname} PRIVATE
${GDAL_LIBRARY}
${ZLIB_LIBRARY}
lepcc
)

include(${PDAL_CMAKE_DIR}/zlib.cmake)
if (ZLIB_FOUND)
target_compile_definitions(${reader_libname} PRIVATE -DARBITER_ZLIB)
target_compile_definitions(${i3s_reader_libname} PRIVATE -DARBITER_ZLIB)
target_compile_definitions(${slpk_reader_libname} PRIVATE -DARBITER_ZLIB)
endif()

target_include_directories(${reader_libname} PRIVATE
target_include_directories(${i3s_reader_libname} PRIVATE
${PDAL_JSONCPP_INCLUDE_DIR}
${PDAL_VENDOR_DIR}
${LEPCC_INCLUDE_DIR}
${PDAL_VENDOR_DIR}/eigen
${GDAL_INCLUDE_DIR}
)

target_include_directories(${slpk_reader_libname} PRIVATE
${PDAL_JSONCPP_INCLUDE_DIR}
${PDAL_VENDOR_DIR}
${LEPCC_INCLUDE_DIR}
Expand All @@ -42,8 +70,8 @@ if (WITH_TESTS)
FILES
test/i3sReaderTest.cpp
LINK_WITH
${reader_libname}
${writer_libname}
${slpk_reader_libname}
${i3s_reader_libname}
${PDAL_JSONCPP_LIB_NAME}
)
target_include_directories(pdal_io_i3s_reader_test PRIVATE
Expand All @@ -54,3 +82,4 @@ if (WITH_TESTS)
${GDAL_INCLUDE_DIR}
)
endif()

0 comments on commit c4f0539

Please sign in to comment.