<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&#8217;ll see I have code that does exactly what you want &#8211; 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>&nbsp;</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&#8217;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>&nbsp;</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>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</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>&nbsp;</o:p></p><div><p class=MsoNormal>Hi Mike,<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp;<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>&nbsp;<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'>&nbsp;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 &lt;<a href="mailto:mpg@flaxen.com">mpg@flaxen.com</a>&gt; wrote:<o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Ping:<br><br>Grab these two updated DLLs:<br><br>&nbsp;<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>&nbsp;<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. &nbsp;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>&nbsp; &nbsp; &nbsp; &nbsp;private void Test1()<br>&nbsp; &nbsp; &nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(&quot;Starting LasWriter test1&quot;);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// create the reader<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Options readerOpts = new Options();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Option readerOpt1 = new Option();<br><br>readerOpt1.setValue_String(&quot;../../test/data/1.2-with-color.las&quot;);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;readerOpt1.setName(&quot;filename&quot;);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;readerOpts.add(readerOpt1);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LasReader reader = new LasReader(readerOpts);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Options writerOpts = new Options();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Option writerOpt1 = new Option();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;writerOpt1.setValue_String(&quot;foo.laz&quot;);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;writerOpt1.setName(&quot;filename&quot;);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;writerOpts.add(writerOpt1);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LasWriter writer = new LasWriter(reader, writerOpts);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;writer.initialize();<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;writer.setCompressed(true);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;writer.setDate(0, 0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;writer.setPointFormat(PointFormat.PointFormat3);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;writer.setSystemIdentifier(&quot;&quot;);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;writer.setGeneratingSoftware(&quot;TerraScan&quot;);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// how many points do we have?<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ulong numPoints = reader.getNumPoints();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug.Assert(numPoints == 1065);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ulong numWritten = writer.write(numPoints);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug.Assert(numWritten == 1065);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(&quot;checking output...&quot;);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Options opts = new Options();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Option opt = new Option();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;opt.setValue_String(&quot;foo.laz&quot;);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;opt.setName(&quot;filename&quot;);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;opts.add(opt);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LasReader reader = new LasReader(opts);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;reader.initialize();<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug.Assert(reader.isCompressed() == true);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ulong numPoints = reader.getNumPoints();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug.Assert(numPoints == 1065);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(&quot;done!&quot;);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return;<br>&nbsp; &nbsp; &nbsp; &nbsp;}<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>