<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p class="western" style="margin-bottom: 0cm; line-height: 100%">Hy,</p>
<p class="western" style="margin-bottom: 0cm; line-height: 100%">I
want to transform the points of multiple LAS files from cartesian
coordinates to polar coordinates. The transformation is done with
numpy in a two-dimensional <i>numpy.ndarray</i>. </p>
<p class="western" style="margin-bottom: 0cm; line-height: 100%">But
how do I get a 2D numpy.ndarray from the data of the PDAL pipeline
(in the PDAL Python example the <i>pipeline.arrays</i> )? From
the PDAL Python example I changed the JSON expression:</p>
<tt> </tt>
<p class="western" style="margin-bottom: 0cm; line-height: 100%"><tt><font
style="font-size: 10pt" size="2">pipe_reader = """<br>
{<br>
"pipeline":[<br>
{<br>
"type":"readers.las",<br>
"filename":"%s"<br>
}<br>
]<br>
}<br>
}"""%lasinput</font></tt></p>
<p class="western" style="margin-bottom: 0cm; line-height: 100%"><i>pipeline.arrays</i>
does not return an array, but a <i>list</i> containing a
one-dimensional <i>numpy.ndarray</i>. Each row of this array is a
<i>numpy.void</i> with the values of a point. My current solution
is a listcomprehension:</p>
<p class="western" style="margin-bottom: 0cm; line-height: 100%"><tt><font
style="font-size: 10pt" size="2">arr_voids = arrays[0]<br>
points = np.array([list(i) for i in arr_voids], dtype=
arr_voids.dtype)<br>
<br>
</font></tt></p>
This way is too slow, too memory intensive and not a
"numpyical-way". But how do I get there with numpy or pdal? Perhaps
I‘ve already chosen the wrong approach?<br>
<br>
Thanks!<br>
Lothar<br>
</body>
</html>