Add initial COPC and LAS 1.4 support.

This commit is contained in:
Connor Manning 2023-11-29 12:02:07 -06:00
parent 6ab926f3b0
commit f7ac011bed
39 changed files with 20349 additions and 1657 deletions

View File

@ -1,20 +0,0 @@
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+l",
"command": "editor.action.deleteLines",
"when": "editorTextFocus && !editorReadonly"
},{
"key": "ctrl+shift+i",
"command": "editor.action.toggleRenderWhitespace"
},{
"key": "ctrl+d",
"command": "editor.action.copyLinesDownAction"
},{
"key": "alt+2",
"command": "type",
"args": {
"text": "`"
}
}
]

22
.vscode/settings.json vendored
View File

@ -1,22 +0,0 @@
{
"workbench.editor.enablePreview": false,
"files.associations": {
"*.vs": "cpp",
"*.fs": "cpp"
},
"files.trimTrailingWhitespace": false,
"editor.fontSize": 28,
"editor.autoIndent": "advanced",
"editor.detectIndentation": false,
"editor.insertSpaces": false,
"editor.minimap.enabled": false,
"editor.autoClosingBrackets": "never",
"editor.formatOnType": false,
"editor.acceptSuggestionOnEnter": "off",
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.mouseWheelZoom": true,
"editor.renderWhitespace": "all",
"workbench.tree.indent": 30,
"editor.autoClosingQuotes": "never",
"editor.autoSurround": "never",
}

88
examples/copc.html Normal file
View File

