Hi,
I am working on a machine learning model that reads individual tiff files exported from a larger ArcGIS world basemap. My research partner created a great python script for the process and we've been very successful. I am trying to perfect the process and I was wondering how I could remove the text that reads "Source: Esri, Vantor, Earthstar Geographics, and the GIS User Community" from the bottom right corner of each exported tiff file? I've tried moving the dynamic text box out of the layout or making the text transparent in the layout view mapframe, yet when I run the python script (included below) each of the 3024 image cells contain this Service Layer Credit or Watermark (not sure which one this text is.)
import arcpy
import os
# --- Settings ---
aprx = arcpy.mp.ArcGISProject("CURRENT")
map_obj = aprx.listMaps("Map")[0] # your map name
layout = aprx.listLayouts()[0] # your layout name
map_frame = layout.listElements("MAPFRAME_ELEMENT")[0]
# Output folder for tiles - Charlie, change your output folder to make sense for your file directory
output_folder = r"C:\Users\cfhwc\Documents\ArcGIS\Projects\UkraineGeoAI\chernihiv_tiles"
os.makedirs(output_folder, exist_ok=True)
# Fishnet layer
fishnet_layer = None
for layer in map_obj.listLayers():
if layer.name == "chernihiv_fishnet":
fishnet_layer = layer
break
if not fishnet_layer:
print("Fishnet layer not found!")
else:
print(f"Found fishnet layer: {fishnet_layer.name}")
# --- Iterate through each fishnet cell and export ---
with arcpy.da.SearchCursor(fishnet_layer, ["OID@", "TileName", "SHAPE@"]) as cursor:
for i, row in enumerate(cursor):
oid, tile_name, shape = row
# Get the extent of this fishnet cell
extent = shape.extent
# Set the map frame to this extent
map_frame.camera.setExtent(extent)
# Export as TIFF
out_path = os.path.join(output_folder, f"{tile_name}.tif")
layout.exportToTIFF(out_path, 150)
print(f"Exported tile {i+1}: {tile_name}")
print(f"\nDone! All tiles exported to: {output_folder}")