ken25

gp ExportToPNG can't set the right extent

Discussion created by ken25 on Jun 19, 2013
Latest reply on Jun 21, 2013 by ken25
hello,i use arcpy.mapping to export e map,code like this:


mxdPath = "C:/dev/temp/base.mxd"
mxd = arcpy.mapping.MapDocument(mxdPath)

...load fc from shapefile...

arcpy.MakeFeatureLayer_management(fc,fname)
addLayer = arcpy.mapping.Layer(fname)
arcpy.mapping.AddLayer(df, addLayer)

arcpy.env.extent = arcpy.Extent(XMin=minX,YMin=minY,XMax=maxX,YMax=maxY)
    newExtent = df.extent
    newExtent.XMin, newExtent.YMin = minX, minY
    newExtent.XMax, newExtent.YMax = maxX, maxY
    df.extent = newExtent
ExportToPNG(mxd, outputPath,df,
                                   df_export_width=width,
                                   df_export_height=height,
                                   world_file=None,
                                   resolution=dpi)
i publish it as a gpsrvice,to export png


and then i publish another mapservice with the same shape file

when i add both service on the flex,
the basemap use the service publish by mapservice.
the second layer use the gpservice result.
request with same extent,same size,
but the export image is not the same,i can't find the reason,can you help me?

Attachments

Outcomes