擅长:python、mysql、java
<p>从gdal<a href="http://www.gdal.org/gdal_tutorial.html" rel="nofollow noreferrer">tutorial</a>“注意,返回的扫描线是string类型,包含xsize*4字节的原始二进制浮点数据。可以使用标准库中的struct模块将其转换为Python值:“</p>
<pre><code>import struct
tuple_of_floats = struct.unpack('f' * b2.XSize, scanline)
</code></pre>
<p>或者,根据您最终要对数据做什么,您可以将其作为数组读入(这为使用numpy进行计算打开了大门)。在</p>
^{pr2}$