writers.pgpointcloud needs a filename parameter to work
Nicolasribot opened this issue · comments
Describe the bug
When using writers.pgpointcloud in a pipeline, an error occurs if a filename
parameter is not defined, though such parameter is not described in the writer documentation.
Adding a dummy value for the filename parameter
solves the issue.
$ pdal pipeline --input ign_to_pg.json
{
"pipeline": [
"LHD_FXX_0574_6278_PTS_C_LAMB93_IGN69.copc.laz"
{
"type": "filters.chipper",
"capacity": 400
},
{
"type": "writers.pgpointcloud",
"connection": "host='localhost' port='16432'",
"table": "lidar",
"compression": "dimensional",
"srid": "2154"
}
]
}
Expected behavior
The pgpointcloud writer does not need a filename parameter to work
System/installation information:
$ uname -a
Darwin ACLYXY4K6WYWY 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:11:08 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8122 arm64
$ pdal --version
pdal 2.7.1 (git-version: Release)
This got broken when we added support for UUIDs in filenames. I have a fix but I don't really have any way of testing this anymore. Would you be able to build and test if I push a branch?
Yes I think I would be able to test your code
Here you go: https://github.com/PDAL/PDAL/tree/issue-4389
I checked out the issue-4389 branch on my local repo and tested pgpointcloud writer without filename
parameter: it worked.
I also ran all Ctests with only one error (the same error as seen on the main PDAL repo also):
120: /Users/nicolas/bin/PDAL/test/unit/apps/InfoTest.cpp:62: Failure
120: Expected: (output.find(validation)) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
There should have been an extended message after the one you posted. Was it missing?
In this conversation you mean ? I did not see an extended message
In the output following the Expected
line you provided.
Yes sorry I thought it was too lengthy. Here is the full error message for the failing test:
120: Test command: /Users/nicolas/bin/PDAL/cmake-build-pdal-debug/bin/pdal_info_test
120: Working Directory: /Users/nicolas/bin/PDAL/cmake-build-pdal-debug/bin/..
120: Environment variables:
120: PDAL_DRIVER_PATH=/Users/nicolas/bin/PDAL/cmake-build-pdal-debug/lib
120: Test timeout computed to be: 10000000
120: [==========] Running 6 tests from 1 test suite.
120: [----------] Global test environment set-up.
120: [----------] 6 tests from Info
120: [ RUN ] Info.point
120: [ OK ] Info.point (368 ms)
120: [ RUN ] Info.query
120: [ OK ] Info.query (376 ms)
120: [ RUN ] Info.stats
120: [ OK ] Info.stats (728 ms)
120: [ RUN ] Info.schema
120: [ OK ] Info.schema (121 ms)
120: [ RUN ] Info.all
120: [ OK ] Info.all (779 ms)
120: [ RUN ] Info.stac
120: /Users/nicolas/bin/PDAL/test/unit/apps/InfoTest.cpp:62: Failure
120: Expected: (output.find(validation)) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
120: Found: '{
120: "file_size": 3742038,
120: "filename": "/Users/nicolas/bin/PDAL/test/data/las/autzen_trim.las",
120: "now": "2024-04-18T20:10:46+0200",
120: "pdal_version": "2.7.0 (git-version: ccae6d)",
120: "reader": "readers.las",
120: "stac":
120: {
120: "assets":
120: {
120: "data":
120: {
120: "href": "/Users/nicolas/bin/PDAL/test/data/las/autzen_trim.las",
120: "title": "Pointcloud data"
120: }
120: },
120: "bbox":
120: [
120: -123.0734622,
120: 44.04990616,
120: 406.26,
120: -123.068918,
120: 44.05155049,
120: 520.51
120: ],
120: "geometry": { "type": "Polygon", "coordinates": [ [ [ -123.073395162034643, 44.049906162305206, 406.26 ], [ -123.0734622480648, 44.051449329698563, 406.26 ], [ -123.068984944029978, 44.051550487759314, 520.51 ], [ -123.068917974563547, 44.050007317747578, 520.51 ], [ -123.073395162034643, 44.049906162305206, 406.26 ] ] ] },
120: "id": "autzen_trim",
120: "links":
120: [
120: {
120: "href": "/Users/nicolas/bin/PDAL/test/data/las/autzen_trim.las",
120: "rel": "derived_from"
120: }
120: ],
120: "properties":
120: {
120: "datetime": "2015-09-09T00:00:00Z",
120: "pc:count": 110000,
120: "pc:encoding": ".las",
120: "pc:schemas":
120: [
120: {
120: "name": "X",
120: "size": 8,
120: "type": "floating"
120: },
120: {
120: "name": "Y",
120: "size": 8,
120: "type": "floating"
120: },
120: {
120: "name": "Z",
120: "size": 8,
120: "type": "floating"
120: },
120: {
120: "name": "Intensity",
120: "size": 2,
120: "type": "unsigned"
120: },
120: {
120: "name": "ReturnNumber",
120: "size": 1,
120: "type": "unsigned"
120: },
120: {
120: "name": "NumberOfReturns",
120: "size": 1,
120: "type": "unsigned"
120: },
120: {
120: "name": "ScanDirectionFlag",
120: "size": 1,
120: "type": "unsigned"
120: },
120: {
120: "name": "EdgeOfFlightLine",
120: "size": 1,
120: "type": "unsigned"
120: },
120: {
120: "name": "Classification",
120: "size": 1,
120: "type": "unsigned"
120: },
120: {
120: "name": "Synthetic",
120: "size": 1,
120: "type": "unsigned"
120: },
120: {
120: "name": "KeyPoint",
120: "size": 1,
120: "type": "unsigned"
120: },
120: {
120: "name": "Withheld",
120: "size": 1,
120: "type": "unsigned"
120: },
120: {
120: "name": "Overlap",
120: "size": 1,
120: "type": "unsigned"
120: },
120: {
120: "name": "ScanAngleRank",
120: "size": 4,
120: "type": "floating"
120: },
120: {
120: "name": "UserData",
120: "size": 1,
120: "type": "unsigned"
120: },
120: {
120: "name": "PointSourceId",
120: "size": 2,
120: "type": "unsigned"
120: },
120: {
120: "name": "GpsTime",
120: "size": 8,
120: "type": "floating"
120: },
120: {
120: "name": "Red",
120: "size": 2,
120: "type": "unsigned"
120: },
120: {
120: "name": "Green",
120: "size": 2,
120: "type": "unsigned"
120: },
120: {
120: "name": "Blue",
120: "size": 2,
120: "type": "unsigned"
120: }
120: ],
120: "pc:statistics":
120: [
120: {
120: "average": 636546.405,
120: "count": 110000,
120: "maximum": 637179.22,
120: "minimum": 636001.76,
120: "name": "X",
120: "position": 0,
120: "stddev": 314.9304199,
120: "variance": 99181.16939
120: },
120: {
120: "average": 849145.7857,
120: "count": 110000,
120: "maximum": 849497.9,
120: "minimum": 848935.2,
120: "name": "Y",
120: "position": 1,
120: "stddev": 124.3281512,
120: "variance": 15457.48917
120: },
120: {
120: "average": 430.3375248,
120: "count": 110000,
120: "maximum": 520.51,
120: "minimum": 406.26,
120: "name": "Z",
120: "position": 2,
120: "stddev": 14.94118348,
120: "variance": 223.2389639
120: },
120: {
120: "average": 102.0049727,
120: "count": 110000,
120: "maximum": 254,
120: "minimum": 0,
120: "name": "Intensity",
120: "position": 3,
120: "stddev": 68.58535917,
120: "variance": 4703.951493
120: },
120: {
120: "average": 1.114218182,
120: "count": 110000,
120: "maximum": 4,
120: "minimum": 1,
120: "name": "ReturnNumber",
120: "position": 4,
120: "stddev": 0.3688939099,
120: "variance": 0.1360827168
120: },
120: {
120: "average": 1.228854545,
120: "count": 110000,
120: "maximum": 4,
120: "minimum": 1,
120: "name": "NumberOfReturns",
120: "position": 5,
120: "stddev": 0.5309262708,
120: "variance": 0.281882705
120: },
120: {
120: "average": 0.5090727273,
120: "count": 110000,
120: "maximum": 1,
120: "minimum": 0,
120: "name": "ScanDirectionFlag",
120: "position": 6,
120: "stddev": 0.4999199512,
120: "variance": 0.2499199576
120: },
120: {
120: "average": 0,
120: "count": 110000,
120: "maximum": 0,
120: "minimum": 0,
120: "name": "EdgeOfFlightLine",
120: "position": 7,
120: "stddev": 0,
120: "variance": 0
120: },
120: {
120: "average": 1.237336364,
120: "count": 110000,
120: "maximum": 2,
120: "minimum": 1,
120: "name": "Classification",
120: "position": 8,
120: "stddev": 0.4254520651,
120: "variance": 0.1810094597
120: },
120: {
120: "average": -8.288418182,
120: "count": 110000,
120: "maximum": -1,
120: "minimum": -18,
120: "name": "ScanAngleRank",
120: "position": 9,
120: "stddev": 2.643634952,
120: "variance": 6.98880576
120: },
120: {
120: "average": 125.1248727,
120: "count": 110000,
120: "maximum": 135,
120: "minimum": 117,
120: "name": "UserData",
120: "position": 10,
120: "stddev": 2.710253416,
120: "variance": 7.345473579
120: },
120: {
120: "average": 7326,
120: "count": 110000,
120: "maximum": 7326,
120: "minimum": 7326,
120: "name": "PointSourceId",
120: "position": 11,
120: "stddev": 0,
120: "variance": 0
120: },
120: {
120: "average": 111.4174727,
120: "count": 110000,
120: "maximum": 236,
120: "minimum": 40,
120: "name": "Red",
120: "position": 12,
120: "stddev": 36.82992919,
120: "variance": 1356.443684
120: },
120: {
120: "average": 119.7139,
120: "count": 110000,
120: "maximum": 228,
120: "minimum": 55,
120: "name": "Green",
120: "position": 13,
120: "stddev": 30.09249902,
120: "variance": 905.5584973
120: },
120: {
120: "average": 99.43662727,
120: "count": 110000,
120: "maximum": 219,
120: "minimum": 52,
120: "name": "Blue",
120: "position": 14,
120: "stddev": 24.45077989,
120: "variance": 597.840637
120: },
120: {
120: "average": 245383.3992,
120: "count": 110000,
120: "maximum": 245385.9111,
120: "minimum": 245379.3984,
120: "name": "GpsTime",
120: "position": 15,
120: "stddev": 1.723592276,
120: "variance": 2.970770333
120: },
120: {
120: "average": 0,
120: "count": 110000,
120: "maximum": 0,
120: "minimum": 0,
120: "name": "Synthetic",
120: "position": 16,
120: "stddev": 0,
120: "variance": 0
120: },
120: {
120: "average": 0,
120: "count": 110000,
120: "maximum": 0,
120: "minimum": 0,
120: "name": "KeyPoint",
120: "position": 17,
120: "stddev": 0,
120: "variance": 0
120: },
120: {
120: "average": 0,
120: "count": 110000,
120: "maximum": 0,
120: "minimum": 0,
120: "name": "Withheld",
120: "position": 18,
120: "stddev": 0,
120: "variance": 0
120: },
120: {
120: "average": 0,
120: "count": 110000,
120: "maximum": 0,
120: "minimum": 0,
120: "name": "Overlap",
120: "position": 19,
120: "stddev": 0,
120: "variance": 0
120: }
120: ],
120: "pc:type": "lidar",
120: "proj:bbox":
120: [
120: 636001.76,
120: 848935.2,
120: 406.26,
120: 637179.22,
120: 849497.9,
120: 520.51
120: ],
120: "proj:geometry": { "type": "Polygon", "coordinates": [ [ [ 636001.76, 848935.200000000069849, 406.26 ], [ 636001.76, 849497.900000000023283, 406.26 ], [ 637179.21999999997206, 849497.900000000023283, 520.51 ], [ 637179.21999999997206, 848935.200000000069849, 520.51 ], [ 636001.76, 848935.200000000069849, 406.26 ] ] ] },
120: "proj:projjson": {
120: "type": "ProjectedCRS",
120: "name": "NAD_1983_HARN_Lambert_Conformal_Conic",
120: "base_crs": {
120: "name": "NAD83(HARN)",
120: "datum": {
120: "type": "GeodeticReferenceFrame",
120: "name": "NAD83 (High Accuracy Reference Network)",
120: "ellipsoid": {
120: "name": "GRS 1980",
120: "semi_major_axis": 6378137,
120: "inverse_flattening": 298.257222101004
120: },
120: "id": {
120: "authority": "EPSG",
120: "code": 6152
120: }
120: },
120: "coordinate_system": {
120: "subtype": "ellipsoidal",
120: "axis": [
120: {
120: "name": "Longitude",
120: "abbreviation": "lon",
120: "direction": "east",
120: "unit": "degree"
120: },
120: {
120: "name": "Latitude",
120: "abbreviation": "lat",
120: "direction": "north",
120: "unit": "degree"
120: }
120: ]
120: }
120: },
120: "conversion": {
120: "name": "unnamed",
120: "method": {
120: "name": "Lambert Conic Conformal (2SP)",
120: "id": {
120: "authority": "EPSG",
120: "code": 9802
120: }
120: },
120: "parameters": [
120: {
120: "name": "Latitude of false origin",
120: "value": 41.75,
120: "unit": "degree",
120: "id": {
120: "authority": "EPSG",
120: "code": 8821
120: }
120: },
120: {
120: "name": "Longitude of false origin",
120: "value": -120.5,
120: "unit": "degree",
120: "id": {
120: "authority": "EPSG",
120: "code": 8822
120: }
120: },
120: {
120: "name": "Latitude of 1st standard parallel",
120: "value": 43,
120: "unit": "degree",
120: "id": {
120: "authority": "EPSG",
120: "code": 8823
120: }
120: },
120: {
120: "name": "Latitude of 2nd standard parallel",
120: "value": 45.5,
120: "unit": "degree",
120: "id": {
120: "authority": "EPSG",
120: "code": 8824
120: }
120: },
120: {
120: "name": "Easting at false origin",
120: "value": 1312335.95800525,
120: "unit": {
120: "type": "LinearUnit",
120: "name": "foot",
120: "conversion_factor": 0.3048
120: },
120: "id": {
120: "authority": "EPSG",
120: "code": 8826
120: }
120: },
120: {
120: "name": "Northing at false origin",
120: "value": 0,
120: "unit": {
120: "type": "LinearUnit",
120: "name": "foot",
120: "conversion_factor": 0.3048
120: },
120: "id": {
120: "authority": "EPSG",
120: "code": 8827
120: }
120: }
120: ]
120: },
120: "coordinate_system": {
120: "subtype": "Cartesian",
120: "axis": [
120: {
120: "name": "Easting",
120: "abbreviation": "",
120: "direction": "east",
120: "unit": {
120: "type": "LinearUnit",
120: "name": "foot",
120: "conversion_factor": 0.3048,
120: "id": {
120: "authority": "EPSG",
120: "code": 9002
120: }
120: }
120: },
120: {
120: "name": "Northing",
120: "abbreviation": "",
120: "direction": "north",
120: "unit": {
120: "type": "LinearUnit",
120: "name": "foot",
120: "conversion_factor": 0.3048,
120: "id": {
120: "authority": "EPSG",
120: "code": 9002
120: }
120: }
120: }
120: ]
120: }
120: },
120: "proj:wkt2": "PROJCS[\"NAD_1983_HARN_Lambert_Conformal_Conic\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Reference_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101004,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"latitude_of_origin\",41.75],PARAMETER[\"central_meridian\",-120.5],PARAMETER[\"standard_parallel_1\",43],PARAMETER[\"standard_parallel_2\",45.5],PARAMETER[\"false_easting\",1312335.95800525],PARAMETER[\"false_northing\",0],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"
120: },
120: "stac_extensions":
120: [
120: "https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json",
120: "https://stac-extensions.github.io/projection/v1.1.0/schema.json"
120: ],
120: "stac_version": "1.0.0",
120: "type": "Feature"
120: }
120: }
120: '
120: expected: '
120: "properties":
120: {
120: "datetime": "2015-09-10T00:00:00Z",
120: "pc:count": 110000,
120: "pc:encoding": ".las",
120: '
120:
120: [ FAILED ] Info.stac (921 ms)
120: [----------] 6 tests from Info (3295 ms total)
120:
120: [----------] Global test environment tear-down
120: [==========] 6 tests from 1 test suite ran. (3295 ms total)
120: [ PASSED ] 5 tests.
120: [ FAILED ] 1 test, listed below:
120: [ FAILED ] Info.stac
120:
120: 1 FAILED TEST
Failed
appears to be addressed in https://github.com/PDAL/PDAL/tree/issue-4389 but needs testing.