AnsweredAssumed Answered

Arcpy Export PNG shift result

Question asked by DEVAPPGIS on Sep 25, 2016
Latest reply on Sep 25, 2016 by DEVAPPGIS

Hi at all,

on my python script i set the Coordinate System for Data Frame of mxd and after a Zoom To function on firsy layer into list i export mxd as PNG.

This is my code:

mxd = arcpy.mapping.MapDocument('current')
        df = arcpy.mapping.ListDataFrames(mxd)[0]
        df.spatialReference = prjFile
        add_layer = arcpy.mapping.Layer("costumers_" +str(j)+".tif")
        arcpy.mapping.AddLayer(df, add_layer, "TOP")
        reclass_raster_lyr = arcpy.mapping.ListLayers(mxd)[0]


        arcpy.ApplySymbologyFromLayer_management(reclass_raster_lyr, Temp_Symbology)
        if reclass_raster_lyr.symbologyType == "RASTER_CLASSIFIED":
            reclass_raster_lyr.symbology.excludedValues = excludedValues


        lyrPolygonj = arcpy.mapping.Layer("customerlyr"+str(j))
        df.extent = lyrPolygonj.getSelectedExtent()
        lyrPolygonj.visible = False


        strAux = listRow[j].split(" ")[1::]
        strOutput = date + " " + " ".join(x for x in strAux) + ".tif"
        world_file = True
        arcpy.mapping.ExportToPNG(mxd, strOutput,df, 10199, 7688,820,world_file = world_file, background_color = "255,255,255",transparent_color = "255,255,255")


but when i run this script on ArcMap 10.2 the result is correct.

When i run on ArcMap 10.1 the png result is not correct, i mean that if i add it into map this png have a shift respect the position of original file into mxd.

I have try to execute manually the export png into arcmap 10.1 and the result is correct.

So why in my script on 10.1 the result is shift?