HOW TO
The script in this article uses the Mosaic request to merge two or more grids into one grid theme. This code and data type require the Spatial Analysis extension.
Code:
'-- Script: Grid_mosaic.ave
v = av.getactivedoc
gthemes = v.getthemes
gthms = list.make
for each t in gthemes
if (t.is(gtheme)) then
gthms.add(t)
else
continue
end
end
if (v.getactivethemes.count < 1) then
msgbox.info("Active theme must be a Grid theme","")
exit
end
g1 = v.getactivethemes.get(0)
if (g1.is(gtheme).not) then
msgbox.info("Active theme must be a Grid theme","")
exit
end
gthms2 = gthms-{g1}
mrglist = msgbox.multilist(gthms2,
"Pick grid(s) to mosaic with"++g1.getname,
"Create Grid Mosaic")
if (mrglist= nil) then exit end
thegridlist = list.make
for each gt in mrglist
gr = gt.getgrid
thegridlist.add(gr)
end
outgrid = g1.getgrid.mosaic(thegridlist)
newtheme = gtheme.make(outgrid)
v.addtheme(newtheme)
v.invalidate
Article ID:000004041
Get help from ArcGIS experts
Download the Esri Support App