ArcToolbox -> Data Management Tools -> Raster -> Raster Dataset -> Mosaic To New Raster
The real oldie and goody is merge(), which with "real" Con was removed at 10.0. (Though the rough edges of the Mosaic tool have been smoothed a bit (haha). Mosaic, being a core raster tool, is not integrated in arcpy map algebra, which is a pity.
More map-algebra friendly replacements for the old (missing) merge function include:
- CellStatistics with the "DATA" parameter, using an appropriate statistics choice in case there is overlap (For example - "MAXIMUM" or "MEAN")
CellStatistics([raster1, raster2, raster3], "MEAN", "NODATA")
- Use Con and IsNull to get the first in the list that is non-NoData
Con(^ IsNull(raster1), raster1, Con(^ IsNull(raster2), raster2))) Con(^ IsNull(raster1), raster1, Con(^ IsNull(raster2), raster2, Con(^ IsNull(raster3), raster3)))
- You can still use SOMA (this is only supported for backwards compatibility).
expr = "merge({0}".format(",".join[str(r) for r in [raster1, raster2, raster3]]) tmpras = arcpy.CreateScratchName("","","raster") outras = Raster(arcpy.gp.SingleOutputMapAlgebra_sa(expr, tmpras))
Please join me and vote this up!
ideas.arcgis.com: Bring back Spatial Analyst Merge tool
UPDATE: I have posted an arcpy map algebra implementation of the old merge() functionality.
Implementing merge() in ArcPy map algebra
Hey Guys, thanks for all your help I actually used the Extract by Attributes tool SQL query Where "Rowid" =1 in the end.
all done and looking good now
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.