<div>Hi Mike,</div>
<div> </div>
<div>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:</div>
<div> </div>
<div><font color="#008000" face="Consolas"><font color="#008000" face="Consolas">Schema schema = reader.getSchema();</font></font></div>
<p>SchemaLayout layout = new SchemaLayout(schema);</p>
<p>PointBuffer data = new PointBuffer(layout, 128);</p><font face="Consolas"></font><font color="#008000" face="Consolas"><font color="#008000" face="Consolas">
<p>// get the dimensions (fields) of the point record for the X, Y, and Z values</p>
<p>int offsetX = schema.getDimensionIndex(Dimension.Field.Field_X, Dimension.DataType.Int32);</p>
<p>int offsetY = schema.getDimensionIndex(Dimension.Field.Field_Y, Dimension.DataType.Int32);</p>
<p>int offsetZ = schema.getDimensionIndex(Dimension.Field.Field_Z, Dimension.DataType.Int32);</p>
<p>Dimension dimensionX = schema.getDimension((uint)offsetX);</p>
<p>Dimension dimensionY = schema.getDimension((uint)offsetY);</p>
<p>Dimension dimensionZ = schema.getDimension((uint)offsetZ);</p></font></font>
<div><br>You were using the Dimension, would you please let me know how can I get the X,Y,Z value of each point?</div>
<div>Is there a LasPoint structure in the PDAL?</div>
<div> Is the PointBuffer can be used for loading all the points into memory at one time?<br><br><br></div>
<div class="gmail_quote">On Thu, Sep 8, 2011 at 5:28 PM, Michael P. Gerlek <span dir="ltr"><<a href="mailto:mpg@flaxen.com">mpg@flaxen.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">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> }<br><br></blockquote></div><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><br>