connormanning / entwine

Entwine - point cloud organization for massive datasets
https://entwine.io
Other
451 stars 128 forks source link

Should the convert command generate .pnts files? #214

Closed martincarlin87 closed 5 years ago

martincarlin87 commented 5 years ago

Sorry for the issue, I am trying to take an las file and eventually display it in Cesium.

I have generated an laz file and so far, I have ran:

docker run -it -v ~/entwine:/entwine connormanning/entwine build -i /entwine/test.laz -o /entwine/test-ecef -r EPSG:27700 EPSG:4978

The output was:

17:00 - 100% - 163,270,665 - 576(178)M/h - 183W - 29R - 198A
    Done 0
Reawakened: 2490
Saving registry...
Saving metadata...

Index completed in 17:06.
Save complete.
    Points inserted: 163,270,665

Then I did docker run -it -v ~/entwine:/entwine connormanning/entwine convert -i /entwine/test-ecef -o /entwine/cesium/test but I got a lot of these exceptions:

Converting:
    Input:  /entwine/test-ecef/
    Output: /entwine/cesium/test/
    Color:  rgb
    Truncate: no
    Threads: 4
    Root geometric error: 2.25
Running...
Exception in pool task: Unable to fetch data and convert as requested: Red:uint16_t(29696) -> unsigned char
...
Exception in pool task: Unable to fetch data and convert as requested: Red:uint16_t(8448) -> unsigned char
    Done.

I then started the http server to serve the json file to Cesium:

docker run -it -v ~/entwine:/var/www -p 8081:8080 connormanning/http-server

I used port 8081 because Cesium seems to use 8080, but I can access the file in the browser.

I then created a Cesium example using:

<div id="cesiumContainer"></div>
    <script>
        var viewer = new Cesium.Viewer('cesiumContainer');
        var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
            url : 'http://127.0.0.1:8081/cesium/test/tileset.json', // URL from `Starting the Server` section.
        }));
        viewer.zoomTo(tileset);
    </script>

but in the JS console for the Cesium browser window and the command line for the http server, I am seeing 404 errors for .pnts files.

e.g.

[Thu Sep 12 2019 15:24:43 GMT+0000 (Coordinated Universal Time)] "GET /cesium/test/2-1-2-0.pnts" Error (404): "Not found"
[Thu Sep 12 2019 15:24:43 GMT+0000 (Coordinated Universal Time)] "GET /cesium/test/2-1-1-0.pnts" Error (404): "Not found"

image

and

image

I know I'm crossing over in to Cesium territory, but is there anything I am doing incorrectly on the Entwine part?

Cheers, Martin

connormanning commented 5 years ago

The problem is here: Exception in pool task: Unable to fetch data and convert as requested: Red:uint16_t(29696) -> unsigned char, so you should use the --truncate flag during entwine convert because 3D Tiles doesn't support the 16-bit color that your dataset contains.

However, please take a look at the EPT Tools project for a better way to transform your data to 3D Tiles than Entwine's built-in conversion. With EPT Tools, 1) you can transform your EPT data to 3D Tiles on the fly with a live server or Lambda function and 2) do not need to reproject your EPT data to EPSG:4978.

However I don't currently have a proj4js definition for EPSG:27700 in EPT Tools (see connormanning/ept-tools#5), so you could add one and PR it (spatialreference.org has one) or reproject to UTM or EPSG:3857 instead.

martincarlin87 commented 5 years ago

ah, thank you so much, especially for even having the patience to read a wall of text.

EPT Tools looks cool, I just need to figure out how to use it, I am new to the geospatial world so just finding my feet at the moment.

I can see the EPSG:27700 definition on spatialreference.org, I will try and find where those are stored in the EPT Tools repo and submit a PR.

Cheers, Martin