Select to view content in your preferred language

Load Sentinel 2 images on ArcGIS Pro python notebook

674
1
02-09-2022 05:51 AM
MVAC
by
Occasional Contributor

Hello,

I downloaded a Sentinel-2A tile. The folder structure is shown below:

MVAC_0-1644414448553.png

I want to open this images on my ArcGIS Pro notebook. I've tried with rasterio and gdal but it doesnt work. So, I tried  with Raster() but it doesnt work either. I might be doing something wrong.

 

# images path
imagePath = r'C:\TEST\sentinel\S2A_MSIL2A_20220102T095411_N0301_R079_T33SVV_20220102T114458.SAFE\GRANULE\L2A_T33SVV_A034110_20220102T095409\IMG_DATA\R10m'

# open sentinel images
sentinel = [gdal.Open(imagePath) for img in imagePath]
sentinel

 

 

Thanks!

1 Reply
AndrewBartle
Emerging Contributor

Hi

I've used composite bands to create a raster first. The variables in band_string are paths to the image for each band you require. Perhaps not the most efficient solution.

band_string = f"{SA2_10m_B02};{SA2_10m_B03};{SA2_10m_B04};{SA2_20m_B05};{SA2_20m_B06};{SA2_20m_B07};{SA2_10m_B08};{SA2_20m_B8A};{SA2_20m_B11};{SA2_20m_B12}"
output_raster = os.path.join(project_path, "export_raster.gdb", sub_dir)
arcpy.CompositeBands_management(band_string, output_raster)

 

0 Kudos