Get the value of a pixel.
This application gives the value of a selected pixel. There are three ways to designate a pixel, with its index, its physical coordinate (in the physical space attached to the image), and with geographical coordinate system. Coordinates will be interpreted differently depending on which mode is chosen.
This application has several output images and supports “multi-writing”. Instead of computing and writing each image independently, the streamed image blocks are written in a synchronous way for each output. The output images will be computed strip by strip, using the available RAM to compute the strip size, and a user defined streaming mode can be specified using the streaming extended filenames (type, mode and value). Note that multi-writing can be disabled using the multi-write extended filename option: &multiwrite=false, in this case the output images will be written one by one. Note that multi-writing is not supported for MPI writers.
-in image Mandatory
-coordx float Mandatory
This will be the X coordinate interpreted depending on the chosen mode
-coordy float Mandatory
This will be the Y coordinate interpreted depending on the chosen mode
Coordinate system used to designate the pixel
-mode [index|physical|epsg] Default value: index
Different modes can be selected, default mode is Index.
This mode uses the given coordinates as index to locate the pixel.
- Image physical space
This mode interprets the given coordinates in the image physical space.
- EPSG coordinates
This mode interprets the given coordinates in the specified geographical coordinate system by the EPSG code.
From the command-line:
otbcli_PixelValue -in QB_Toulouse_Ortho_XS.tif -coordx 50 -coordy 100 -cl Channel1
import otbApplication app = otbApplication.Registry.CreateApplication("PixelValue") app.SetParameterString("in", "QB_Toulouse_Ortho_XS.tif") app.SetParameterFloat("coordx", 50) app.SetParameterFloat("coordy", 100) app.SetParameterStringList("cl", "Channel1") app.ExecuteAndWriteOutput()