<div dir="ltr">It looks like the specification to the ferry filter is incorrect.  It should be Z=band-1, rather than the other way around.<div><br></div><div>Hope this helps.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 8, 2016 at 8:17 AM, Kristian Evers <span dir="ltr"><<a href="mailto:kreve@sdfe.dk" target="_blank">kreve@sdfe.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Hi.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am  trying to map a tif-file to a las-file. So far I have had no luck with it and I suspect there’s a bug in the gdal-reader somewhere. I’m using a pipeline xml with filters.ferry to map the first band of the tif-file as the Z-value in
 the output las-file. After running the pipeline I get a las-file where all Z-values are zero. Am I correct in assuming that this is unexpected behavior?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Here’s the pipeline description:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">C:\Temp\pdal_gdal_reader>cat tif2las.xml<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas"><?xml version="1.0"?><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas"><Pipeline version="1.0"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    <Writer type="writers.las"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        <Option name="filename"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">            out.las<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        </Option><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        <Filter type="filters.ferry"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">            <Option name="dimensions"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">                band-1=Z<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">            </Option><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">            <Reader type="readers.gdal"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">                <Option name="filename"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">                    dtm_1km_6172_717.tif<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">                </Option><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">            </Reader><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        </Filter><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    </Writer><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas"></Pipeline></span><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">And the the tif-file has the following info, tif2las.xml:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">C:\Temp\pdal_gdal_reader>gdalinfo dtm_1km_6172_717.tif<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Driver: GTiff/GeoTIFF<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Files: dtm_1km_6172_717.tif<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Size is 2500, 2500<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Coordinate System is:<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">PROJCS["ETRS89 / UTM zone 32N",<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    GEOGCS["ETRS89",<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        DATUM["European_Terrestrial_Reference_System_1989",<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">            SPHEROID["GRS 1980",6378137,298.2572221010002,<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">                AUTHORITY["EPSG","7019"]],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">            TOWGS84[0,0,0,0,0,0,0],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">            AUTHORITY["EPSG","6258"]],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        PRIMEM["Greenwich",0],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        UNIT["degree",0.0174532925199433],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        AUTHORITY["EPSG","4258"]],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    PROJECTION["Transverse_Mercator"],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    PARAMETER["latitude_of_origin",0],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    PARAMETER["central_meridian",9],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    PARAMETER["scale_factor",0.9996],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    PARAMETER["false_easting",500000],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    PARAMETER["false_northing",0],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    UNIT["metre",1,<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        AUTHORITY["EPSG","9001"]],<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    AUTHORITY["EPSG","25832"]]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Origin = (717000.000000000000000,6173000.000000000000000)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Pixel Size = (0.400000000000000,-0.400000000000000)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Metadata:<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">  AREA_OR_POINT=Area<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Image Structure Metadata:<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">  COMPRESSION=DEFLATE<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">  INTERLEAVE=BAND<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Corner Coordinates:<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Upper Left  (  717000.000, 6173000.000) ( 12d26'57.82"E, 55d39'15.45"N)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Lower Left  (  717000.000, 6172000.000) ( 12d26'54.98"E, 55d38'43.16"N)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Upper Right (  718000.000, 6173000.000) ( 12d27'54.93"E, 55d39'13.84"N)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Lower Right (  718000.000, 6172000.000) ( 12d27'52.07"E, 55d38'41.55"N)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span lang="DA" style="font-size:9.0pt;font-family:Consolas">Center      (  717500.000, 6172500.000) ( 12d27'24.95"E, 55d38'58.50"N)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">Band 1 Block=256x256 Type=Float32, ColorInterp=Gray<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">  NoData Value=-9999<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Running<u></u><u></u></p>
<p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">C:\Temp\pdal_gdal_reader>pdal pipeline tif2las.xml<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">produces out.las that has Z=0 for all points:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">C:\Temp\pdal_gdal_reader>pdal info --summary out.las<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">{<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">  "filename": "out.las",<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">  "pdal_version": "1.1.0 (git-version: 64ca76)",<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">  "summary":<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">  {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    "bounds":<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">      "X":<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">      {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        "max": 717999.8,<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        "min": 717000.2<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">      },<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">      "Y":<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">      {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        "max": 6172999.8,<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        "min": 6172000.2<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">      },<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">      "Z":<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">      {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        "max": 0,<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">        "min": 0<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">      }<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    },<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    "dimensions": "X, Y, Z, Intensity, ReturnNumber, NumberOfReturns, ScanDirectionFlag, EdgeOfFlightLine, Classification, ScanAngleRank, UserData, PointSourceId,
 GpsTime, Red, Green, Blue",<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    "num_points": 6250000,<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">    "spatial_reference": "PROJCS[\"ETRS89 / UTM zone 32N\",GEOGCS[\"ETRS89\",DATUM[\"European_Terrestrial_Reference_System_1989\",SPHEROID[\"GRS 1980\",6378137,298.2572221010002,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4258\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AUTHORITY[\"EPSG\",\"25832\"]]"<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">  }<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:9.0pt;font-family:Consolas">}<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal">It seems like the band-1 dimension is not read properly in this case. Is this in fact a bug, or am I creating my pipeline incorrectly?<u></u><u></u></p>
<p class="MsoNormal">I am using PDAL version 1.1.0 (git-version: 64ca76) from OSGeo4W.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Another thing I’ve run into is that pdal crashes when trying to apply the same filter via the command line like this:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas">C:\Temp\pdal_gdal_reader>pdal translate -f ferry --filters.ferry.dimensions=band-1=Z -r readers.gdal -w writers.las -i dtm_1km_6172_717.tif -o out.las<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal">Probably a separate issue though. <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks in advance,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:8.0pt;font-family:"Tahoma","sans-serif";color:#004080">Kristian Evers</span></b><span style="font-size:8.0pt;font-family:"Tahoma","sans-serif";color:#004080">
<br>
Geophysicist</span><span style="font-size:8.0pt"> </span><span style="font-size:8.0pt;font-family:"Tahoma","sans-serif";color:#004080"><br>
Geographical references</span><span style="font-size:8.0pt"> <u><span style="color:blue"><br>
</span></u></span><a href="mailto:kreve@gst.dk" target="_blank"><span style="font-size:8.0pt;font-family:"Tahoma","sans-serif";color:blue">kreve@gst.dk</span></a><span style="font-size:8.0pt;font-family:"Tahoma","sans-serif";color:#004080"><br>
<br>
Danish Ministry of Energy, Utilities and Climate<br>
Agency for Data Supply and Efficiency</span><span style="font-size:8.0pt;color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

<br>_______________________________________________<br>
pdal mailing list<br>
<a href="mailto:pdal@lists.osgeo.org">pdal@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pdal" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pdal</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Andrew Bell<br><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></div>
</div>