@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Potree Viewer</title>
<link rel="stylesheet" type="text/css" href="../build/potree/potree.css">
<link rel="stylesheet" type="text/css" href="../libs/jquery-ui/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="../libs/openlayers3/ol.css">
<link rel="stylesheet" type="text/css" href="../libs/spectrum/spectrum.css">
<link rel="stylesheet" type="text/css" href="../libs/jstree/themes/mixed/style.css">
</head>
<body>
<script src="../libs/jquery/jquery-3.1.1.min.js"></script>
<script src="../libs/spectrum/spectrum.js"></script>
<script src="../libs/jquery-ui/jquery-ui.min.js"></script>
<script src="../libs/other/BinaryHeap.js"></script>
<script src="../libs/tween/tween.min.js"></script>
<script src="../libs/d3/d3.js"></script>
<script src="../libs/proj4/proj4.js"></script>
<script src="../libs/openlayers3/ol.js"></script>
<script src="../libs/i18next/i18next.js"></script>
<script src="../libs/jstree/jstree.js"></script>
<script src="../libs/copc/index.js"></script>
<script src="../build/potree/potree.js"></script>
<script src="../libs/plasio/js/laslaz.js"></script>
<!-- INCLUDE ADDITIONAL DEPENDENCIES HERE -->
<!-- INCLUDE SETTINGS HERE -->
<div class="potree_container" style="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; ">
<div id="potree_render_area" style="background-image: url('../build/potree/resources/images/background.jpg');"></div>
<div id="potree_sidebar_container"> </div>
</div>
<script type="module">
import * as THREE from "../libs/three.js/build/three.module.js";
window.viewer = new Potree.Viewer(document.getElementById("potree_render_area"));
viewer.setEDLEnabled(true);
viewer.setFOV(60);
viewer.setPointBudget(2_000_000);
viewer.loadSettingsFromURL();
viewer.setDescription("Loading COPC format");
viewer.loadGUI(() => {
viewer.setLanguage('en');
$("#menu_appearance").next().show();
});
var path = "../pointclouds/lion_takanawa.copc.laz";
var name = "lion";
var getQueryParam = function(name) {
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(window.location.href);
if (!results || !results[2]) return null;
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var r = getQueryParam('r');
if (r) {
name = r;
var http = 'http';
if (r.substr(0, http.length) == http) path = name;
else path = "../pointclouds/" + name + "/ept.json";
}
Potree.loadPointCloud(path, name, function(e){
viewer.scene.addPointCloud(e.pointcloud);
let material = e.pointcloud.material;
material.size = 1;
material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
viewer.fitToScreen(0.5);
});
</script>
</body>
</html>

View File

@ -25,6 +25,7 @@
<script src="../libs/openlayers3/ol.js"></script>
<script src="../libs/i18next/i18next.js"></script>
<script src="../libs/jstree/jstree.js"></script>
<script src="../libs/copc/index.js"></script>
<script src="../build/potree/potree.js"></script>
<script src="../libs/plasio/js/laslaz.js"></script>

88
examples/ept_laz_14.html Normal file
View File

@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Potree Viewer</title>
<link rel="stylesheet" type="text/css" href="../build/potree/potree.css">
<link rel="stylesheet" type="text/css" href="../libs/jquery-ui/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="../libs/openlayers3/ol.css">
<link rel="stylesheet" type="text/css" href="../libs/spectrum/spectrum.css">
<link rel="stylesheet" type="text/css" href="../libs/jstree/themes/mixed/style.css">
</head>
<body>
<script src="../libs/jquery/jquery-3.1.1.min.js"></script>
<script src="../libs/spectrum/spectrum.js"></script>
<script src="../libs/jquery-ui/jquery-ui.min.js"></script>
<script src="../libs/other/BinaryHeap.js"></script>
<script src="../libs/tween/tween.min.js"></script>
<script src="../libs/d3/d3.js"></script>
<script src="../libs/proj4/proj4.js"></script>
<script src="../libs/openlayers3/ol.js"></script>
<script src="../libs/i18next/i18next.js"></script>
<script src="../libs/jstree/jstree.js"></script>
<script src="../libs/copc/index.js"></script>
<script src="../build/potree/potree.js"></script>
<script src="../libs/plasio/js/laslaz.js"></script>
<!-- INCLUDE ADDITIONAL DEPENDENCIES HERE -->
<!-- INCLUDE SETTINGS HERE -->
<div class="potree_container" style="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; ">
<div id="potree_render_area" style="background-image: url('../build/potree/resources/images/background.jpg');"></div>
<div id="potree_sidebar_container"> </div>
</div>
<script type="module">
import * as THREE from "../libs/three.js/build/three.module.js";
window.viewer = new Potree.Viewer(document.getElementById("potree_render_area"));
viewer.setEDLEnabled(true);
viewer.setFOV(60);
viewer.setPointBudget(2_000_000);
viewer.loadSettingsFromURL();
viewer.setDescription("Loading Entwine-generated EPT format");
viewer.loadGUI(() => {
viewer.setLanguage('en');
$("#menu_appearance").next().show();
});
var path = "../pointclouds/lion_takanawa_ept_laz_14/ept.json";
var name = "lion";
var getQueryParam = function(name) {
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(window.location.href);
if (!results || !results[2]) return null;
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var r = getQueryParam('r');
if (r) {
name = r;
var http = 'http';
if (r.substr(0, http.length) == http) path = name;
else path = "../pointclouds/" + name + "/ept.json";
}
Potree.loadPointCloud(path, name, function(e){
viewer.scene.addPointCloud(e.pointcloud);
let material = e.pointcloud.material;
material.size = 1;
material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
viewer.fitToScreen(0.5);
});
</script>
</body>
</html>

View File

@ -38,7 +38,8 @@ let workers = {
"src/workers/LASDecoderWorker.js"
],
"EptLaszipDecoderWorker": [
"src/workers/EptLaszipDecoderWorker.js"
"libs/copc/index.js",
"src/workers/EptLaszipDecoderWorker.js",
],
"EptBinaryDecoderWorker": [
"libs/ept/ParseBuffer.js",
@ -114,6 +115,9 @@ gulp.task("workers", async function(done){
.pipe(gulp.dest('build/potree/workers'));
}
gulp.src('./libs/copc/laz-perf.wasm')
.pipe(gulp.dest('./build/potree/workers'));
done();
});

1
libs/copc/index.js Normal file

File diff suppressed because one or more lines are too long

BIN
libs/copc/laz-perf.wasm Executable file

Binary file not shown.

3053
package-lock.json generated

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,7 @@
{
"overflowDepth" : 0,
"overflowThreshold" : 32768,
"software" : "Entwine",
"trustHeaders" : true,
"version" : "2.0.0"
}

View File

@ -0,0 +1,23 @@
function translate {
pdal translate "../../lion_takanawa_ept_laz/ept-data/$1" "$1" \
--writers.las.forward=all \
--writers.las.minor_version=4 \
--writers.las.dataformat_id=7
}
translate "0-0-0-0.laz"
translate "1-0-0-1.laz"
translate "1-0-1-1.laz"
translate "1-1-0-1.laz"
translate "2-0-1-1.laz"
translate "2-0-2-1.laz"
translate "2-1-1-1.laz"
translate "2-1-2-1.laz"
translate "1-0-0-0.laz"
translate "1-0-1-0.laz"
translate "1-1-0-0.laz"
translate "1-1-1-0.laz"
translate "2-0-1-2.laz"
translate "2-1-0-1.laz"
translate "2-1-1-2.laz"
translate "2-1-3-1.laz"

View File

@ -0,0 +1,18 @@
{
"0-0-0-0" : 35091,
"1-0-0-0" : 28672,
"1-0-0-1" : 24212,
"1-0-1-0" : 21577,
"1-0-1-1" : 33380,
"1-1-0-0" : 25549,
"1-1-0-1" : 444,
"1-1-1-0" : 42454,
"2-0-1-1" : 548,
"2-0-1-2" : 774,
"2-0-2-1" : 1864,
"2-1-0-1" : 531,
"2-1-1-1" : 50549,
"2-1-1-2" : 42267,
"2-1-2-1" : 33788,
"2-1-3-1" : 289
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,117 @@
{
"bounds" :
[
-7,
-1,
-6,
3,
9,
4
],
"boundsConforming" :
[
-5,
1,
-4,
1,
7,
3
],
"dataType" : "laszip",
"hierarchyType" : "json",
"points" : 341989,
"schema" :
[
{
"name" : "X",
"offset" : -2,
"scale" : 0.001,
"size" : 4,
"type" : "signed"
},
{
"name" : "Y",
"offset" : 4,
"scale" : 0.001,
"size" : 4,
"type" : "signed"
},
{
"name" : "Z",
"offset" : -1,
"scale" : 0.001,
"size" : 4,
"type" : "signed"
},
{
"name" : "Intensity",
"size" : 2,
"type" : "unsigned"
},
{
"name" : "ReturnNumber",
"size" : 1,
"type" : "unsigned"
},
{
"name" : "NumberOfReturns",
"size" : 1,
"type" : "unsigned"
},
{
"name" : "ScanDirectionFlag",
"size" : 1,
"type" : "unsigned"
},
{
"name" : "EdgeOfFlightLine",
"size" : 1,
"type" : "unsigned"
},
{
"name" : "Classification",
"size" : 1,
"type" : "unsigned"
},
{
"name" : "ScanAngleRank",
"size" : 4,
"type" : "float"
},
{
"name" : "UserData",
"size" : 1,
"type" : "unsigned"
},
{
"name" : "PointSourceId",
"size" : 2,
"type" : "unsigned"
},
{
"name" : "Red",
"size" : 2,
"type" : "unsigned"
},
{
"name" : "Green",
"size" : 2,
"type" : "unsigned"
},
{
"name" : "Blue",
"size" : 2,
"type" : "unsigned"
},
{
"name" : "OriginId",
"size" : 4,
"type" : "unsigned"
}
],
"span" : 256,
"srs" :
{
},
"version" : "0.0.0"
}

View File

@ -20,187 +20,175 @@ class U {
static sphereFrom(b) {
return b.getBoundingSphere(new THREE.Sphere());
}
static toPotreeName([d, x, y, z]) {
var name = 'r';
for (var i = 0; i < d; ++i) {
var shift = d - i - 1;
var mask = 1 << shift;
var step = 0;
if (x & mask) step += 4;
if (y & mask) step += 2;
if (z & mask) step += 1;
name += step;
}
return name;
}
static maybeSrs(srs) {
try {
proj4(srs)
return srs
} catch (e) {}
}
};
export class PointCloudEptGeometry {
constructor(url, info) {
let version = info.version;
let schema = info.schema;
let bounds = info.bounds;
let boundsConforming = info.boundsConforming;
class BaseGeometry {
constructor({
cube,
boundsConforming,
spacing,
srs,
}) {
this.cube = cube;
let xyz = [
U.findDim(schema, 'X'),
U.findDim(schema, 'Y'),
U.findDim(schema, 'Z')
];
let scale = xyz.map((d) => d.scale || 1);
let offset = xyz.map((d) => d.offset || 0);
this.eptScale = U.toVector3(scale);
this.eptOffset = U.toVector3(offset);
this.url = url;
this.info = info;
this.type = 'ept';
this.schema = schema;
this.span = info.span || info.ticks;
this.boundingBox = U.toBox3(bounds);
this.boundingBox = U.toBox3(cube);
this.tightBoundingBox = U.toBox3(boundsConforming);
this.offset = U.toVector3([0, 0, 0]);
this.boundingSphere = U.sphereFrom(this.boundingBox);
this.tightBoundingSphere = U.sphereFrom(this.tightBoundingBox);
this.offset = U.toVector3([0, 0, 0]);
this.version = new Potree.Version('1.7');
this.projection = null;
this.fallbackProjection = null;
this.loader = new Potree.CopcLaszipLoader();
if (info.srs && info.srs.horizontal) {
this.projection = info.srs.authority + ':' + info.srs.horizontal;
this.spacing = spacing;
this.projection = srs || null;
try {
proj4(this.projection);
} catch(e) {
this.projection = null;
}
if (info.srs && info.srs.wkt) {
if (!this.projection) this.projection = info.srs.wkt;
else this.fallbackProjection = info.srs.wkt;
}
{
// TODO [mschuetz]: named projections that proj4 can't handle seem to cause problems.
// remove them for now
try{
proj4(this.projection);
}catch(e){
this.projection = null;
}
}
{
const attributes = new PointAttributes();
attributes.add(PointAttribute.POSITION_CARTESIAN);
attributes.add(new PointAttribute("rgba", PointAttributeTypes.DATA_TYPE_UINT8, 4));
attributes.add(new PointAttribute("intensity", PointAttributeTypes.DATA_TYPE_UINT16, 1));
attributes.add(new PointAttribute("classification", PointAttributeTypes.DATA_TYPE_UINT8, 1));
attributes.add(new PointAttribute("gps-time", PointAttributeTypes.DATA_TYPE_DOUBLE, 1));
attributes.add(new PointAttribute("returnNumber", PointAttributeTypes.DATA_TYPE_UINT8, 1));
attributes.add(new PointAttribute("number of returns", PointAttributeTypes.DATA_TYPE_UINT8, 1));
attributes.add(new PointAttribute("return number", PointAttributeTypes.DATA_TYPE_UINT8, 1));
attributes.add(new PointAttribute("source id", PointAttributeTypes.DATA_TYPE_UINT16, 1));
this.pointAttributes = attributes;
}
this.spacing =
(this.boundingBox.max.x - this.boundingBox.min.x) / this.span;
let hierarchyType = info.hierarchyType || 'json';
const dataType = info.dataType;
if (dataType == 'laszip') {
this.loader = new Potree.EptLaszipLoader();
}
else if (dataType == 'binary') {
this.loader = new Potree.EptBinaryLoader();
}
else if (dataType == 'zstandard') {
this.loader = new Potree.EptZstandardLoader();
}
else {
throw new Error('Could not read data type: ' + dataType);
}
}
};
export class EptKey {
constructor(ept, b, d, x, y, z) {
this.ept = ept;
this.b = b;
this.d = d;
this.x = x || 0;
this.y = y || 0;
this.z = z || 0;
}
name() {
return this.d + '-' + this.x + '-' + this.y + '-' + this.z;
}
step(a, b, c) {
let min = this.b.min.clone();
let max = this.b.max.clone();
let dst = new THREE.Vector3().subVectors(max, min);
if (a) min.x += dst.x / 2;
else max.x -= dst.x / 2;
if (b) min.y += dst.y / 2;
else max.y -= dst.y / 2;
if (c) min.z += dst.z / 2;
else max.z -= dst.z / 2;
return new Potree.EptKey(
this.ept,
new THREE.Box3(min, max),
this.d + 1,
this.x * 2 + a,
this.y * 2 + b,
this.z * 2 + c);
}
children() {
var result = [];
for (var a = 0; a < 2; ++a) {
for (var b = 0; b < 2; ++b) {
for (var c = 0; c < 2; ++c) {
var add = this.step(a, b, c).name();
if (!result.includes(add)) result = result.concat(add);
}
}
}
return result;
const attributes = new PointAttributes();
attributes.add(PointAttribute.POSITION_CARTESIAN);
attributes.add(new PointAttribute("rgba", PointAttributeTypes.DATA_TYPE_UINT8, 4));
attributes.add(new PointAttribute("intensity", PointAttributeTypes.DATA_TYPE_UINT16, 1));
attributes.add(new PointAttribute("classification", PointAttributeTypes.DATA_TYPE_UINT8, 1));
attributes.add(new PointAttribute("gps-time", PointAttributeTypes.DATA_TYPE_FLOAT, 1));
attributes.add(new PointAttribute("returnNumber", PointAttributeTypes.DATA_TYPE_UINT8, 1));
attributes.add(new PointAttribute("number of returns", PointAttributeTypes.DATA_TYPE_UINT8, 1));
attributes.add(new PointAttribute("return number", PointAttributeTypes.DATA_TYPE_UINT8, 1));
attributes.add(new PointAttribute("source id", PointAttributeTypes.DATA_TYPE_UINT16, 1));
this.pointAttributes = attributes;
}
}
export class PointCloudEptGeometryNode extends PointCloudTreeNode {
constructor(ept, b, d, x, y, z) {
export class PointCloudCopcGeometry extends BaseGeometry {
static parse({ header, info, wkt }) {
return {
cube: info.cube,
boundsConforming: [...header.min, ...header.max],
spacing: info.spacing,
srs: wkt,
}
}
constructor(getter, copc) {
super(PointCloudCopcGeometry.parse(copc))
this.type = 'copc';
this.getter = getter
this.copc = copc;
this.pages = { '0-0-0-0': copc.info.rootHierarchyPage }
this.loader = new Potree.CopcLaszipLoader();
}
async loadHierarchyPage(key) {
const { Copc, Key } = window.Copc
const page = this.pages[Key.toString(key)]
return Copc.loadHierarchyPage(this.getter, page)
}
};
export class PointCloudEptGeometry extends BaseGeometry {
static parse(ept) {
const { bounds: cube, boundsConforming, span, srs: filesrs } = ept
const spacing = (cube[3] - cube[0]) / span
let srs
if (filesrs) {
const { authority, horizontal, wkt } = filesrs
if (authority && horizontal) {
srs = U.maybeSrs(`${authority}:${horizontal}`)
}
if (!srs && wkt) srs = U.maybeSrs(wkt)
}
return { cube, boundsConforming, spacing, srs }
}
constructor(base, ept) {
super(PointCloudEptGeometry.parse(ept))
this.type = 'ept';
this.base = base;
this.ept = ept;
this.loader = (() => {
switch (ept.dataType) {
case 'laszip': return new Potree.EptLaszipLoader()
case 'binary': return new Potree.EptBinaryLoader()
case 'zstandard': return new Potree.EptZstandardLoader()
default: throw new Error('Invalid data type: ' + ept.dataType)
}
})()
}
async loadHierarchyPage(key) {
const { Ept, Key } = window.Copc
const filename = `${this.base}/ept-hierarchy/${Key.toString(key)}.json`
const response = await fetch(filename);
const json = await response.json();
return Ept.Hierarchy.parse(json)
}
}
export class PointCloudCopcGeometryNode extends PointCloudTreeNode {
constructor(owner, key, bounds) {
super();
this.ept = ept;
this.key = new Potree.EptKey(
this.ept,
b || this.ept.boundingBox,
d || 0,
x,
y,
z);
const { Key } = Copc
this.id = PointCloudEptGeometryNode.IDCount++;
this.owner = owner
this.key = key || Key.create(0, 0, 0, 0)
this.bounds = bounds || owner.cube
this.id = PointCloudCopcGeometryNode.IDCount++;
this.geometry = null;
this.boundingBox = this.key.b;
this.boundingBox = U.toBox3(this.bounds)
this.tightBoundingBox = this.boundingBox;
this.spacing = this.ept.spacing / Math.pow(2, this.key.d);
this.spacing = this.owner.spacing / Math.pow(2, Key.depth(this.key));
this.boundingSphere = U.sphereFrom(this.boundingBox);
// These are set during hierarchy loading.
this.hasChildren = false;
this.children = { };
this.nodeinfo = undefined
this.numPoints = -1;
this.level = this.key.d;
this.level = Key.depth(this.key);
this.loaded = false;
this.loading = false;
this.oneTimeDisposeHandlers = [];
let k = this.key;
this.name = this.toPotreeName(k.d, k.x, k.y, k.z);
this.name = U.toPotreeName(this.key);
this.index = parseInt(this.name.charAt(this.name.length - 1));
}
@ -210,10 +198,9 @@ export class PointCloudEptGeometryNode extends PointCloudTreeNode {
isLoaded() { return this.loaded; }
getBoundingSphere() { return this.boundingSphere; }
getBoundingBox() { return this.boundingBox; }
url() { return this.ept.url + 'ept-data/' + this.filename(); }
getNumPoints() { return this.numPoints; }
filename() { return this.key.name(); }
getNumPoints() {
return this.nodeinfo ? this.nodeinfo.pointCount : -1;
}
getChildren() {
let children = [];
@ -232,70 +219,74 @@ export class PointCloudEptGeometryNode extends PointCloudTreeNode {
child.parent = this;
}
load() {
async load() {
if (this.loaded || this.loading) return;
if (Potree.numNodesLoading >= Potree.maxNodesLoading) return;
this.loading = true;
++Potree.numNodesLoading;
if (this.numPoints == -1) this.loadHierarchy();
if (!this.nodeinfo) await this.loadHierarchy();
this.loadPoints();
}
loadPoints(){
this.ept.loader.load(this);
this.owner.loader.load(this);
}
async loadHierarchy() {
let nodes = { };
nodes[this.filename()] = this;
const { Bounds, Key } = window.Copc
const ourkeyname = Key.toString(this.key)
let nodemap = { };
nodemap[ourkeyname] = this;
this.hasChildren = false;
let eptHierarchyFile =
`${this.ept.url}ept-hierarchy/${this.filename()}.json`;
const { nodes, pages } = await this.owner.loadHierarchyPage(this.key)
let response = await fetch(eptHierarchyFile);
let hier = await response.json();
// Since we want to traverse top-down, and 10 comes lexicographically
// before 9 (for example), do a deep sort.
const keys = Object.keys({ ...nodes, ...pages })
.map(Key.create)
.sort(Key.compare)
// Since we want to traverse top-down, and 10 comes
// lexicographically before 9 (for example), do a deep sort.
var keys = Object.keys(hier).sort((a, b) => {
let [da, xa, ya, za] = a.split('-').map((n) => parseInt(n, 10));
let [db, xb, yb, zb] = b.split('-').map((n) => parseInt(n, 10));
if (da < db) return -1; if (da > db) return 1;
if (xa < xb) return -1; if (xa > xb) return 1;
if (ya < yb) return -1; if (ya > yb) return 1;
if (za < zb) return -1; if (za > zb) return 1;
return 0;
});
keys.forEach((key) => {
const keyname = Key.toString(key)
if (keyname === ourkeyname) {
this.nodeinfo = nodes[keyname]
return;
}
keys.forEach((v) => {
let [d, x, y, z] = v.split('-').map((n) => parseInt(n, 10));
let a = x & 1, b = y & 1, c = z & 1;
let parentName =
(d - 1) + '-' + (x >> 1) + '-' + (y >> 1) + '-' + (z >> 1);
const [_d, x, y, z] = key
const step = [x & 1, y & 1, z & 1]
let parentNode = nodes[parentName];
let parentName = Key.toString(Key.up(key))
let parentNode = nodemap[parentName];
if (!parentNode) return;
parentNode.hasChildren = true;
let key = parentNode.key.step(a, b, c);
let node = new Potree.PointCloudEptGeometryNode(
this.ept,
key.b,
key.d,
key.x,
key.y,
key.z);
node.level = d;
node.numPoints = hier[v];
const bounds = Bounds.step(parentNode.bounds, step)
const node = new Potree.PointCloudCopcGeometryNode(
this.owner,
key,
bounds);
parentNode.addChild(node);
nodes[key.name()] = node;
});
nodemap[keyname] = node;
// For data nodes, add their point data offset/point counts.
const nodeinfo = nodes[keyname]
if (nodeinfo) node.nodeinfo = nodeinfo
// And for leaf nodes whose data is in a different hierarchy page,
// store the info for the hierarchy page in our page map. This is
// only applicable for COPC data since we need hierarchy page
// ranges to fetch them - EPT data on the other hand we just need
// the node key to fetch the file.
const pageinfo = pages[keyname]
if (this.owner.pages && pageinfo) {
this.owner.pages[keyname] = pageinfo
}
})
}
doneLoading(bufferGeometry, tightBoundingBox, np, mean) {
@ -309,26 +300,8 @@ export class PointCloudEptGeometryNode extends PointCloudTreeNode {
--Potree.numNodesLoading;
}
toPotreeName(d, x, y, z) {
var name = 'r';
for (var i = 0; i < d; ++i) {
var shift = d - i - 1;
var mask = 1 << shift;
var step = 0;
if (x & mask) step += 4;
if (y & mask) step += 2;
if (z & mask) step += 1;
name += step;
}
return name;
}
dispose() {
if (this.geometry && this.parent != null) {
if (this.geometry && this.parent) {
this.geometry.dispose();
this.geometry = null;
this.loaded = false;
@ -343,5 +316,4 @@ export class PointCloudEptGeometryNode extends PointCloudTreeNode {
}
}
PointCloudEptGeometryNode.IDCount = 0;
PointCloudCopcGeometryNode.IDCount = 0;

View File

@ -82,7 +82,7 @@ import "./extensions/Ray.js";
import {LRU} from "./LRU.js";
import {OctreeLoader} from "./modules/loader/2.0/OctreeLoader.js";
import {POCLoader} from "./loader/POCLoader.js";
import {EptLoader} from "./loader/EptLoader.js";
import {CopcLoader, EptLoader} from "./loader/EptLoader.js";
import {PointCloudOctree} from "./PointCloudOctree.js";
import {WorkerPool} from "./WorkerPool.js";
@ -139,14 +139,23 @@ export function loadPointCloud(path, name, callback){
// load pointcloud
if (!path){
// TODO: callback? comment? Hello? Bueller? Anyone?
} else if (path.indexOf('ept.json') > 0) {
} else if (path.includes('ept.json')) {
EptLoader.load(path, function(geometry) {
if (!geometry) {
console.error(new Error(`failed to load point cloud from URL: ${path}`));
}
else {
let pointcloud = new PointCloudOctree(geometry);
//loaded(pointcloud);
resolve({type: 'pointcloud_loaded', pointcloud: pointcloud});
}
});
} else if (path.includes('.copc.laz')) {
CopcLoader.load(path, function(geometry) {
if (!geometry) {
console.error(new Error(`failed to load point cloud from URL: ${path}`));
}
else {
let pointcloud = new PointCloudOctree(geometry);
resolve({type: 'pointcloud_loaded', pointcloud: pointcloud});
}
});

View File

@ -857,6 +857,7 @@ export class Renderer {
const geometry = node.geometryNode.geometry;
if (!geometry) console.log('Missing geometry', node)
if(geometry.attributes["gps-time"]){
const bufferAttribute = geometry.attributes["gps-time"];
const attGPS = octree.getAttribute("gps-time");

View File

@ -8,9 +8,9 @@ export class EptLoader {
let response = await fetch(file);
let json = await response.json();
let url = file.substr(0, file.lastIndexOf('ept.json'));
let url = file.substr(0, file.lastIndexOf('/ept.json'));
let geometry = new Potree.PointCloudEptGeometry(url, json);
let root = new Potree.PointCloudEptGeometryNode(geometry);
let root = new Potree.PointCloudCopcGeometryNode(geometry);
geometry.root = root;
geometry.root.load();
@ -19,3 +19,20 @@ export class EptLoader {
}
};
export class CopcLoader {
static async load(file, callback) {
const { Copc, Getter } = window.Copc
const url = file;
const getter = Getter.http(url);
const copc = await Copc.create(getter);
let geometry = new Potree.PointCloudCopcGeometry(getter, copc);
let root = new Potree.PointCloudCopcGeometryNode(geometry);
geometry.root = root;
geometry.root.load();
callback(geometry);
}
}

View File

@ -1,101 +1,77 @@
import * as THREE from "../../../libs/three.js/build/three.module.js";
import {XHRFactory} from "../../XHRFactory.js";
/**
* laslaz code taken and adapted from plas.io js-laslaz
* http://plas.io/
* https://github.com/verma/plasio
*
* Thanks to Uday Verma and Howard Butler
*
*/
export class EptLaszipLoader {
load(node) {
async load(node) {
if (node.loaded) return;
let url = node.url() + '.laz';
const { Key } = window.Copc
let xhr = XHRFactory.createXMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'arraybuffer';
xhr.overrideMimeType('text/plain; charset=x-user-defined');
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
let buffer = xhr.response;
this.parse(node, buffer);
} else {
console.log('Failed ' + url + ': ' + xhr.status);
}
}
};
xhr.send(null);
const url = `${node.owner.base}/ept-data/${Key.toString(node.key)}.laz`
const response = await fetch(url);
const buffer = await response.arrayBuffer();
this.parse(node, buffer);
}
async parse(node, buffer){
let lf = new LASFile(buffer);
async parse(node, compressed){
let handler = new EptLazBatcher(node);
try{
await lf.open();
try {
const { Bounds, Las } = Copc
lf.isOpen = true;
const get = (begin, end) => new Uint8Array(compressed, begin, end - begin)
const header = await lf.getHeader();
const header = Las.Header.parse(new Uint8Array(compressed))
const vlrs = await Las.Vlr.walk(get, header)
let eb = []
const ebVlr = Las.Vlr.find(vlrs, 'LASF_Spec', 4)
if (ebVlr) eb = Las.ExtraBytes.parse(await Las.Vlr.fetch(get, ebVlr))
{
let i = 0;
let toArray = (v) => [v.x, v.y, v.z];
let mins = toArray(node.key.b.min);
let maxs = toArray(node.key.b.max);
let hasMoreData = true;
while(hasMoreData){
const data = await lf.readData(1000000, 0, 1);
let d = new LASDecoder(
data.buffer,
header.pointsFormatId,
header.pointsStructSize,
data.count,
header.scale,
header.offset,
mins,
maxs);
d.extraBytes = header.extraBytes;
d.pointsFormatId = header.pointsFormatId;
handler.push(d);
i += data.count;
hasMoreData = data.hasMoreData;
}
header.totalRead = i;
header.versionAsString = lf.versionAsString;
header.isCompressed = lf.isCompressed;
await lf.close();
lf.isOpen = false;
const message = {
isFullFile: true,
compressed,
header,
eb,
pointCount: header.pointCount,
nodemin: Bounds.min(node.bounds),
}
handler.push(message)
} catch (e) {
console.log('Failed:', e)
}
}
};
}catch(err){
console.error('Error reading LAZ:', err);
if (lf.isOpen) {
await lf.close();
export class CopcLaszipLoader {
async load(node) {
if (node.loaded) return;
lf.isOpen = false;
}
throw err;
// There are utilities to do all of this in one async call via copc.js,
// however we must split things out a bit to accommodate the expensive
// calls to go in the worker. So in this non-worker context, we just
// isolate the compressed data buffer, which is passed to the worker.
// The time-consuming decompression and extracting the data into
// GPU-compatible buffers happens in the worker.
const { pointDataOffset, pointDataLength } = node.nodeinfo
const compressed = await node.owner.getter(
pointDataOffset,
pointDataOffset + pointDataLength)
this.parse(node, compressed.buffer);
}
async parse(node, compressed) {
let handler = new EptLazBatcher(node);
try {
handler.push({
isFullFile: false,
compressed,
header: node.owner.copc.header,
eb: node.owner.copc.eb,
pointCount: node.nodeinfo.pointCount,
nodemin: node.bounds.slice(0, 3),
})
} catch (e) {
console.log('Failed:', e)
}
}
};
@ -104,22 +80,24 @@ export class EptLazBatcher {
constructor(node) { this.node = node; }
push(las) {
const { isFullFile, compressed, header, eb, pointCount, nodemin } = las
let workerPath = Potree.scriptPath +
'/workers/EptLaszipDecoderWorker.js';
let worker = Potree.workerPool.getWorker(workerPath);
const pointAttributes = this.node.owner.pointAttributes;
worker.onmessage = (e) => {
let g = new THREE.BufferGeometry();
let numPoints = las.pointsCount;
let positions = new Float32Array(e.data.position);
let colors = new Uint8Array(e.data.color);
let intensities = new Float32Array(e.data.intensity);
let classifications = new Uint8Array(e.data.classification);
let returnNumbers = new Uint8Array(e.data.returnNumber);
let numberOfReturns = new Uint8Array(e.data.numberOfReturns);
let pointSourceIDs = new Uint16Array(e.data.pointSourceID);
let pointSourceIds = new Uint16Array(e.data.pointSourceId);
let indices = new Uint8Array(e.data.indices);
let gpsTime = new Float32Array(e.data.gpsTime);
@ -136,15 +114,29 @@ export class EptLazBatcher {
g.setAttribute('number of returns',
new THREE.BufferAttribute(numberOfReturns, 1));
g.setAttribute('source id',
new THREE.BufferAttribute(pointSourceIDs, 1));
new THREE.BufferAttribute(pointSourceIds, 1));
g.setAttribute('indices',
new THREE.BufferAttribute(indices, 4));
g.setAttribute('gpsTime',
g.setAttribute('gps-time',
new THREE.BufferAttribute(gpsTime, 1));
this.node.gpsTime = e.data.gpsMeta;
g.attributes.indices.normalized = true;
for (const key in e.data.ranges) {
const range = e.data.ranges[key];
const attribute = pointAttributes.attributes.find(a => a.name === key);
if (attribute) {
attribute.range[0] = Math.min(attribute.range[0], range[0]);
attribute.range[1] = Math.max(attribute.range[1], range[1]);
// May not be right, but we need something here or we crash.
if (!attribute.initialRange) {
attribute.initialRange = attribute.range
}
}
}
let tightBoundingBox = new THREE.Box3(
new THREE.Vector3().fromArray(e.data.tightBoundingBox.min),
new THREE.Vector3().fromArray(e.data.tightBoundingBox.max)
@ -153,24 +145,14 @@ export class EptLazBatcher {
this.node.doneLoading(
g,
tightBoundingBox,
numPoints,
pointCount,
new THREE.Vector3(...e.data.mean));
Potree.workerPool.returnWorker(workerPath, worker);
};
let message = {
buffer: las.arrayb,
numPoints: las.pointsCount,
pointSize: las.pointSize,
pointFormatID: las.pointsFormatId,
scale: las.scale,
offset: las.offset,
mins: las.mins,
maxs: las.maxs
};
let message = { isFullFile, compressed, header, eb, pointCount, nodemin };
worker.postMessage(message, [message.buffer]);
worker.postMessage(message, [message.compressed]);
};
};

View File

@ -1,155 +1,165 @@
function readUsingDataView(event) {
/* global onmessage:true postMessage:false Copc */
/* exported onmessage */
// ept-laszip-decoder-worker.js
//
// importScripts('/libs/copc/index.js');
async function readUsingDataView(event) {
performance.mark("laslaz-start");
let buffer = event.data.buffer;
let numPoints = event.data.numPoints;
let pointSize = event.data.pointSize;
let pointFormat = event.data.pointFormatID;
// TODO: Handle extra-bytes.
const { isFullFile, compressed, header, eb, pointCount, nodemin } = event.data
const { pointDataRecordFormat, pointDataRecordLength } = header
// gps time byte offsets from LAS specification
let gpsOffsets = [null, 20, null, 20, 20, 20, 22, 22, 22, 22, 22]
let gpsOffset = gpsOffsets[pointFormat];
// Note that for the chunk version, we use the point count passed in the
// event rather than the point count from the header, since the header has
// the point count for the entire file, not just our slice.
const u = new Uint8Array(compressed)
const buffer = isFullFile
? await Copc.Las.PointData.decompressFile(u)
: await Copc.Las.PointData.decompressChunk(
u,
{ pointDataRecordFormat, pointDataRecordLength, pointCount },
)
let scale = event.data.scale;
let offset = event.data.offset;
const view = Copc.Las.View.create(buffer, header, eb)
let sourceUint8 = new Uint8Array(buffer);
let sourceView = new DataView(buffer);
const buffers = {
position: new ArrayBuffer(pointCount * 3 * 4),
color: new ArrayBuffer(pointCount * 3 * 2),
intensity: new ArrayBuffer(pointCount * 4),
classification: new ArrayBuffer(pointCount),
returnNumber: new ArrayBuffer(pointCount),
numberOfReturns: new ArrayBuffer(pointCount),
pointSourceId: new ArrayBuffer(pointCount * 2),
gpsTime: new ArrayBuffer(pointCount * 4),
indices: new ArrayBuffer(pointCount * 4),
}
const tempBuffers = {
gpsTime64: new ArrayBuffer(pointCount * 8),
color16: new ArrayBuffer(pointCount * 3 * 2), // Does not include alpha.
}
let tightBoundingBox = {
min: [
Number.POSITIVE_INFINITY,
Number.POSITIVE_INFINITY,
Number.POSITIVE_INFINITY
],
max: [
Number.NEGATIVE_INFINITY,
Number.NEGATIVE_INFINITY,
Number.NEGATIVE_INFINITY
]
};
const views = {
position: new Float32Array(buffers.position),
color16: new Uint16Array(tempBuffers.color16),
color8: new Uint8Array(buffers.color),
intensity: new Float32Array(buffers.intensity),
classification: new Uint8Array(buffers.classification),
returnNumber: new Uint8Array(buffers.returnNumber),
numberOfReturns: new Uint8Array(buffers.numberOfReturns),
pointSourceId: new Uint16Array(buffers.pointSourceId),
gpsTime64: new Float64Array(tempBuffers.gpsTime64),
gpsTime32: new Float32Array(buffers.gpsTime),
indices: new Uint32Array(buffers.indices),
}
let mean = [0, 0, 0];
const mean = [0, 0, 0];
let pBuff = new ArrayBuffer(numPoints * 3 * 4);
let cBuff = new ArrayBuffer(numPoints * 4);
let iBuff = new ArrayBuffer(numPoints * 4);
let clBuff = new ArrayBuffer(numPoints);
let rnBuff = new ArrayBuffer(numPoints);
let nrBuff = new ArrayBuffer(numPoints);
let psBuff = new ArrayBuffer(numPoints * 2);
let gpsBuff64 = new ArrayBuffer(numPoints * 8);
let gpsBuff32 = new ArrayBuffer(numPoints * 4);
const get = {
x: view.getter('X'),
y: view.getter('Y'),
z: view.getter('Z'),
intensity: view.getter('Intensity'),
classification: view.getter('Classification'),
returnNumber: view.getter('ReturnNumber'),
numberOfReturns: view.getter('NumberOfReturns'),
pointSourceId: view.getter('PointSourceId'),
...(view.dimensions.GpsTime && { gpsTime: view.getter('GpsTime') }),
...(view.dimensions.Red && {
red: view.getter('Red'),
green: view.getter('Green'),
blue: view.getter('Blue'),
}),
}
let positions = new Float32Array(pBuff);
let colors = new Uint8Array(cBuff);
let intensities = new Float32Array(iBuff);
let classifications = new Uint8Array(clBuff);
let returnNumbers = new Uint8Array(rnBuff);
let numberOfReturns = new Uint8Array(nrBuff);
let pointSourceIDs = new Uint16Array(psBuff);
let gpsTime64 = new Float64Array(gpsBuff64)
let gpsTime32 = new Float32Array(gpsBuff32)
const ranges = [
'x',
'y',
'z',
'intensity',
'classification',
'returnNumber',
'numberOfReturns',
'pointSourceId',
'gpsTime',
'color',
].reduce((map, name) => ({ ...map, [name]: [Infinity, -Infinity] }), {})
// Point format 3 contains an 8-byte GpsTime before RGB values, so make
// sure we have the correct color offset.
let hasColor = pointFormat == 2 || pointFormat == 3;
let co = pointFormat == 2 ? 20 : 28;
function update(range, value) {
range[0] = Math.min(range[0], value)
range[1] = Math.max(range[1], value)
}
// TODO This should be cached per-resource since this is an expensive check.
let twoByteColor = false;
if (hasColor) {
let r, g, b, pos;
for (let i = 0; i < numPoints && !twoByteColor; ++i) {
pos = i * pointSize;
r = sourceView.getUint16(pos + co, true)
g = sourceView.getUint16(pos + co + 2, true)
b = sourceView.getUint16(pos + co + 4, true)
if (r > 255 || g > 255 || b > 255) twoByteColor = true;
for (let i = 0; i < pointCount; i++) {
views.indices[i] = i;
const x = get.x(i) - nodemin[0];
const y = get.y(i) - nodemin[1];
const z = get.z(i) - nodemin[2];
views.position[3 * i + 0] = x;
views.position[3 * i + 1] = y;
views.position[3 * i + 2] = z;
mean[0] += x / pointCount;
mean[1] += y / pointCount;
mean[2] += z / pointCount;
update(ranges.x, x)
update(ranges.y, y)
update(ranges.z, z)
views.intensity[i] = get.intensity(i)
update(ranges.intensity, views.intensity[i])
views.returnNumber[i] = get.returnNumber(i)
update(ranges.returnNumber, views.returnNumber[i])
views.numberOfReturns[i] = get.numberOfReturns(i)
update(ranges.numberOfReturns, views.numberOfReturns[i])
views.classification[i] = get.classification(i)
update(ranges.classification, views.classification[i])
views.classification[i] = get.classification(i)
update(ranges.classification, views.classification[i])
views.pointSourceId[i] = get.pointSourceId(i)
update(ranges.pointSourceId, views.pointSourceId[i])
if (get.gpsTime) {
views.gpsTime64[i] = get.gpsTime(i)
update(ranges.gpsTime, views.gpsTime64[i])
}
if (get.red) {
let r = get.red(i)
let g = get.green(i)
let b = get.blue(i)
// We only really care about the max here to decide if we will need
// to normalize the colors downward to 8-bit values.
update(ranges.color, Math.max(r, g, b))
views.color16[3 * i + 0] = r
views.color16[3 * i + 1] = g
views.color16[3 * i + 2] = b
}
}
for (let i = 0; i < numPoints; i++) {
// POSITION
let ux = sourceView.getInt32(i * pointSize + 0, true);
let uy = sourceView.getInt32(i * pointSize + 4, true);
let uz = sourceView.getInt32(i * pointSize + 8, true);
x = ux * scale[0] + offset[0] - event.data.mins[0];
y = uy * scale[1] + offset[1] - event.data.mins[1];
z = uz * scale[2] + offset[2] - event.data.mins[2];
positions[3 * i + 0] = x;
positions[3 * i + 1] = y;
positions[3 * i + 2] = z;
mean[0] += x / numPoints;
mean[1] += y / numPoints;
mean[2] += z / numPoints;
tightBoundingBox.min[0] = Math.min(tightBoundingBox.min[0], x);
tightBoundingBox.min[1] = Math.min(tightBoundingBox.min[1], y);
tightBoundingBox.min[2] = Math.min(tightBoundingBox.min[2], z);
tightBoundingBox.max[0] = Math.max(tightBoundingBox.max[0], x);
tightBoundingBox.max[1] = Math.max(tightBoundingBox.max[1], y);
tightBoundingBox.max[2] = Math.max(tightBoundingBox.max[2], z);
// INTENSITY
let intensity = sourceView.getUint16(i * pointSize + 12, true);
intensities[i] = intensity;
// RETURN NUMBER, stored in the first 3 bits - 00000111
// number of returns stored in next 3 bits - 00111000
let returnNumberAndNumberOfReturns = sourceView.getUint8(i * pointSize + 14, true);
let returnNumber = returnNumberAndNumberOfReturns & 0b0111;
let numberOfReturn = (returnNumberAndNumberOfReturns & 0b00111000) >> 3;
returnNumbers[i] = returnNumber;
numberOfReturns[i] = numberOfReturn;
// CLASSIFICATION
let classification = sourceView.getUint8(i * pointSize + 15, true);
classifications[i] = classification;
// POINT SOURCE ID
let pointSourceID = sourceView.getUint16(i * pointSize + 18, true);
pointSourceIDs[i] = pointSourceID;
// COLOR, if available
if (hasColor) {
let r = sourceView.getUint16(i * pointSize + co, true)
let g = sourceView.getUint16(i * pointSize + co + 2, true)
let b = sourceView.getUint16(i * pointSize + co + 4, true)
if (twoByteColor) {
r /= 256;
g /= 256;
b /= 256;
}
colors[4 * i + 0] = r;
colors[4 * i + 1] = g;
colors[4 * i + 2] = b;
colors[4 * i + 3] = 255;
}
}
let min = Infinity
let max = -Infinity
for (let i = 0; i < numPoints; i++) {
min = Math.min(min, gpsTime64[i])
max = Math.max(max, gpsTime64[i])
}
for (let i = 0; i < numPoints; i++) {
gpsTime32[i] = gpsTime64[i] = min
}
let indices = new ArrayBuffer(numPoints * 4);
let iIndices = new Uint32Array(indices);
for (let i = 0; i < numPoints; i++) {
iIndices[i] = i;
// Do some normalizations:
// - if colors are 16-bit, normalize them down to 8-bit
// - normalize the GPS times to 32-bit offset values.
const normalizeColor = ranges.color[1] > 255 ? (c) => c / 256 : c => c
ranges.color[0] = normalizeColor(ranges.color[0])
ranges.color[1] = normalizeColor(ranges.color[1])
for (let i = 0; i < pointCount; i++) {
views.color8[4 * i + 0] = normalizeColor(views.color16[3 * i + 0]);
views.color8[4 * i + 1] = normalizeColor(views.color16[3 * i + 1]);
views.color8[4 * i + 2] = normalizeColor(views.color16[3 * i + 2]);
views.gpsTime32[i] = views.gpsTime64[i] - ranges.gpsTime[0]
}
performance.mark("laslaz-end");
@ -165,36 +175,29 @@ function readUsingDataView(event) {
performance.clearMeasures();
let message = {
mean: mean,
position: pBuff,
color: cBuff,
intensity: iBuff,
classification: clBuff,
returnNumber: rnBuff,
numberOfReturns: nrBuff,
pointSourceID: psBuff,
tightBoundingBox: tightBoundingBox,
indices: indices,
gpsTime: gpsBuff32,
gpsMeta: { offset: min, range: max-min }
...buffers,
mean,
tightBoundingBox: {
min: [ranges.x[0], ranges.y[0], ranges.z[0]],
max: [ranges.x[1], ranges.y[1], ranges.z[1]],
},
gpsMeta: {
offset: ranges.gpsTime[0],
range: ranges.gpsTime[1] - ranges.gpsTime[0]
},
ranges: {
intensity: ranges.intensity,
classification: ranges.classification,
'return number': ranges.returnNumber,
'number of returns': ranges.numberOfReturns,
'source id': ranges.pointSourceId,
'gps-time': ranges.gpsTime,
}
};
let transferables = [
message.position,
message.color,
message.intensity,
message.classification,
message.returnNumber,
message.numberOfReturns,
message.pointSourceID,
message.indices,
message.gpsTime
];
let transferables = Object.values(buffers)
postMessage(message, transferables);
};
onmessage = readUsingDataView;