大規模な点群データ(LiDAR/LAZ)をWebブラウザで表示しようとすると、メモリ不足でクラッシュしてしまうことがあります。本記事では、Potree のLOD(Level of Detail)技術を使って、数百万点の点群をストレスなく表示する方法を紹介します。

https://3dtiles-viewer.vercel.app/potree-lod-viewer.html

使用データ

課題

このデータをそのままThree.jsなどで読み込もうとすると、ブラウザがフリーズする可能性があります。

解決策:Potree

Potreeは、大規模点群データのためのWebGLベースのビューアです。**LOD(Level of Detail)**により、カメラに近い部分は詳細に、遠い部分は粗く表示することで、数十億点のデータでもスムーズに動作します。

仕組み

  1. 点群をオクトリー構造 で空間分割
  2. 各ノードに異なる詳細度のデータを格納
  3. 視点に応じて必要なノードのみ動的に読み込み

手順

1. LAZファイルのダウンロード

cur"lht-tLps://uotbajhe_ccta.pciltoould..lsadzsc\.edu/v1/AUTH_opentopography/www/education/MatlabTopo/Utah_state_capitol.laz"

2. LAZからPotree形式への変換

PotreeConverterをDockerで実行します。

#d#dooDccsPokkyoceentkrr$$tre((herprpp3euuwwdClndd/ol))pn:ovs-oteyrdurrnmatetttpeeh\aucr3tod\:n///dpoeaourttttarpe/euruettc\ao\hn_vcearptietrol.lazoutput/utah_capitol

出力結果 :

Ammsc3dAiapo4uBnxan8rB::cv1a:ie5t[[nr1i44gs2o22in45cop:82ano87li190cfn.,,uit8lns144ai9..tsws55ehe11der44de27f71rpeeor++mo00c66de,,isas11ge34od55n08aa..ln45:d27]]33.47881957132points(100%)werewrittentotheoutput.

変換後のサイズ : 54MB

生成されるファイル構造:

utah_csdcloaaoutpuraidc/rt.e/ojsls./jrrs..obhnirnc####

3. Potreeライブラリの準備

Potree 1.8をダウンロードして配置します。

#c#um#rrrunvmmmrhzltiP---tporrr-ptfffLspr:oejjjtesss/r_///ge1lllpie.iiiot-8bbbth1sssru.j///eb8sPPPe../ooo-czlttt1oii:rrr.mpbeee8s1eee.p/2___zo1111itM...prB888e///\eped/oxop6iaco4nmstMtprBcleleeos/urdesleases/download/1.8/Potree_1.8.zip

4. ビューアHTMLの作成

