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

  1. docker: We are running PDAL within the context of docker, so all of our commands will start with the docker command.

  2. run: Tells docker we’re going to run an image

  3. -v /c/Users/Howard/PDAL:/data: Maps our workshop directory to a directory called /data inside the container.

    See also

    The Docker Volume document describes mounting volumes in more detail.

  4. pdal/pdal: This is the Docker image we are going to run. We fetched it in the Install Docker portion of the workshop.

  5. pdal: We’re finally going to run the pdal application :)

  6. info: We want to run info on the data. All commands are run by the pdal application.

  7. /data/exercises/info/interesting.las: The pdal command is now running in the context of our container, which we mounted a /data directory in with the volume mount operation in Step #3. Our interesting.las file resides there.

  8. -p 0: -p corresponds to “print a point”, and 0 means to print the first one (computer people count from 0).

../../../_images/info-interesting-single-point.png

Notes

  1. 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.
  1. You can use the writers.text writer to output point attributes to CSV format for other processing.
  2. Output help information on the command line by issuing the --help option
  3. A common query with pdal info is --all, which will print all header, metadata, and statistics about a file.
  4. In the command, we add the \ character for line continuation. All items on the docker run command 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.