Pythonで点群を読んでみよう

 Pythonで点群を読んでみよう

OSC 2020 Aizu LT大会資料

Taro Matsuzawa aka. btm

October 25, 2020

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

28 slides
  1. こんな感じのコードになります 先頭を読む import struct f = open(‘your.las’, ‘rb’) file_signature =

    b"".join(list(struct.unpack('4c', f.read(1*4)))).decode(‘ascii') print(file_signature) f.close() # 閉じておく
  2. こんな感じのコードになります File Source IDを読む import struct f = open(‘your.las’, ‘rb’)

    file_signature = b"".join(list(struct.unpack('4c', f.read(1*4)))).decode(‘ascii') (file_source_id,) = struct.unpack(‘H’, f.read(2)) print(file_source_id) f.close() # 閉じておく tupleで返ってくるので注意
  3. こんな感じになる def header(self, f): file_signature = b"".join(list(struct.unpack('4c', f.read(1*4)))).decode('ascii') (file_source_id,) =

    struct.unpack('H', f.read(2)) (global_encoding,) = struct.unpack('H', f.read(2)) (guid_data1,) = struct.unpack('<L', f.read(4)) (guid_data2,) = struct.unpack('H', f.read(2)) (guid_data3,) = struct.unpack('H', f.read(2)) guid_data4 = struct.unpack('<8B', f.read(1*8)) …
  4. LASのversion minorによってヘッダの大きさが変わる LAS 1.2 -> 227byte LAS 1.3 -> 235byte

    LAS 1.4 -> 375byte 必ずversion checkを入れること 読む上で注意点
  5. コロナのせいでオンラインへ 開催日を調整して、State of the Map Japan 2020 と FOSS4G 2020

    JAPAN Online を 2020年11月7日、8日の2日連続で開催 今年のイベント
  6. 2020೥11݄7೔ 2020೥11݄8೔ ޕલ FOSS4G JP 2020 Online νϡʔτϦΞϧσΠ ޕޙ State

    of the Map FOSS4G JP 2020 Online ίΞσΠ ໷ ࠙਌ձ λΠϜεέδϡʔϧ
  7. State of the Map Japan 2020 https://stateofthemap.jp/2020/ FOSS4G 2020 Japan

    Online https://www.osgeo.jp/events/foss4g-2020/foss4g-2020-japan-online 参加者募集

More Decks by Taro Matsuzawa aka. btm

Other Decks in Programming