Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into issue-3012
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Apr 22, 2020
2 parents b2312e5 + 539bb83 commit 571a0ff
Show file tree
Hide file tree
Showing 18 changed files with 78 additions and 39 deletions.
52 changes: 44 additions & 8 deletions doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ FAQ

.. index:: pronounce

.. |nbsp| unicode:: 0xA0
:trim:

* How do you pronounce PDAL?

The proper spelling of the project name is PDAL, in uppercase. It is
pronounced to rhyme with "GDAL".

.. it is properly pronounced like the dog though :) -- hobu
|
|nbsp|

* Why do I get the error "Couldn't create ... stage of type ..."?

Expand All @@ -23,7 +26,8 @@ FAQ
be found by running ``pdal --drivers``

If you've built pdal yourself, make sure you've requested to build the
plugin in question (set BUILD_PLUGIN_TILEDB=ON, for example, in CMakeCache.txt).
plugin in question (set BUILD_PLUGIN_TILEDB=ON, for example,
in CMakeCache.txt).

If you've successfully built the plugin, a
shared object called
Expand All @@ -41,6 +45,31 @@ FAQ
variable ``PDAL_DRIVER_PATH`` to a list of directories that pdal should search
for plugins.

|nbsp|

* Why do I get the error ``Unable to convert scaled value ... "
This error usually occurs when writing LAS files, but can occur with other
formats.
Simply, the output format you've chosen doesn't support values as large
(or small) as those that you're trying to write. For example. if the
output format specifies 32-bit signed integers, attempting to write a
value larger than 2,147,483,647 will cause this error, as 2,147,483,647
is the largest 32-bit signed integer.
The LAS format always stores X, Y and Z values as 32-bit integers.
You can specify a scale factor to be applied to those values in order
to change their magnitude, but their precision is limited to 32 bits.
If the value
you're attempting to write, when divided by the scale factor you've
specified, is larger than 2,147,483,647, you will get this error.
For example, if you attempt to write the value 6 with a scale factor
of .000000001, you'll get this error, as 6 / .000000001 is 6,000,000,000,
which is larger than the maximum integer value.
|nbsp|
* Why am I using 100GB of memory when trying to process a 10GB LAZ file?
If you're performing an operation that is using
Expand All @@ -53,7 +82,7 @@ FAQ
:ref:`stream mode <processing_modes>` to
limit memory consumption when possible.
|
|nbsp|
* What is PDAL's relationship to PCL?
Expand All @@ -66,6 +95,8 @@ FAQ
:ref:`about_pcl` describes PDAL and PCL's relationship.
|nbsp|
* What is PDAL's relationship to libLAS?
The idea behind libLAS was limited to LIDAR data and basic
Expand All @@ -76,9 +107,7 @@ FAQ
talked more about this history in a `GeoHipster interview`_ in
2018.
.. _`GeoHipster interview`: http://geohipster.com/2018/03/05/howard-butler-like-good-song-open-source-software-chance-immortal/

|
|nbsp|
* Are there any command line tools in PDAL similar to LAStools?
Expand All @@ -92,20 +121,25 @@ FAQ
:ref:`apps` describes application operations you can
achieve with PDAL.
|nbsp|
* Is there any compatibility with libLAS's LAS Utility Applications or LAStools?
No. The the command line interface was developed from scratch with
focus on usability and readability. You will find that the ``pdal``
command has several well-organized subcommands such as ``info``
or ``translate`` (see :ref:`apps`).

|nbsp|

* I get GeoTIFF errors. What can I do about them?

::

(readers.las Error) Geotiff directory contains key 0 with short entry and more than one value.
(readers.las Error) Geotiff directory contains key 0 with short entry
and more than one value.

If :ref:`readers.las` is outputting error messages about GeoTIFF, this means
If :ref:`readers.las` is emitting error messages about GeoTIFF, this means
the keys that were written into your file were incorrect or at least not
readable by `libgeotiff`_. Rewrite the file using PDAL to fix the issue:

