In this article you will learn how to export the bookmarks you create in an ArcMap file to an image file (JPG, JPEG, PNG, TIFF, GIF, among others) using Python. Of all the existing image formats you will learn how to do this in PNG format as it has an optimal balance between file size and image quality.
Bookmarks provide you with shortcuts to places of interest on a map that you are working on in ArcMap, to create them you must follow the instructions below:
How to create Bookmarks in ArcMAP (ArcGIS)
1) Place yourself in your site of interest (geographic location and/or terrain scene).
2) Go to the bookmarks button (a) and click on the Create Bookmark submenu (b).
3) Save the MXD file.
Bookmarks Manager
Among the management possibilities when working with bookmarks, there is the option to save them in a .dat file by pressing the “Save” button (e) in the “Bookmarks Manager” window (d), which appears after pressing the submenu “Manage Bookmarks...” (c) in the Bookmarks button (You can save all the Bookmarks created or a selection of them).
From the “Bookmarks Manager” window you can load Bookmarks from a .dat file by pressing the “Load...” (f) button, you can delete, move, edit and rename them, feel free to explore this feature; .dat files allow you to share those sites of interest between ArcMap users, however to share them to third parties who are not familiar with ArcMap you would have to export them to a more commonly used format, such as image files (.png, .jpg, etc), following the procedure below:
How to export an MXD to PNG
1) Open the MXD file with the created bookmarks. Go to the “Bookmarks” button on the top bar, and select one of the previously defined bookmarks that will appear as part of the displayed submenu (It is also possible to select the bookmarks from the Bookmarks Manager window).
2) Go to File.
3) Click “Export Map...” in the displayed submenu.
4) Choose the file name (a), the file type (b) and the resolution (c). Then press the “Save” button (d).
5) Repeat this procedure for each bookmark.
However, there is no way to export more than one bookmark at a time to image files, so you would have to repeat the procedure as many times as the number of bookmarks you want to share (which could be quite time consuming and tedious if there are dozens or hundreds of bookmarks), so I will show you how it can be much more efficient using Python code (Don't worry you don't need to know how to program to do it).
(Honestly this code was replaced from my arsenal by the one shown in my article “PYTHON GIS - Export Data Driven Pages to Image Files (JPG, JPEG, PNG, TIFF, GIF, etc.)”, but well it is always convenient to have more than one option, don't you think?)
How to export Bookmarks views with Python?
Step 1: Open a blank MXD file.
Step 2: Open the Python window in the Standard toolbar.
Step 3: Copy the following code into a notepad and replace the text C:\EJEMPLO\EJEMPLO.mxd in line #03 with the location and name of the .mxd file containing the bookmarks.
Step 4: In line #06 of the code replace C:\EJEMPLO with the location of the folder where you want to save the images.
Step 5 (optional): If the dataframe containing the bookmarks has a name other than Layers, replace the word Layers in line #03 with the custom name you are using.
After a few seconds you will see the images start to appear in PNG format in the output folder indicated in step 4 and in this way you can export to images the views indicated through bookmarks.
Notes:
- In line 07 you can modify the dpi with which the images are exported, currently it is set to 1000 dpi, which according to my experience is the best resolution for image files to be used in documents, The export time is directly proportional to the amount of dpi.
- In line 07 you can modify the type of image file you want, replacing the text ExportToPNG by any of the following options ExportToBMP, ExportToEMF, ExportToEPS, ExportToGIF, ExportToJPEG, ExportToSVG, ExportToTIFF; it is also necessary to modify in line 06 the text .png by the desired output format (.bmp, .emf, .eps, .gif, .jpg, .svg, .tif).
I hope you enjoyed this article, soon I will upload a video explaining the procedure that you can consult in this blog. Save my blog among your favorite links, I will be uploading many more tricks of this style, remember that you can send me your concerns in the contact page or leave your comment, I will be attentive to respond.