<<<<!hh/b//Dte<<<<<<<<<<<<<<<<<<<<ho<<bhOmamt!sssssssssss!lllls/edds/otCldei-ccccccccccc-iiiith#sayiccvvvvccP}sdmT>tt-rrrrrrrrrrr-nnnnytptd>vroiiiiooo)cylYlaliiiiiiiiiiikkkklmoy>ineeeenntcpppvv;r>>PaePpppppppppppPeltlipswwwwUssrooooiiiEnc>otttttttttttorrrr>,redtteeeeRtteniiieepghPtteeeee>=>rrrrLesnnnwwth=aorsssssssssssrllllbe"v....pd.ttttee>t"rierrrrrrrrrrre====o_pissssaalcccrrmjsneccccccccccce""""dcoeeeeertoplll..laet===========ssssyotwttttaaaoooosf>"td"""""""""""CttttnreEFPBmPdiuuuci>=CejjjjjjjjjjjSyyyy{terDOoasaPndddet"lpsssssssssssSllllaeLVictot...nTUoe///////////eeeewi_=E(nk=hicmmmeoTunlllllllllllssssincn6tgnlaaa.SFddiiiiiiiiiiihhhhdeona0Brn=totttac-ebbbbbbbbbbbeeeetrneb)uoeCueeedr8Vnssssssssssseeeehtwl;duwpldrrrde"ic///////////tttt:{aegnaoiiiPe>eiPPPPPPPPPPP""""iPdedUru=aaaonweooooooooooo1pno(t(Radllli(esttttttttttthhhh0oett("Lm(e...n)rrrrrrrrrrrrrrrr0srrr3gSsd.spst;eeeeeeeeeeeeeee%i"eu_re.apiohC(eeeeeeeeeeeffff;t>ee0aagtozialP___________====i<.)0dreaienpoo11111111111""""ho/V;0ictPnteut...........jjjjendi_eh(at=Sdr88888888888ssssi:ie0nP'tci=(e///////////////gvw0tadhl1zpellllllllllbllllha>e0"ra,o;ePo)iiiiiiiiiiuiiiitbr))atuToi<bbbbbbbbbbibbbb:s(;;ma"dytn/sssssssssslssssods'p;prtt/////////d////1lo()oeecijsjttdpij/PPPP0ucwieltqpqhtw3r1spoooo0tuin=.olueurhe/o8totttt%emntPueeceeeedjnrtrrrr;;edcPod>rtrern34eereeeeno'loi)yry.//./xeeeeeemwtwfotn;/u-jBtjpte____ai.E.iurtjmusiwsrj/1111rdgylldeSq/ine"isp....gteeoe"ehusbae>j1to8888iht-cs,.aepjurn<48rt////n:EDa/Ppreqiy./.nerlllb:lotufoeyculHmsjeeeiiiu1emitui.-tedeicsx.ebbbi00meoannC3rr/anr"tj.sssl;0enhctI.uytp.i>.sj///d%nL._tSR1m-h.jp<j"ssjj/;tisciiC..urjst/s>"pqspvBgeaozL1jies">s"<>eutoehyhapneE.s.e">c>/<certreItri(T;m"m.><r<s/trerfidicteyi>im<i/csryeelg(nho)pn<nispsrcu-/eoh"g)le./.nsctcirmut/wtp;/{.jsj.cr>rpi/ihp::ocAscsjriitps/eotlD"r"sipp>tpjmth1roA>i>"ptt>eqeri0euP<p<>t>>cused0edT/t/<>te/ed%_.Is>s/rrm.e;cjVccsuyicnosErrcm-xs;}n';iir.uest;ppicid"}attps./>i>>tsmsn>"ite>nyr.l"ce)s.)sc;"s>s">

5. デプロイ

GitHubにpushしてVercel/GitHub Pagesで公開します。

gggiiitttacpdoudmsmhdiotocrs-i/mgpio"ntArdmedaei-Pnlootdr-eveieLwOeDr.photimnltdcolcosu/djs/ileiwbesr/PwoittrheeU_t1a.h8Cdaopcist/oflildeast/au"tah_capitol

結果

デモURL : https://3dtiles-viewer.vercel.app/potree-lod-viewer.html?data=files/utah_capitol/cloud.js

項目
データ出典OpenTopography
LAZサイズ15MB
変換後サイズ54MB
総点数3,481,512
Point Budget3,000,000
動作スムーズ

カメラをズームすると、自動的に詳細なノードが読み込まれます。

パフォーマンスのポイント

  1. Point Budget : viewer.setPointBudget(3_000_000) で一度に描画する点数を制限
  2. Adaptive Point Size : 距離に応じてポイントサイズを自動調整
  3. EDL (Eye-Dome Lighting) : 深度感を強調して視認性向上

IIIF Presentation API 3.0 との統合

点群データにメタデータ(タイトル、出典、ライセンスなど)を付与するため、IIIF Presentation API 3.0を活用します。

IIIFマニフェストの作成