Expand All @@ -114,3 +148,5 @@ FAQ
pdal translate badfile.las goodfile.las --writers.las.forward=all

.. _`libgeotiff`: https://trac.osgeo.org/geotif
.. _`GeoHipster interview`: http://geohipster.com/2018/03/05/howard-butler-like-good-song-open-source-software-chance-immortal/

2 changes: 1 addition & 1 deletion doc/stages/readers.ept.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ threads
.. _Plasio: http://speck.ly/?s=http%3A%2F%2Fc%5B0-7%5D.greyhound.io&r=ept%3A%2F%2Fna.entwine.io%2Fnyc&ca=-0&ce=49.06&ct=-8239196%2C4958509.308%2C337&cd=42640.943&cmd=125978.13&ps=2&pa=0.1&ze=1&c0s=remote%3A%2F%2Fimagery%3Furl%3Dhttp%3A%2F%2Fserver.arcgisonline.com%2FArcGIS%2Frest%2Fservices%2FWorld_Imagery%2FMapServer%2Ftile%2F%7B%7Bz%7D%7D%2F%7B%7By%7D%7D%2F%7B%7Bx%7D%7D.jpg
.. _Schema: https://entwine.io/entwine-point-tile.html#schema

headers
header
HTTP headers to forward for remote EPT endpoints, structured as a JSON
object of key/value string pairs.

Expand Down
2 changes: 1 addition & 1 deletion io/Ilvis2Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void Ilvis2Reader::initialize(PointTableRef)
// Data are WGS84 (4326) with ITRF2000 datum (6656)
// See http://nsidc.org/data/docs/daac/icebridge/ilvis2/index.html for
// background
setSpatialReference(SpatialReference("EPSG:4326"));
setSpatialReference("EPSG:4326");
}


Expand Down
2 changes: 1 addition & 1 deletion io/OptechReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void OptechReader::initialize()

// The Optech docs say that their lat/longs are referenced
// to the WGS84 reference frame.
setSpatialReference(SpatialReference("EPSG:4326"));
setSpatialReference("EPSG:4326");
}


Expand Down
16 changes: 9 additions & 7 deletions pdal/Polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void Polygon::simplify(double distance_tolerance, double area_tolerance,
m_geom.reset(m_geom->Simplify(distance_tolerance));

removeSmallRings(area_tolerance);
removeSmallHoles(m_geom.get(), area_tolerance);
removeSmallHoles(area_tolerance);
modified();
}

Expand All @@ -190,24 +190,26 @@ void Polygon::removeSmallRings(double tolerance)
}


void Polygon::removeSmallHoles(OGRGeometry *g, double tolerance)
void Polygon::removeSmallHoles(double tolerance)
{
OGRwkbGeometryType t = g->getGeometryType();
if (t == wkbPolygon || t == wkbPolygon25D)
auto remove = [tolerance](OGRPolygon *poly)
{
OGRPolygon *poly = static_cast<OGRPolygon *>(g);
for (int i = poly->getNumInteriorRings() - 1; i >= 0; --i)
{
OGRLinearRing *lr = poly->getInteriorRing(i);
if (lr->get_Area() < tolerance)
OGR_G_RemoveGeometry(gdal::toHandle(poly), i + 1, true);
}
}
};

OGRwkbGeometryType t = m_geom->getGeometryType();
if (t == wkbPolygon || t == wkbPolygon25D)
remove(static_cast<OGRPolygon *>(m_geom.get()));
else if (t == wkbMultiPolygon || t == wkbMultiPolygon25D)
{
OGRMultiPolygon *mPoly = static_cast<OGRMultiPolygon *>(m_geom.get());
for (int i = mPoly->getNumGeometries() - 1; i >= 0; --i)
removeSmallHoles(mPoly->getGeometryRef(i), tolerance);
remove(static_cast<OGRPolygon *>(mPoly->getGeometryRef(i)));
}
}

