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

PDAL: readers.pgpointcloud: Unable to fetch pcid with column 'pa' and table 'patches' #198

Open
jfjffilk opened this issue Apr 23, 2018 · 4 comments

Comments

@jfjffilk
Copy link

jfjffilk commented Apr 23, 2018

when i am trying to run pipeline json file to read from the PostgreSQL database, i get this from readers.pgpointcloud Unable to fetch pcid with column 'pa' and table 'pcpatches'.
if anyone could help me out that would be great. thank you
ps: I am a student and very new pgpointcloud and PDAL

@elemoine
Copy link
Contributor

Could you please provide a test case for this, with an actual pipeline json file and a Pointcloud table example? Please also indicate the versions of PDAL and Pointcloud that you use. Thanks.

@jfjffilk
Copy link
Author

jfjffilk commented Apr 24, 2018

I used the following json file to write the data into the database
{
"pipeline": [{
"type": "readers.las",
"filename": "merge.las"
},
{
"type": "filters.chipper",
"capacity": 400
},
{
"type": "writers.pgpointcloud",
"connection": "host='localhost' dbname='postgres' user='postgres',
"table": "patches"
}
]
}

and to read from the database the following file
{
"pipeline":[
{
"type":"readers.pgpointcloud",
"connection":"host='localhost' dbname='postgres' user='postgres',
"table":"patches",
"column":"pa",
},
{
"type":"writers.text",
"filename":"new.txt"
}
]
}

PDAL and pointcloud versions are the latest releases

@trey-stafford
Copy link

trey-stafford commented May 15, 2018

I am also experiencing this issue. The PDAL's code appears to try to select the pcid value for a patch table in a way similar to how the pointcloud_columns view defines the pcid column (https://github.com/PDAL/PDAL/blob/master/plugins/pgpointcloud/io/PgReader.cpp#L137-L181).

Unfortunately, the pointcloud_columns view also shows no entry for pcid:

valkyrie=# select * from pointcloud_columns;

 schema | table  | column | pcid | srid |  type   
--------+--------+--------+------+------+---------
 public | atm1b  | pa     |      |      | pcpatch
 public | ilvis2 | pa     |      |      | pcpatch

I am using postgresql 9.6.8; pgpointcloud v1.1.0

@trey-stafford
Copy link

I have found a solution to this problem: alter the patch colum's data type to include the correct pcid.

For example:

ALTER TABLE atm1b ALTER COLUMN pa SET DATA TYPE PCPATCH({pcid});

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

3 participants