<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>If you look at the example code (TestLasReader.cs) off the latest git, you’ll see I have code that does exactly what you want – it extracts out the X,Y,Z fields and then (un)scales them appropriately.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>[Note too that the latest version of pdal doesn’t use SchemaLayouts anymore.]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>-mpg<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> ping yang [mailto:pingyang.whu@gmail.com] <br><b>Sent:</b> Tuesday, October 04, 2011 7:53 PM<br><b>To:</b> mpg@flaxen.com<br><b>Cc:</b> pdal@lists.osgeo.org<br><b>Subject:</b> Re: [pdal] Write and zip function based on PDAL<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi Mike,<o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal>I have some questions on how to get the X,Y,Z value from the PDAL, I saw last time you sent me code like this:<o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:Consolas;color:green'>Schema schema = reader.getSchema();</span><o:p></o:p></p></div><p>SchemaLayout layout = new SchemaLayout(schema);<o:p></o:p></p><p>PointBuffer data = new PointBuffer(layout, 128);<o:p></o:p></p><p><span style='font-family:Consolas;color:green'>// get the dimensions (fields) of the point record for the X, Y, and Z values<o:p></o:p></span></p><p><span style='font-family:Consolas;color:green'>int offsetX = schema.getDimensionIndex(Dimension.Field.Field_X, Dimension.DataType.Int32);<o:p></o:p></span></p><p><span style='font-family:Consolas;color:green'>int offsetY = schema.getDimensionIndex(Dimension.Field.Field_Y, Dimension.DataType.Int32);<o:p></o:p></span></p><p><span style='font-family:Consolas;color:green'>int offsetZ = schema.getDimensionIndex(Dimension.Field.Field_Z, Dimension.DataType.Int32);<o:p></o:p></span></p><p><span style='font-family:Consolas;color:green'>Dimension dimensionX = schema.getDimension((uint)offsetX);<o:p></o:p></span></p><p><span style='font-family:Consolas;color:green'>Dimension dimensionY = schema.getDimension((uint)offsetY);<o:p></o:p></span></p><p><span style='font-family:Consolas;color:green'>Dimension dimensionZ = schema.getDimension((uint)offsetZ);<o:p></o:p></span></p><div><p class=MsoNormal><br>You were using the Dimension, would you please let me know how can I get the X,Y,Z value of each point?<o:p></o:p></p></div><div><p class=MsoNormal>Is there a LasPoint structure in the PDAL?<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'> Is the PointBuffer can be used for loading all the points into memory at one time?<br><br><o:p></o:p></p></div><div><p class=MsoNormal>On Thu, Sep 8, 2011 at 5:28 PM, Michael P. Gerlek <<a href="mailto:mpg@flaxen.com">mpg@flaxen.com</a>> wrote:<o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Ping:<br><br>Grab these two updated DLLs:<br><br> <a href="http://dl.dropbox.com/u/17690616/pdal_swig_cpp.dll" target="_blank">http://dl.dropbox.com/u/17690616/pdal_swig_cpp.dll</a><br> <a href="http://dl.dropbox.com/u/17690616/pdal_swig_cs.dll" target="_blank">http://dl.dropbox.com/u/17690616/pdal_swig_cs.dll</a><br><br>and then the below program should work fine. If you need a more complex<br>workflow, just let us know and we'll talk you through it.<br><br>-mpg<br><br><br><br><br><br><br> private void Test1()<br> {<br> Console.WriteLine("Starting LasWriter test1");<br><br> {<br> // create the reader<br> Options readerOpts = new Options();<br> Option readerOpt1 = new Option();<br><br>readerOpt1.setValue_String("../../test/data/1.2-with-color.las");<br> readerOpt1.setName("filename");<br><br> readerOpts.add(readerOpt1);<br> LasReader reader = new LasReader(readerOpts);<br><br> Options writerOpts = new Options();<br> Option writerOpt1 = new Option();<br> writerOpt1.setValue_String("foo.laz");<br> writerOpt1.setName("filename");<br> writerOpts.add(writerOpt1);<br> LasWriter writer = new LasWriter(reader, writerOpts);<br> writer.initialize();<br><br> writer.setCompressed(true);<br> writer.setDate(0, 0);<br> writer.setPointFormat(PointFormat.PointFormat3);<br> writer.setSystemIdentifier("");<br> writer.setGeneratingSoftware("TerraScan");<br><br> // how many points do we have?<br> ulong numPoints = reader.getNumPoints();<br> Debug.Assert(numPoints == 1065);<br><br> ulong numWritten = writer.write(numPoints);<br> Debug.Assert(numWritten == 1065);<br> }<br><br> Console.WriteLine("checking output...");<br><br> {<br> Options opts = new Options();<br> Option opt = new Option();<br> opt.setValue_String("foo.laz");<br> opt.setName("filename");<br> opts.add(opt);<br><br> LasReader reader = new LasReader(opts);<br> reader.initialize();<br><br> Debug.Assert(reader.isCompressed() == true);<br><br> ulong numPoints = reader.getNumPoints();<br> Debug.Assert(numPoints == 1065);<br> }<br><br> Console.WriteLine("done!");<br><br> return;<br> }<o:p></o:p></p></div><p class=MsoNormal><br><br clear=all><br>-- <br>Ping Yang, Ph.D.<br>Postdoctoral Research Associate<br>Idaho State University-Idaho Falls<br><a href="mailto:yangping@isu.edu" target="_blank">yangping@isu.edu</a><o:p></o:p></p></div></div></body></html>