AnsweredAssumed Answered

specify spatial reference for ExportToPNG

Question asked by huttarl on Jan 23, 2013
Latest reply on Jan 23, 2013 by huttarl
Hi,
We're using ExportToPNG() to export an image from a data frame, but we're also separately and "manually" writing out coordinates to HTML image maps. (By "manually", I mean we're not using a builtin package tool such as "ExportToHTMLIMageMap().")

Our problem is that the two don't align; the projection is apparently different. E.g. North America is "taller" (more stretched) in the exported HTML coordinates. Here is a screenshot in browser; the black outline shows the HTML image map coordinates:

[ATTACH=CONFIG]20995[/ATTACH]

When we export the coordinates to HTML, we're doing an explicit projection (Project_management()), specifying the spatial reference of the data frame (df.spatialReference).

But when we export the image using ExportToPNG(), there seems to be no way to specify a projection or spatial reference. Does anybody know how ExportToPNG() decides what projection to use, or how we can influence it? In ExportToLayoutGeoTIFF() you can supply a data frame for the spatial reference, but not in ExportToPNG().

Ideas we have currently...

  1. Set it in the environment, e.g.: arcpy.env.outputCoordinateSystem = df.spatialReference

  2. Tell ExportToPNG() to output a georeferenced world file, then try to examine the world file to see what "pixel scale information and real-world coordinate information" it contains (how do we examine it?)

  3. Before ExportToPNG(), do an explicit Project_management() with the data (as we do before the HTML coordinate export), allowing us to specify the spatial reference. Repoint layers that use this data to use the new, projected data. I believe I was told that data frames (data view) show data in geographic coordinates, not projected coordinates, so I don't know if this would have any effect, or is even coherent.

Any suggestions would be appreciated.

Attachments

Outcomes