The creation of the coordinates can be a bit tricky. You need to know the Java interface also a bit.
Maybe it is better to use the coordinatesFile parameter and specify the file which contains the coordinates.
I encountered the same problem that SNAP pop-up a message saying the points are successfully extracted , but no result export in the given folder. I am working on Sentinel-2 imagery, using GUI. I tried both “.xml” or “dim” input format, same problem. I think the problem in my case is the S-2 bands are different resolution in each band.
Your right, the multi-resolution could be the problem.
If you do the operation and the go to Help / Show Log Directory and then choose the messages.log file you will probably see the reasons why products have been refused.
The Pixel extraction definitely needs some review.
No, this is not possible.
You might want to read also this thread:
You can import the classified map into the sentinel image, and export altogether. Or you create masks based on the classes via the Band Maths expression and then export the data.
Hi marpet, can I read somewhere something more about a PixEx operator in python? If I understand well, I need to put some parmeters here -> GPF.createProduct(‘PixEx’, parameters, product). But what is the name of a parameter in a case of a coordinate (‘org.esa.snap.pixex.Coordinate’)?
And I have also problem with Coord creation. When I try exactly what you write, I got an error:
RuntimeError: no matching Java method overloads found
The code is:
from snappy import jpy
Coord = jpy.get_type(‘org.esa.snap.pixex.Coordinate’)
Date = jpy.get_type(‘java.util.Date’)
The java Date class does not understand the Python datetime object.
Try, removing datetime.datetime.utcnow() and call only Date()
What might also work is Coord('name1', 54.0, 10.0, none)if you don’t care about the time.
Regarding the parameters of PixEx you can find them when you call on the command line
gpt -h PixEx
For defining the array of Corrdinates you need to do the following:
I tried the following replies in order to extract the pixel value but still i got an error.
Traceback (most recent call last):
File “E:\diplomatiki\doriforikes\statistiki_analysi.py”, line 28, in
Coord(‘name1’,25.12,35.72,none)
NameError: name ‘none’ is not defined
The code i am using is
inf=‘E:\diplomatiki\S2A_MSIL1C.SAFE\S2A_MSL2A\S2A_MSIL2A_20170622T090021_N0205_R007_T35SLV_20170622T090154.SAFE\outputs/’
product=ProductIO.readProduct(inf+‘resample.dim’)
And as said in my post before, the ‘coordinates’ parameter needs as value an array of coordinates. But this can be of length one if there is only a single coordinate
Traceback (most recent call last):
File “E:\diplomatiki\doriforikes\statistiki_analysi.py”, line 24, in
Coord(‘name1’,25.12,35.72,None)
TypeError: ‘[Lorg.esa.snap.pixex.Coordinate;’ object is not callable
In addition you need to remove the leading ‘P’ from the parameter names. They are only needed on the command line. And you need to replace 1 by True and 0 by False.
I tried but when i checked my module i had an error my_coordinates[0]included_bands[0] = Coord(‘name1’,25.12,35.72,‘none’)
so i changed that to
my_coordinates[0]= Coord(‘name1’,25.12,35.72,‘none’)
and i the following error
Traceback (most recent call last):
File “E:\diplomatiki\doriforikes\statistiki_analysi.py”, line 18, in
my_coordinates[0]= Coord(‘name1’,25.12,35.72,‘none’)
NameError: name ‘Coord’ is not defined
Then i also tried to correct the mentioned error
using that my_coordinates[0]= (‘name1’,25.12,35.72,‘none’)
and i get the following error
Traceback (most recent call last):
File “E:\diplomatiki\doriforikes\statistiki_analysi.py”, line 18, in
my_coordinates[0]= (‘name1’,25.12,35.72,‘none’)
ValueError: cannot convert a Python ‘tuple’ to a Java ‘org.esa.snap.pixex.Coordinate’
I tried and i still get the first error i mentioned
Traceback (most recent call last):
File “E:\diplomatiki\doriforikes\statistiki_analysi.py”, line 18, in
my_coordinates[0] = Coord(‘name1’,25.12,35.72,‘none’)
NameError: name ‘Coord’ is not defined
Traceback (most recent call last):
File “E:\diplomatiki\doriforikes\statistiki_analysi.py”, line 18, in
my_coordinates[0] = Coord(‘name1’,25.12,35.72,‘none’)
RuntimeError: no matching Java method overloads found