Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate a .pnts file #87

Closed
ghost opened this issue Mar 18, 2016 · 8 comments
Closed

How to generate a .pnts file #87

ghost opened this issue Mar 18, 2016 · 8 comments

Comments

@ghost
Copy link

ghost commented Mar 18, 2016

Hi,

What is the best way of generating a .pnts file? Are there any programs or utilities available?

Thank you.

@pjcozzi
Copy link
Contributor

pjcozzi commented Mar 19, 2016

Hi @skiplist, I don't believe anything is available yet, and I expect some changes to this tile format in the next few months as the current version is pretty simple and could be more efficient. To keep up on the news, follow this forum thread.

@ghost
Copy link
Author

ghost commented Mar 19, 2016

Thanks Patrick.

We are trying to glue something together for a demo and were wondering what the current format of the .pnts file is? Is the graphic at: https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Points/README.md currently the right format for the file at ./Specs/Data/Cesium3DTiles/Points/Points/points.pnts ?

I understand this will be changing in the future, but we'd like to glue a demo together ASAP, and if we could know the current format, we would be successful. Would be happy to submit our utility that creates the .pnts file as a PR.

Sincerely

@pjcozzi
Copy link
Contributor

pjcozzi commented Mar 19, 2016

Yes, that is the latest format used in the 3d-tiles branch of the Cesium repo.

This repo is for the spec only so please do not submit a PR here, but do let me know about it and I'll start to track the ecosystem like we do for glTF, https://github.com/KhronosGroup/glTF#gltf-tools

@ghost
Copy link
Author

ghost commented Mar 19, 2016

Hi Patrick,

Sorry to be a bother again. I am attempting to parse the points.pnts file and I'm seeing the following as the beginning of the file:

{ magic: <Buffer 1f 8b 08 00>,
  version: 0,
  byteLength: 724119,
  pointsLength: 2000459613,
  positions: 
   [ 2.139935304512619e-7,
     1.8833269362431015e-14,
     3.228909246097769e-14 ] }

I am parsing it via:

var bParser = require('binary-parser').Parser;
var pointsHeader = new bParser().buffer('magic', {
    length : 4
}).uint32('version', {}).uint32('byteLength', {}).uint32('pointsLength', {})
        .array('positions', {
            type : 'floatle', // or floatbe?
            length : function() {
                return 3;
                // return this.pointsLength / 3;
            }
        });

It looks a bit off as the positions seem out of the ordinary. Again, I really appreciate your help on the short notice, especially given that the format will be changing soon.

Sincerely

@pjcozzi
Copy link
Contributor

pjcozzi commented Mar 21, 2016

Have you looked at the sample data here: https://github.com/AnalyticalGraphicsInc/cesium/tree/3d-tiles/Specs/Data/Cesium3DTiles/Points/Points

Also, the best place to ask these questions is the Cesium forum. Just a heads up that you are on the bleeding edge, most 3D Tiles users right now are using the b3dm tile format, not pnts yet.

@ghost
Copy link
Author

ghost commented Mar 21, 2016

Thanks Patrick. Upon viewing that link I see now that it says the file is "gzipped". I changed the extension to .gz, unzipped it, and now the data is looking a lot better. I'll see what I can do with this new information. Before, I did not know the file was gzipped!

Thank you!

@pjcozzi
Copy link
Contributor

pjcozzi commented Mar 21, 2016

Glad you are on the right track.

I'd appreciate a screenshot when you have something working. Good luck!

@pjcozzi pjcozzi closed this as completed Mar 21, 2016
@ghost
Copy link
Author

ghost commented Mar 21, 2016

Things are looking much better now

node ./pnt-reader.js 
{ magic: 'pnts',
  version: 1,
  byteLength: 1875016,
  pointsLength: 125000,
  positions: [ 34.58336639404297, 88.80476379394531, -30.29364776611328 ] }

Is that x, y, z in decimal degrees?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant