def create_potree_page(work_dir, server_url, tablename, column):
'''Create an html demo page with potree viewer
'''
# get potree build
potree = os.path.join(work_dir, 'potree')
potreezip = os.path.join(work_dir, 'potree.zip')
if not os.path.exists(potree):
download('Getting potree code', 'http://3d.oslandia.com/potree.zip', potreezip)
# unzipping content
with ZipFile(potreezip) as myzip:
myzip.extractall(path=work_dir)
tablewschema = tablename.split('.')[-1]
sample_page = os.path.join(work_dir, 'potree-{}.html'.format(tablewschema))
abs_sample_page = str(Path(sample_page).absolute())
pending('Creating a potree demo page : file://{}'.format(abs_sample_page))
resource = '{}.{}'.format(tablename, column)
server_url = server_url.replace('http://', '')
with io.open(sample_page, 'wb') as html:
html.write(potree_page.format(resource=resource, server_url=server_url).encode())
ok()
评论列表
文章目录