[pdal] Bug in readers.gdal?

Kristian Evers kreve at sdfe.dk
Mon Feb 8 07:06:28 PST 2016


I thought the same, but

C:\Temp\pdal_gdal_reader>pdal pipeline tif2las.xml
PDAL: Can't ferry dimension 'Z'. Dimension doesn't exist.

is what I get when I change the dimension option in the pipeline to Z=band-1.

And the help in the command line also suggests otherwise (not sure if the format is different in a pipeline file though):

C:\Temp\pdal_gdal_reader>pdal --options=filters.ferry
filters.ferry
--------------------------------------------------------------------------------
dimensions
    Dimensions to copy (<in>=<out>,...)

So band-1 would have to be the in-dimension and the out-dimension Z. Maybe the in and out dimensions have been mixed up internally?

Kristian

Fra: Andrew Bell [mailto:andrew.bell.ia at gmail.com]
Sendt: mandag 08. februar 2016 15:51
Til: Kristian Evers
Cc: pdal at lists.osgeo.org
Emne: Re: [pdal] Bug in readers.gdal?

It looks like the specification to the ferry filter is incorrect.  It should be Z=band-1, rather than the other way around.

Hope this helps.

On Mon, Feb 8, 2016 at 8:17 AM, Kristian Evers <kreve at sdfe.dk<mailto:kreve at sdfe.dk>> wrote:
Hi.

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?

Here’s the pipeline description:

C:\Temp\pdal_gdal_reader>cat tif2las.xml
<?xml version="1.0"?>
<Pipeline version="1.0">
    <Writer type="writers.las">
        <Option name="filename">
            out.las
        </Option>
        <Filter type="filters.ferry">
            <Option name="dimensions">
                band-1=Z
            </Option>
            <Reader type="readers.gdal">
                <Option name="filename">
                    dtm_1km_6172_717.tif
                </Option>
            </Reader>
        </Filter>
    </Writer>
</Pipeline>

And the the tif-file has the following info, tif2las.xml:

C:\Temp\pdal_gdal_reader>gdalinfo dtm_1km_6172_717.tif
Driver: GTiff/GeoTIFF
Files: dtm_1km_6172_717.tif
Size is 2500, 2500
Coordinate System is:
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"]]
Origin = (717000.000000000000000,6173000.000000000000000)
Pixel Size = (0.400000000000000,-0.400000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  717000.000, 6173000.000) ( 12d26'57.82"E, 55d39'15.45"N)
Lower Left  (  717000.000, 6172000.000) ( 12d26'54.98"E, 55d38'43.16"N)
Upper Right (  718000.000, 6173000.000) ( 12d27'54.93"E, 55d39'13.84"N)
Lower Right (  718000.000, 6172000.000) ( 12d27'52.07"E, 55d38'41.55"N)
Center      (  717500.000, 6172500.000) ( 12d27'24.95"E, 55d38'58.50"N)
Band 1 Block=256x256 Type=Float32, ColorInterp=Gray
  NoData Value=-9999


Running
C:\Temp\pdal_gdal_reader>pdal pipeline tif2las.xml

produces out.las that has Z=0 for all points:

C:\Temp\pdal_gdal_reader>pdal info --summary out.las
{
  "filename": "out.las",
  "pdal_version": "1.1.0 (git-version: 64ca76)",
  "summary":
  {
    "bounds":
    {
      "X":
      {
        "max": 717999.8,
        "min": 717000.2
      },
      "Y":
      {
        "max": 6172999.8,
        "min": 6172000.2
      },
      "Z":
      {
        "max": 0,
        "min": 0
      }
    },
    "dimensions": "X, Y, Z, Intensity, ReturnNumber, NumberOfReturns, ScanDirectionFlag, EdgeOfFlightLine, Classification, ScanAngleRank, UserData, PointSourceId, GpsTime, Red, Green, Blue",
    "num_points": 6250000,
    "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\"]]"
  }
}

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?
I am using PDAL version 1.1.0 (git-version: 64ca76) from OSGeo4W.

Another thing I’ve run into is that pdal crashes when trying to apply the same filter via the command line like this:

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

Probably a separate issue though.

Thanks in advance,

Kristian Evers
Geophysicist
Geographical references
kreve at gst.dk<mailto:kreve at gst.dk>

Danish Ministry of Energy, Utilities and Climate
Agency for Data Supply and Efficiency



_______________________________________________
pdal mailing list
pdal at lists.osgeo.org<mailto:pdal at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/pdal



--
Andrew Bell
andrew.bell.ia at gmail.com<mailto:andrew.bell.ia at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20160208/b188c73e/attachment-0001.html>


More information about the pdal mailing list