Exporting GeoTIFF aerials from Bing Maps layer

3893
1
01-13-2014 05:22 AM
ShaunCavey
New Contributor II
I work for a civil engineering firm that primarily does site design and land development.  My company only has bits and pieces of aerial photography for the 3 most popular counties we typically work in.  Therefore, I want to extract imagery from the Bing Maps layer using python so we have a complete set.  The kicker is that the exports must be TIFFs and must have the world file so when it's brought into AutoCAD it will project to the right place.

Has anyone tried to do this before?  I'm using Python and having relative success, but its not perfect.  I use a combination of the following functions.

arcpy.mapping.MapDocument
arcpy.mapping.ListDataFrames
dataframe.scale
extent.XMin
extent.YMin
panToExtent
arcpy.mapping.ExportToTIFF

I have two big issues:
1.  I do not know how to set my dataframe to an exact scale that I want.

I understand that I can set dataframe.scale to 24000, but when I check out the exported TIF it is completely different.  I feel like there is some conversion going on in the dataframe class when I set this particular scale parameter. 

2.  I do not know how to set the exact starting position of the dataframe.

For instance, it would be great to just throw my program an x,y location and scale and then it begins to build tiles around itself to the desired size.

Thoughts?!
1 Reply
JeffBarrette
Esri Regular Contributor
The easiest method is to export a layout.  Set the layout to be the size of the image your want to create, set the scale, set the data frame to be the size of the layout, and then export to tif.

BUT - because you want a geoTiff, you can't export a layout, you must export the Data Frame.  You are going to have to manipulate the the df_export_width and df_export_height parameters to achieve the result you want.  The help topic talks about this further:

"Controlling graphic quality of the generated image differs for page layout exports versus data frame exports. When exporting a page layout, control image detail by changing the resolution parameter. When exporting a data frame, keep the resolution parameter at its default value, and change the df_export_width and df_export_height parameters to alter image detail. The height and width parameters directly control the number of pixels generated in the export file and are only used when exporting a data frame. Images with larger numbers of pixels will have higher image detail. For most page layout exports, the default parameter values should generate good results and nice looking export images on the first try. For data frame exports, you may need to experiment with the df_export_width and df_export_height values a few times before getting the result you want."


You want to make sure your data frame in the application is the same aspect ratio as the width/height parameters for export.  If your resolution is 96 dpi and you export using the default width/height parameters (640,480) then your image will be 6.6" x 5".  So adjust your width/height until you get the desired scale.

Jeff

Jeff
0 Kudos