{}"]"""}"}"]""}"]"]@,itl,s,m,rr,p,ic"{}dya""u""e{}{}{}ie""r{}t{}oh"pbejmejt,,gqlvoent""":eenamnaa""""""huaav""""]m"""]ttpcp"l""a""dlvlvlvtibliitlhsitiepolo":"::r::aaaaaaasreuddyao{}"dyt{}x:toih:ytblblbl"elee"pbm:"pet/runt"[["[[aeueueu:d""r:eee""":em"""]"/edttM{"":"""leleleS::""lpitf["siti:ieUCpaUL:"""""""t:":"adyo":"dyt{}i"rosnt{i::::::ha{{h:g"prh:"pe[i:lu:iaD[tt[t"e:emt":em""""}"f"n/fhA{{{{{{te""tA{""atS["sitmb,t.":t/eRpmeepg:":tpc":"dyoo"""""aih"esS""""""sennse"h"seh:"ptditfcprot":xtt"peeeeee:n"":ne[t"::nt":eiydyolog/tpa"a]oLnnnnnn/t::/tntT/etA["v""proieapo"m,tii""""""/"/""pe"/"pn":a::emuntpstppenD::::::c:[[o,:sxte,snht"adt"i:roltAr""p:tex:t"i{":tUC://eteCR[[[[[[e{ADe[/"xattAoh"rop/er.ac""""""atan"/,tm/apnnt":lu"rp:ecplFPP3LSttttOo/petsn"tM"nheoceoioooo,oairaopphlxi::po":ttstl:mturti4clvipeeteaotsda"terop/odmrn8atebponnm.mn/a":ep":pneuoil"aet1tcurgTtlcpPetp/lphstedii"o]te,iLotoroo"olaxia/"lt3:a.Uni]f"C5oamivappmegaoie,it4/tgrtf,]1o1nkmoipoo/.emnnxcp8/iilC/t.u2"eondhggic"p"taas1eot"ouh}7n"]n"eyrrio,l,imt:5xnh,ute,"t]Cs]d.aaimenpi1a/una]"}i.oppf/.gl/2m3bthU]},to}brhh/ic"enep/."_t}yr,ygyyuio,./xlcica},g/".timcjaeooah,/O"]oaf/osm.n/pUlp,rh/imopctniStie}g_ui/nloesttacn,/ctif"emx#oaheT"aafi,./t"lt,no,ph/lci.,/espi_ueoijmUeotctsmisaCSsgoaa//fonaA/rlphuf/nip"ba/i_tiu"fi]ypmtcalt,et/haoaheaso}4ynlp_shtl."i/ic/_.0]fmtaucjb/eaoptasu"}snliapoi,ti/thinl.fmo_t"djealco,issn/alnoticp/gn.flim"/jeota]sssuon,cotdlien../fn/jjceeassls/no"ot1nn,u."o/dj,ta.sanjotnsnio"/ot,snac-tepinaoegn/e/1/1"1"",,

マニフェストの主要プロパティ

プロパティ説明
labelタイトル(多言語対応)
summary説明文
metadata形式、点数、位置などのメタデータ
rightsライセンスURL
requiredStatement必須の帰属表示
providerデータ提供者情報
items[].body.cloudUrlPotree cloud.jsへのURL

ビューアでのマニフェスト読み込み

cfoent..}sctt)thhhcdi}cl;(eeoofoommnnnccdnaaa((su(oosdnnrmtmmnc`tPUiieaeasu<oRffsntnntmaciLeeiitielnss=ft.flnhottt>elgeitrUuCUUseesc.eRdlrrrtttegfLUolle=E.ne=ru)s=lrst"ld=.>meieE$(jamgNl{=c's{nehaemliointmmamoinftseenaui(eB)nindf)sy=tfiU/)tI{Befru.dmyseltl(aIts)aa'nd.t;hbti(r._eif'iicltelgta?lsihep.etctmij'.essta)rn}[o?.is"0l.tge>]/[eh'$.m0xt){ia]ts.ltnC.iieiincmfnnnesetcen[smelrs0tanuHe].ntdTN.jieMaisf=sLmtoe(eenst'=}m'tib<s;.ty/[ll/a0ae4>]b;.`.e0;bl'o?)d.ye?.nc?'l.Co[Cu0d]BU;Yrl4;.0':'License';

使用方法

#p#poottrreeee--lloodd--vviieewweerr..hhttmmll??mdaantiaf=efsitl=eisi/iuft/auht_acha_pciatpoilt/ocll/omuadn.ijfsest.json

IIIFを使うメリット

  1. 標準化されたメタデータ形式 - 他のIIIF対応ツールとの互換性
  2. 多言語対応 - labelsummaryで複数言語をサポート
  3. ライセンス・帰属の明示 - rightsrequiredStatementで法的情報を提供
  4. データ提供者情報 - providerでデータの出典を明確化
  5. 拡張性 - カスタムコンテキストでPotree固有のプロパティを追加可能

まとめ

  • 大規模点群の表示にはLOD が必須
  • PotreeConverter (Docker)で簡単に変換可能
  • Potree 1.8 で数百万点以上もスムーズに表示
  • IIIF Presentation API 3.0 でメタデータを標準化
  • 追加データは ?manifest=path/to/manifest.json で読み込み可能

参考リンク