PDAL / java

Java extension and bindings for PDAL
https://pdal.io/java.html
Other
8 stars 10 forks source link

PythonFilter gives invalid syntax #9

Closed romulogoncalves closed 5 years ago

romulogoncalves commented 6 years ago

When building the following pipeline:

val pipelineExpr = LasRead("/data/local/home/ecolidar/C_25EZ2.laz", compression = Option("laszip"), spatialreference = Option("EPSG:4326")) ~ PythonFilter( source = "/data/local/jupyterhub/modules/python/laserchicken/laserchicken/sigma_z_PDAL.py", script = "sigma_z_PDAL.py", function = "filter", module = "anything")// ~ LasWrite(file_out, compression = compression_type)

We get the following error:

terminate called after throwing an instance of 'pdal::pdal_error'
what():  SyntaxError('invalid syntax', ('anything', 1, 1, '/data/local/jupyterhub/modules/python/laserchicken/laserchicken/sigma_z_PDAL.py\n'))

It is also not clear from the documentation of PDAL what means script and source. It says that The literal Python code to execute, when the script option is not being used., but the option script is not optional.

Any suggestion?

pomadchin commented 6 years ago

To mark it as optional, the workaround is to use RawExpr type at the moment:

RawExpr(Map("type" -> "filters.crop").asJson)
// RawExpr accepts circe.Json object
RawExpr(Json.obj(...))

Also feel free to create PRs with these minor fixes.

romulogoncalves commented 6 years ago

Ok,we will create PRs when suggesting these type of fixes.