I am using snap 8 using command line. For my application, I perform collocation of sentinel-1 and sentinel-2 images and then crop it using the subset operator (parameter ). This works fine in my local windows pc, but when I run it on a remote linux server, the cropping does not happen and the whole image is returned.
The following is my graph:
My code is as follows:snap_command_line_code.xml (10.3 KB) .
Any help would be highly appreciated.
Inside your graph, the subset area is defined as
is this stored separately? Maybe it is better to usegeographic coordinates as WKT instead which is permanently stored in the xml.
Thank you for your reply.
Actually, I pass the parameter using a python script because I do it in a batch mode. Therefore, I cannot permanently store it in the xml script
gpt snap_command_line_code.xml -PS1=“S1A_IW_GRDH_1SDV_20200501T002748_20200501T002813_032364_03BF11_C77D.zip” -PS2=“S2A_MSIL2A_20200428T050701_N0214_R019_T44RPR_20200428T093735.zip” -PCollocate_master=S2A_MSIL2A_20200428T050701_N0214_R019_T44RPR_20200428T093735 -PS1_write_path=S1.tif -PS2_write_path=S2.tif -Pbands_S1=Sigma0_VH_S,Sigma0_VV_S,collocationFlags -Pbands_S2=B1_M,B2_M,B3_M,B4_M,B5_M,B6_M,B7_M,B8_M,B8A_M,B9_M,B11_M,B12_M,opaque_clouds_10m_M,cirrus_clouds_10m_M,scl_cloud_shadow_M,scl_cloud_medium_proba_M,scl_cloud_high_proba_M,scl_thin_cirrus_M -PROI=“POLYGON ((82.90012866074581 27.37392568878827, 83.04988398417947 27.37459608107637, 83.04926516052893 27.30049194892273, 82.89935513118262 27.3001309684599, 82.90012866074581 27.37392568878827))”
Maybe @marpet has an idea
Unfortunately, I have no idea why it should work on Windows but not on Unix.
Thank you very much for your help.
I think the problem was due to using subprocess.run() in a python script. I was passing the parameters to the graph using the python script. I suppose that may be a problem due to formatting.
I managed to solve the issue by removing a space in the ROI_subset_string using the following code.
Thank you very much for looking into the issue.