numpy array to raster

Discussion created by matthewb on Mar 14, 2013
Latest reply on Mar 17, 2013 by matthewb

I am iterating through a series of rasters and would like to mosaic the results, but don't have access to any tools that I would normally use because this is a Runtime SDK for WPF project using local server only. (Available tools:

One option I have tried is numpy.concatenate but this is only partially successful:


r2 is in the correct location, but r1 has shifted. No idea where the backwards 'F' came from.

Here's the code I'm using:

import arcpy
import numpy
from import *

r1 = Raster("ras1")
r2 = Raster("ras2")

arcpy.env.outputCoordinateSystem = r2.spatialReference

x = r2.extent.XMin
y = r2.extent.YMin

point = arcpy.Point(x,y)

a1 = arcpy.RasterToNumPyArray(r1)
a2 = arcpy.RasterToNumPyArray(r2)

b = numpy.concatenate((a1,a2))

c = arcpy.NumPyArrayToRaster(b,point,15)

Any ideas what I am missing?