Skip to content

add uint64 and int64 to data type - #34

Closed
VertexC wants to merge 1 commit into
dranjan:masterfrom
VertexC:supportLong
Closed

add uint64 and int64 to data type#34
VertexC wants to merge 1 commit into
dranjan:masterfrom
VertexC:supportLong

Conversation

@VertexC

@VertexC VertexC commented Mar 19, 2020

Copy link
Copy Markdown

Tested as following.

(Pdb) plydata.elements[0]
PlyElement('rot', (PlyProperty('timestamp', 'int64'), PlyProperty('x', 'double'), PlyProperty('y', 'double'), PlyProperty('z', 'double')), count=2633, comments=['rot sensor data with timestamp'])
(Pdb) plydata.elements[0].data[0]
(5176470752137, -0.17772718, -0.3460772, -0.00874486)

@VertexC VertexC changed the title add uint64 and in64 to data type add uint64 and int64 to data type Mar 19, 2020
@dranjan

dranjan commented Mar 20, 2020

Copy link
Copy Markdown
Owner

Hi, @VertexC. Have you encountered other PLY files that contain 64-bit integer properties? I haven't personally seen this, and they are not part of the standard. I hesitate to implement nonstandard extensions to the PLY format unless they are already common and widely supported. (I was even on the fence about obj_info comments, but those appear to be a de-facto standard of sorts, and they are supported more or less widely in other libraries.)

For the use case in your example, a common workaround is to subtract an offset from all the timestamps (such as the first timestamp), and put the offset in a special header comment. plyfile specifically (and hopefully other PLY readers) will give you access to all the comments, so after reading the file, you can look for the comment and undo the offsetting. It's a bit annoying, but it's a pretty common when dealing with datasets that are referenced to some really huge coordinate system (like ECEF for spatial data or GPS for temporal data).

@VertexC

VertexC commented Mar 23, 2020

Copy link
Copy Markdown
Author

Hi @dranjan, I see your point. Ply format doesn't include int64 as its standard, but it is a fairly easy extension as numpy supports that.

As you said, add the offset in the comment and then remove is fairly annoying, I'll keep that extension for my own usage.

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

Successfully merging this pull request may close these issues.

2 participants