How to install python pdal on Mac?

454 Views Asked by At

I'm installing python pdal on my new Mac. This Mac runs python 3.6 and anaconda has been already installed. While trying to install pdal using command line "pip install pdal" which is recommanded by pdal documentation, I got error msg: No such file or directory: 'pdal-config': 'pdal-config'

Then I'm trying to build a new environment in Anaconda and download pdal, which is suggested by a forum user. So I used command "conda create -n pdalenv -c conda-forge python-pdal". Everything goes well and pdal can be imported in Jupyter notebook. However, I got error msg when using pdal to process a LAS file: RuntimeError: filters.smrf: No returns to process.

In fact, I have another old computer which installed pdal correctly and no error occurs when I run my python code.

I've seen someone else suggests to use brew install to deal with it, but I haven't tried that yet. I don't wanna make my computer environment a mess.

So I just wait here to see if someone has a good idea dealing with it. Or could someone tell me how to do it correctly? The python code is:

pip = json.dumps(
{
"pipeline": [
"../data/p2.las",
{
  "type":"filters.smrf"
},
{
  "type":"filters.hag"
},
{   "type":"filters.eigenvalues",
        "knn":16},
{   "type":"filters.normal",
        "knn":16}
]})        
pipeline = pdal.Pipeline(pip)
pipeline.validate()
p = pipeline.execute()
2

There are 2 best solutions below

0
On BEST ANSWER

Finally, I solved my problem by cloning the old Mac to my new Mac. Anyway, I can work on my new Mac and PDAL package can be imported and is working smoothly.

Thanks all who viewing my question and responding to it.

Best, YUN ZHAO

2
On

You should take a look at the return information in your input point cloud. The default behavior of SMRF is to process last-of-many (ReturnNumber == NumberOfReturns > 1) and only (NumberOfReturns == 1) returns. If it finds no points meeting these criteria, then it has nothing to process.

You could pass "returns":"first,last,intermediate,only" as an additional option on the filters.smrf stage to instruct it to process all of the points.