<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">There's a ticket to improve PDAL's writers.gdal to support more options and output data types. That will make things work better, but the development hasn't happened quite yet.<div class=""><br class=""></div><div class="">Stick with outputting GeoTIFF for now and then do gdal_translate/gdalwarp as you need as Adam's describing.<br class=""><div class=""><br class=""></div><div class=""><a href="https://github.com/PDAL/PDAL/issues/1497" class="">https://github.com/PDAL/PDAL/issues/1497</a></div><div class=""><br class=""></div><div class="">Howard</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 30, 2017, at 11:28 PM, Adam Steer <<a href="mailto:Adam.Steer@anu.edu.au" class="">Adam.Steer@anu.edu.au</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi all<br class=""><br class="">finally got to some testing with this.<br class=""><br class="">Input: a LAS tile<br class="">Expected outputs: PNG files showing grayscale images of point attributes, gridded according to some input parameters about cell sizing<br class=""><br class="">I think what happens here is that PNG expects 3 bands, and I’m trying to make greyscale images. After a lot of trying GDAL options, I ended up just writing out a GeoTIFF and then using gdal_translate to carve out my PNGs, eg:<br class=""><br class="">{<br class=""> "pipeline": [<br class="">  “/path/to/tile.las",<br class=""> {<br class="">   "type": "filters.range",<br class="">   "limits": "Classification[2:2]"<br class=""> },<br class=""> {<br class="">   "type": "writers.gdal",<br class="">   "resolution": 2.0,<br class="">   "radius": 2.5,<br class="">   "gdaldriver":"GTiff",<br class="">   "filename": “tile.tif",<br class="">   "output_type": "mean,idw,count"<br class="">   }<br class="">   ]<br class=""> }<br class=""><br class="">…and then:<br class="">gdal_translate ./tile.tif mean_tile.png -b 1 -ot Byte -of png -scale<br class="">gdal_translate ./tile.tif idw_tile.png -b 2 -ot Byte -of png -scale<br class="">gdal_translate ./tile.tif count_tile.png -b 3 -ot Byte -of png -scale<br class=""><br class="">…which produced valid pngs which worked as expected - greyscale rasterised point data that a web browser could view.<br class=""><br class="">The nearest pipeline I could think of to generate a single writers.gdal ‘band’ as a PNG was:<br class=""><br class="">{<br class=""> "pipeline": [<br class="">  “/path/to/tile.las",<br class=""> {<br class="">   "type": "filters.range",<br class="">   "limits": "Classification[2:2]"<br class=""> },<br class=""> {<br class="">   "type": "writers.gdal",<br class="">   "resolution": 2.0,<br class="">   "radius": 2.5,<br class="">   "gdalopts":"ot=PNG",<br class="">   "gdalopts":"co=scale",<br class="">   "gdalopts":"ot=Byte",<br class="">   "gdalopts":"co=WRITE_METADATA_AS_TEXT=NO",<br class="">   "gdalopts":"co=b=1",<br class="">   "filename": “tile.png",<br class="">   "output_type": "idw"<br class="">   }<br class="">   ]<br class=""> }<br class=""><br class="">…but this made a really big PNG (2mb, as opposed to single band pngs using an intermediate geotiff at < 150k) which was not readable by anything on my MacOS machine.<br class=""><br class="">I’d happily take pipelne corrections! Lots of guessing there, and also lots of not knowing all the GDAL tricks!<br class=""><br class="">Anyway, at a pinch, going gtiff -> png is possible, maybe slower than the required purpose?<br class=""><br class="">HTH<br class=""><br class="">Adam<br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On 10 Jul 2017, at 10:21 pm, Vladimir Sandoval <<a href="mailto:vladimir.sandoval@yandex.com" class="">vladimir.sandoval@yandex.com</a>> wrote:<br class=""><br class="">Gents:<br class="">I've run it with "all" bands and get a nice, huge PNG (grayscale and it's not doing the resize), that I can open and view in Opticks but nothing else.<br class=""><br class="">On windoze, you can drag an image into Firefox, and it will display it. Firefox says it cannot display the image "because it contains errors".<br class=""><br class=""><br class=""><br class="">08.07.2017, 23:09, "Howard Butler" <<a href="mailto:howard@hobu.co" class="">howard@hobu.co</a>>:<br class=""><blockquote type="cite" class="">Vladimir,<br class=""><br class="">You need to be specific about what you mean by "cannot view the PNG with Firefox...".<br class=""><br class="">The output of writers.gdal with the configuration you've provided is a 2-band PNG. That's probably not what you are expecting. Presumably you will want a colorized PNG or something? In that case, write out only the idw band as a PNG, and then use a GDAL VRT plus a color interpretation to convert that to a PNG that would be viewable in a way you'd expect in Firefox.<br class=""><br class="">Hope this helps,<br class=""><br class="">Howard<br class=""><br class=""><br class=""> On Jul 7, 2017, at 9:17 PM, Adam Steer <<a href="mailto:Adam.Steer@anu.edu.au" class="">Adam.Steer@anu.edu.au</a>> wrote:<br class=""><br class=""> HI Vladimir - can you check whether a PNG with just one ‘band’ (ie ‘max’ OR ‘idw’ but not both) works?<br class=""><br class=""> That’s all I can think of… I actually need to test this as well :) Next week…<br class=""><br class=""> Cheers<br class=""><br class=""> Adam<br class=""><br class=""><br class=""> On 8 Jul 2017, at 3:18 am, Vladimir Sandoval <<a href="mailto:vladimir.sandoval@yandex.com" class="">vladimir.sandoval@yandex.com</a>> wrote:<br class=""><br class=""> Trying to make a PNG from a .laz file to display in Firefox.<br class=""><br class=""> {<br class="">  "pipeline":[<br class="">    "somefile.laz",<br class="">    {<br class="">     "type":"writers.gdal",<br class="">      "resolution": 1,<br class="">      "output_type":"idw",<br class="">      "output_type":"max",<br class="">       "gdalopts":"of=PNG,outsize=128 128",<br class="">       "gdalopts":"co=WRITE_METADATA_AS_TEXT=NO",<br class="">      "filename":"outputfile.png"<br class="">    }<br class="">  ]<br class=""> }<br class=""><br class=""> The pipeline runs and produces a PNG. I cannot view the PNG with Firefox, MS Paint, or Windows Photo Viewer, HOWEVER, I can open it and view it in Opticks (<a href="https://sourceforge.net/projects/opticks/" class="">https://sourceforge.net/projects/opticks/</a>).<br class=""><br class=""> Opticks shows a single band grey scale image, probably representative of the original .laz.<br class=""><br class=""> Anything I'm doing wrong here producing the "corrupted" PNG?<br class=""> _______________________________________________<br class=""> pdal mailing list<br class=""> <a href="mailto:pdal@lists.osgeo.org" class="">pdal@lists.osgeo.org</a><br class=""> <a href="https://lists.osgeo.org/mailman/listinfo/pdal" class="">https://lists.osgeo.org/mailman/listinfo/pdal</a><br class=""><br class=""> _______________________________________________<br class=""> pdal mailing list<br class=""> <a href="mailto:pdal@lists.osgeo.org" class="">pdal@lists.osgeo.org</a><br class=""> <a href="https://lists.osgeo.org/mailman/listinfo/pdal" class="">https://lists.osgeo.org/mailman/listinfo/pdal</a><br class=""><br class=""></blockquote></blockquote><br class=""></div></div></blockquote></div><br class=""></div></div></body></html>