[pdal] pdal tindex error with las files w/o spatial reference

Stefan Ziegler stefan.ziegler.de at gmail.com
Tue Aug 11 12:38:56 PDT 2015


Hi

when creating a tileindex for las files pdal gdal complains about not
finding an appropriate proj4 string for an empty srs:

PDAL: GDAL Failure number =6: No translation for an empty SRS to PROJ.4
format is known.

Find attached an attempt of a patch. As far as I understand the --a_srs was
not considered.

best regards
Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20150811/607ed390/attachment-0001.html>
-------------- next part --------------
diff --git a/kernels/tindex/TIndexKernel.cpp b/kernels/tindex/TIndexKernel.cpp
index 6639322..74953c3 100644
--- a/kernels/tindex/TIndexKernel.cpp
+++ b/kernels/tindex/TIndexKernel.cpp
@@ -484,7 +484,6 @@ bool TIndexKernel::createFeature(const FieldIndexes& indexes,
             "reference '" << fileInfo.m_srs << "' for file '" <<
             fileInfo.m_filename << "'" << std::endl;
     }
-
     // We have a limit of like 254 characters in some formats (notably
     // shapefile), so try to get the condensed version of the SRS.
 
@@ -554,6 +553,9 @@ TIndexKernel::FileInfo TIndexKernel::getFileInfo(KernelFactory& factory,
         polygon << "))";
         fileInfo.m_boundary = polygon.str();
         fileInfo.m_srs = qi.m_srs.getWKT();
+        if (fileInfo.m_srs.empty()) {
+            fileInfo.m_srs = m_assignSrsString;
+        }
     }
     else
     {
@@ -577,6 +579,9 @@ TIndexKernel::FileInfo TIndexKernel::getFileInfo(KernelFactory& factory,
         fileInfo.m_boundary =
             table.metadata().findChild("filters.hexbin:boundary").value();
         fileInfo.m_srs = table.spatialRef().getWKT();
+        if (fileInfo.m_srs.empty()) {
+            fileInfo.m_srs = m_assignSrsString;
+        }
     }
 
     FileUtils::fileTimes(filename, &fileInfo.m_ctime, &fileInfo.m_mtime);


More information about the pdal mailing list