1

Here's what my final result looks like

Image with unique value 1122

The workflow is quite simple but I cannot get it go right

Create first the mosaic dataset

arcpy.CreateMosaicDataset_management(in_workspace="<path>/xxx.gdb", in_mosaicdataset_name="B01", coordinate_system="PROJCS['WGS_1984_UTM_Zone_31N',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['false_easting',500000.0],PARAMETER['false_northing',0.0],PARAMETER['central_meridian',3.0],PARAMETER['scale_factor',0.9996],PARAMETER['latitude_of_origin',0.0],UNIT['Meter',1.0]];-5120900 -9998100 10000;-100000 10000;-100000 10000;0,001;0,001;0,001;IsHighPrecision", num_bands="", pixel_type="", product_definition="NONE", product_band_definitions="")

I then add my two adjacent (sslightly overlapping) rasters

arcpy.AddRastersToMosaicDataset_management(in_mosaic_dataset="<path>/xxx.gdb/B01", raster_type="Raster Dataset", input_path="B01_01;B01_04;",update_cellsize_ranges="UPDATE_CELL_SIZES", update_boundary="UPDATE_BOUNDARY", update_overviews="NO_OVERVIEWS", maximum_pyramid_levels="", maximum_cell_size="0", minimum_dimension="1500", spatial_reference="", filter="#", sub_folder="SUBFOLDERS", duplicate_items_action="ALLOW_DUPLICATES", build_pyramids="NO_PYRAMIDS", calculate_statistics="NO_STATISTICS", build_thumbnails="NO_THUMBNAILS", operation_description="#", force_spatial_reference="NO_FORCE_SPATIAL_REFERENCE")

Statistics:

arcpy.CalculateStatistics_management(in_raster_dataset="<path>/xxx.gdb/B01")

Color Balancing (if I do not do this, I got an end result where there's no unique value, but the color difference in both image is too bad)

arcpy.ColorBalanceMosaicDataset_management(in_mosaic_dataset="<path>/xxx.gdb/B01", balancing_method="DODGING", color_surface_type="FIRST_ORDER", target_raster="", exclude_raster="", stretch_type="NONE", gamma="1", block_field="")

arcpy.BuildOverviews_management(in_mosaic_dataset="<path>/xxx.gdb/B01", where_clause="", define_missing_tiles="DEFINE_MISSING_TILES", generate_overviews="GENERATE_OVERVIEWS", generate_missing_images="GENERATE_MISSING_IMAGES", regenerate_stale_images="REGENERATE_STALE_IMAGES")

The part where I create the unique output end document

arcpy.MosaicToNewRaster_management(input_rasters="<path>/xxx.gdb/B01", output_location="<path>/xxx.gdb", raster_dataset_name_with_extension="xxx_B01", coordinate_system_for_the_raster="", pixel_type="16_BIT_UNSIGNED", cellsize="", number_of_bands="1", mosaic_method="LAST", mosaic_colormap_mode="FIRST")

Creating Statistics is of no help

arcpy.CalculateStatistics_management(in_raster_dataset="<path>/xxx.gdb/xxx_B01")
3
  • Welcome to GIS SE Daniel. Could you please describe the input data in more detail? What type of raster data (e.g. satellite imagery etc). I'm wondering if the bit depth is off for the mosaic?
    – Aaron
    Sep 17, 2016 at 14:44
  • Input data are Sentinel-2 data imported into a gdb. Bit depth of both images is 16 unsigned. Overlap between images is 15km Sep 18, 2016 at 10:50
  • Try Append tool in ArcMap. I tried and it worked for me.
    – Rishi
    May 28, 2018 at 4:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.