Expand Down
2 changes: 1 addition & 1 deletion pdal/Polygon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class PDAL_DLL Polygon : public Geometry
private:
void init();
void removeSmallRings(double tolerance);
void removeSmallHoles(OGRGeometry *g, double tolerance);
void removeSmallHoles(double tolerance);

std::unique_ptr<PrivateData> m_pd;
};
Expand Down
3 changes: 1 addition & 2 deletions plugins/i3s/io/EsriReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ void EsriReader::initialize(PointTableRef table)
systemString + "'.");
setSpatialReference(m_nativeSrs);

m_ecefTransform.reset(new SrsTransform(m_nativeSrs,
SpatialReference("EPSG:4978")));
m_ecefTransform.reset(new SrsTransform(m_nativeSrs, "EPSG:4978"));
createBounds();
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/icebridge/io/IcebridgeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void IcebridgeReader::initialize()
// Data are WGS84 (4326) with ITRF2000 datum (6656)
// See http://nsidc.org/data/docs/daac/icebridge/ilvis2/index.html for
// background
setSpatialReference(SpatialReference("EPSG:4326"));
setSpatialReference("EPSG:4326");
}

void IcebridgeReader::done(PointTableRef table)
Expand Down
3 changes: 3 additions & 0 deletions plugins/nitf/test/NitfReaderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ TEST(NitfReaderTest, optionSrs)
EXPECT_EQ(sr, table.spatialReference().getWKT());
}

