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

pointcloud_formats needs to use a sequence to generate its IDs #95

Open
hobu opened this issue Feb 11, 2016 · 0 comments
Open

pointcloud_formats needs to use a sequence to generate its IDs #95

hobu opened this issue Feb 11, 2016 · 0 comments

Comments

@hobu
Copy link
Collaborator

hobu commented Feb 11, 2016

The PDAL code that creates entries in pointcloud_formats is really dumb. In situations where multiple processes are creating pointcloud entries, it falls over. As a stop-gap, I have implemented some code to use a sequence on the pointcloud_formats table:

create sequence pointcloud_formats_pcid_sq;
alter sequence pointcloud_formats_pcid_sq owned by pointcloud_formats.pcid;
alter table pointcloud_formats alter column pcid set default nextval('pointcloud_formats_pcid_sq');

PDAL's writers.pgpointcloud will now use this sequence if it exists to generate the ID for the next pointcloud_formats entry. Otherwise it will do its silly MAX(id) approach. A more permanent fix is for pgpointcloud to add this sequence to the pointcloud_formats table when it is created.

See PDAL/PDAL#1101 for more detail

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