Pixel Values Extractor Problems

Hello everyone,
I’m trying to obtain pixel values from geographic coordinates. I found a operator called “Extract Pixel Values”, that should extract pixel values corresponding to precise geographic coordinates. I would like to run it with snappy, but to better understand it, I tried more and more times to run it in SNAP software. But, unluckly, even though the operator works and the window of successful performance appears, I cannot find my results! I checked every time if I put the right directory, and I did it, as with every parameter. I will show a picture to clarify:

at this point, I tried to run this operator from Python with snappy, but another problem occurred:
RuntimeError: org.esa.snap.core.gpf.OperatorException: Invalid placemark file format:
at least the columns ‘Name’, ‘Lon’ and ‘Lat’ must be given.

but my pin file (a .txt file) containts everything corrected, as you can see in the attached file:
placemarks.txt (116 Bytes)

the part of code that I wrote to run the operator is this:
path_file = <<path of the .txt file with placemarks>>
path_products_descending = --path of where I want to put my final product–
path_master_descending = --path of the product–
master_descending = ProductIO.readProduct(str(path_master_descending)

parameters_pixex = HashMap()
parameters_pixex.put(“aggregatorStrategyType”, “no aggregation”)
parameters_pixex.put(“coordinatesFile”, str(path_file))
parameters_pixex.put(“dateInterpretationPattern”, “yyyyMMdd”)
parameters_pixex.put(“exportBands”, “true”)
parameters_pixex.put(“exportExpressionResult”, “true”)
parameters_pixex.put(“exportKmz”, “false”)
parameters_pixex.put(“exportMasks”, “false”)
parameters_pixex.put(“exportSubScenes”, “false”)
parameters_pixex.put(“exportTiePoints”, “true”)
parameters_pixex.put(“extractTimeFromFilename”,‘false’)
parameters_pixex.put(“filenameInterpretationPattern”, ‘{startDate}*{endDate}’)
parameters_pixex.put(“includeOriginalInput”, “false”)
parameters_pixex.put(“outputDir”, str(path_products_descending))
parameters_pixex.put(“outputFilePrefix”, ‘pixEx’)
parameters_pixex.put(“sourceProductPaths”, str(path_master_descending))
parameters_pixex.put(“windowSize”, “1”)
pixex = GPF.createProduct(“PixEx”, parameters_pixex, master_descending)

Can anyone help me with this issue? Thank you in advance

Hello Navre,

I think the problem is caused by the separator in the text file.
You need to use a tab between the columns, and you are using a space.

What type of data are you using? Maybe you are affected by this issue?
Pixel extraction failed - s2tbx - STEP Forum (esa.int)
There is also a ticket for it in our issue database.
[SNAP-659] Pixel Extraction does not inform properly that it does not work with multisize products

1 Like

Hi @marpet ,
Thank you for your rapid answer. You were right on the tab between the columns, but however the opertor doesn’t work for the same issue reported on the ticket. I will wait for further updates on the topic.
Thank you again

1 Like

We found with SeaDAS (based on SNAP, and Pixel Extraction should work the same way as SNAP does), if your point does not match with any pixels in the source file, Pixel Extraction will not create the text file, but it will say pixel extraction finished successfully.

Also check if your file is in the Output Directory you specified in the input/output panel, and the file should start with pixEx (or whatever you defined in File prefix)

1 Like