/**
// Crashes on Alpine. Seems related to allocation in Nitro.
TEST(NitfReaderTest, issue3010)
{
std::string filename(Support::temppath("issue3010.ntf"));
Expand Down Expand Up @@ -186,3 +188,4 @@ TEST(NitfReaderTest, issue3010)
}
FileUtils::deleteFile(filename);
}
**/
7 changes: 3 additions & 4 deletions scripts/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN . /opt/conda/etc/profile.d/conda.sh && \
mkdir -p pdal/build && \
cd pdal/build && \
cmake -G Ninja \
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_PLUGIN_CPD=ON \
-DBUILD_PLUGIN_PGPOINTCLOUD=ON \
-DBUILD_PLUGIN_NITF=ON \
Expand Down Expand Up @@ -59,13 +59,13 @@ RUN rm /opt/conda/envs/pdal/lib/*.a && \
rm -rf /opt/conda/envs/pdal/include/freetype2 && \
rm -rf /opt/conda/envs/pdal/include/informix && \
rm -rf /opt/conda/envs/pdal/include/fontconfig && \
rm -rf /opt/conda/envs/pdal/include/X11
rm -rf /opt/conda/envs/pdal/include/X11 && \
rm -rf /opt/conda/envs/pdal/lib/cmake

FROM ubuntu:bionic

ARG PDAL_CONDA=/opt/conda/envs/pdal


RUN apt-get update --fix-missing && \
apt-get install -y \
sudo && \
Expand All @@ -77,7 +77,6 @@ COPY --from=builder /lib/ /lib/
COPY --from=builder /${PDAL_CONDA}/lib/ /usr/lib/
COPY --from=builder /${PDAL_CONDA}/include/ /usr/include/
COPY --from=builder /${PDAL_CONDA}/share/ /usr/share/
COPY --from=builder /${PDAL_CONDA}/bin/pdal /usr/bin/pdal

ENV GDAL_DATA=/usr/share/gdal
ENV PDAL_DRIVER_PATH=/usr/lib
Expand Down
2 changes: 1 addition & 1 deletion test/unit/SpatialReferenceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ TEST(SpatialReferenceTest, readerOptions)

PointTable t;
r.prepare(t);
EXPECT_EQ(r.getSpatialReference(), SpatialReference("EPSG:26916"));
EXPECT_EQ(r.getSpatialReference(), "EPSG:26916");
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/StreamingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ TEST(Streaming, issue_2069)
{ return "filters.test"; }
private:
virtual void spatialReferenceChanged(const SpatialReference& srs)
{ EXPECT_EQ(srs, SpatialReference("EPSG:4326")); }
{ EXPECT_EQ(srs, "EPSG:4326"); }
virtual bool processOne(PointRef& point)
{ return true; }
};
Expand Down
2 changes: 1 addition & 1 deletion test/unit/apps/pcpipelineTestJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ TEST(json, issue_2159)
PointViewSet s = f.execute(t);
PointViewPtr v = *(s.begin());
SpatialReference srs = v->spatialReference();
EXPECT_EQ(srs, SpatialReference("EPSG:4326"));
EXPECT_EQ(srs, "EPSG:4326");
}

TEST(json, issue_2438)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/filters/TransformationFilterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ TEST_F(TransformationFilterTest, SrsReset)
PointViewSet viewSet = m_filter.execute(table);
PointViewPtr view = *viewSet.begin();

EXPECT_EQ(view->spatialReference(), SpatialReference("EPSG:3857"));
EXPECT_EQ(view->spatialReference(), "EPSG:3857");
}

TEST(TransformationMatrix, init_file_oneline)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/io/EptReaderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ TEST(EptReaderTest, bounds2dXform)
BOX2D b(515380, 4918360, 515390, 4918370);
SrsBounds eptBounds(b);
gdal::reprojectBounds(b, "EPSG:26912", "EPSG:4326");
SrsBounds boxBounds(b, SpatialReference("EPSG:4326"));
SrsBounds boxBounds(b, "EPSG:4326");

PointViewPtr v1;
PointViewPtr v2;
Expand Down
4 changes: 2 additions & 2 deletions test/unit/io/LasWriterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ TEST(LasWriterTest, srs)

LasTester tester;
SpatialReference srs = tester.srs(writer);
EXPECT_EQ(srs, SpatialReference("EPSG:26915"));
EXPECT_EQ(srs, "EPSG:26915");
}


Expand All @@ -114,7 +114,7 @@ TEST(LasWriterTest, srs2)

LasTester tester;
SpatialReference srs = tester.srs(writer);
EXPECT_EQ(srs, SpatialReference("EPSG:32615"));
EXPECT_EQ(srs, "EPSG:32615");
}


Expand Down
6 changes: 3 additions & 3 deletions tools/nitfwrap/NitfWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ bool NitfWrap::verifyLas(ILeStream& in, BOX3D& bounds, bool& compressed)
}
compressed = h.compressed();
bounds = h.getBounds();
gdal::reprojectBounds(bounds, h.srs(), SpatialReference("EPSG:4326"));
gdal::reprojectBounds(bounds, h.srs(), "EPSG:4326");
return true;
}

Expand Down Expand Up @@ -280,8 +280,8 @@ bool NitfWrap::verifyBpf(ILeStream& in, BOX3D& bounds)
bounds.maxz = d.m_max;
}
}
SpatialReference srs = SpatialReference::fromZone(h.m_coordId);
gdal::reprojectBounds(bounds, srs, SpatialReference("EPSG:4326"));
SpatialReference srs = SpatialReference::wgs84FromZone(h.m_coordId);
gdal::reprojectBounds(bounds, srs, "EPSG:4326");
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions vendor/gtest/src/gtest-port.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ size_t GetThreadCount() {
if (sysctl(mib, miblen, NULL, &size, NULL, 0)) {
return 0;
}
mib[5] = size / mib[4];
mib[5] = (int)size / mib[4];

// populate array of structs
struct kinfo_proc info[mib[5]];
Expand All @@ -207,11 +207,11 @@ size_t GetThreadCount() {

// exclude empty members
int nthreads = 0;
for (int i = 0; i < size / mib[4]; i++) {
for (int i = 0; i < static_cast<int>(size) / mib[4]; i++) {
if (info[i].p_tid != -1)
nthreads++;
}
return nthreads;
return static_cast<size_t>(nthreads);
}

#elif GTEST_OS_QNX
Expand Down

0 comments on commit 571a0ff

Please sign in to comment.