Printing the first point¶
Exercise¶
This exercise uses PDAL to print information from the first point. Issue the following command in your Docker Quickstart Terminal.
1 2 | docker run -v /c/Users/Howard/PDAL:/data -t pdal/pdal \
pdal info /data/exercises/info/interesting.las -p 0
|
Here’s a summary of what’s going on with that command invocation
docker: We are running PDAL within the context of docker, so all of our commands will start with thedockercommand.run: Tells docker we’re going to run an image-v /c/Users/Howard/PDAL:/data: Maps our workshop directory to a directory called/datainside the container.See also
The Docker Volume document describes mounting volumes in more detail.
pdal/pdal: This is the Docker image we are going to run. We fetched it in the Install Docker portion of the workshop.pdal: We’re finally going to run thepdalapplication :)info: We want to run info on the data. All commands are run by thepdalapplication./data/exercises/info/interesting.las: Thepdalcommand is now running in the context of our container, which we mounted a/datadirectory in with the volume mount operation in Step #3. Ourinteresting.lasfile resides there.-p 0:-pcorresponds to “print a point”, and0means to print the first one (computer people count from 0).
Notes¶
- PDAL uses JSON as the exchange format when printing information from info. JSON is a structured, human-readable format that is much simpler than its XML cousin.
- You can use the writers.text writer to output point attributes to CSV format for other processing.
- Output help information on the command line by issuing the
--helpoption - A common query with
pdal infois--all, which will print all header, metadata, and statistics about a file. - In the command, we add the
\character for line continuation. All items on thedocker runcommand must be on the same line. You will see this convention throughout the workshop to make the command easier to read, but remember that everything needs to be on one line.