If you want to add details to the bookmarks such as the names or the project names then I think the only method is to access the SQLite database which stores these bookmarks. Using this great link as a guide, you could try running the following where you can define the field name, project name and the CRS:
layer = iface.activeLayer()
dbPath = ...
I think the simplest way to achieve what you are describing is by using Spatial Bookmarks:
A spatial bookmark identifies a particular geographic location that
you want to save and reference later. For example, you might create a
spatial bookmark that identifies a study area. As you pan and zoom
around your map, you can easily return to the study ...
The geospatial bookmarks are stored globally in the user's database at ~/.qgis2/qgis.db. None of the bookmarks are stored with the .qgs project file. There are two feature requests concerning this:
#1635: Add option for bookmarks: "this project only" (5 years old)
#7715: Import/export functionality for geospatial bookmarks
Storing some of the bookmarks in ...
I don't know if there's a limit to the number of bookmarks you can have, but if they are that important and there are that many then I would suggest a more permanent solution.
You could create a new layer and whenever you need to add a 'bookmark' just use the shape digitizing toolbar to add a rectangular feature (easiest would be the 'Add rectange from ...
My guess is that your data frame is not called 'test' so the call is returning an empty list.
This answer explains a similar call in a bit more detail: https://gis.stackexchange.com/a/80237/43
If you are adventurous, try:
df = arcpy.mapping.ListDataFrames(mxd, '')
This will return all the data frames in your MXD, then select the first one.
You can't do that using bookmarks in QGIS. Bookmarks' goal is panning and zooming to pre-defined extent. Carrying out that by programming/plugin via bookmarks doesn't make any sense, too. Because, bookmarks don't hold any layer information, like 'which layer was selected when bookmark created'.
A solution using CSV
First recipe not useful in your case. It exports project bookmarks to CSV within QGIS (change path to file if you want to use it). In your case, you should better look at 2nd recipe that read your CSV and add it. I got a remaining issue about refreshing corresponding bookmark panel in the GUI.
You also need to be aware there are 2 entry ...
You can use pan tool to move the extent, save the bookmark and than rewrite yMin and yMax values to required north-south extent.
Note: This is handy only if you have a few bookmarks. If you need a lots of them it will be better export a .xlm bookmark file, do some find and replace for yMin and yMax and import .xml file back.
The PyPDF2 module works as needed in this situation. The script no longer uses arcpy.mapping.PDFDocumentCreate. The combo-PDF is now created using the PyPDF2 module. In the below script, it begins with the output = PyPDF2.PdfFileMerger().
Because multiple users need to access the module across the office network, installing the module on my machine would ...
Since your error is Invalid destination path, the script doesn't like the output file name (presumably the two slashes at the end).
There are a few different ways to put that output name together. I'd personally do something like:
mxd = arcpy.mapping.MapDocument(r"C:\Users\Kim\Documents\Work_related\NursingSchool\P20_OnlineWellStudy\...
We were able to create a feature class by saving out the bookmarks as a .dat file then load that file into the My Places tool, then select them within the My Places dialog box, then click the Add To button and chose Map As Graphic Once you have a graphic then select all graphics within the map and use the Convert Graphics to Features then you can use the ...
I agree with @PolyGeo you will need ArcObjects to process the BookMarks. In fact it is not a straight forward just get the extent coordinates as there are 2 types of Bookmarks and you would deal with them differently: AOI and Feature bookmarks.
In fact if anyone can prove me wrong I don't think there is even an Interface that allows you to connect to an ...
As PolyGeo outlined, you cannot transfer bookmarks from one map document to another with arcpy. What you can do, however, is:
You can list your bookmarks in a map document with arcpy.ListBookmarks function (you will get name and extent). The extent information can be used to create features which you can save into a feature class (at least something).
To zoom in or out on the current extent of a map frame you should be able to use the scale property of the map frame's Camera object.
For example, this code will zoom out 5%:
mf.camera.scale = mf.camera.scale * 1.05
or in a more concise way, as suggested by @MarceloVilla-Piñeros:
mf.camera.scale *= 1.05
let's say YES, there is an option. Change to version 3.10 will change the position for bookmarks. From 3.10 on, they will be available in the browser menu, and you will not change them while clicking on the bookmark. So the best option will be updating QGIS to 3.10.
Rather than output bookmarks as an ArcGIS Place File (*.dat) you can use the ListBookmarks function of ArcPy which:
Returns a Python list of named tuples that provide access to each spatial bookmark's name and extent.
With that simple data structure available within Python you could write to a file format of your choice or just read it direct using PyQGIS.
The function that you tried i.e. LoadSettings (arcpy) will load Geoprocessing environment settings:
Loads environment settings from an environment settings file (text
stored in an Extensible Markup Language [XML] schema).
but Bookmarks are stored with the properties of a Data Frame object and so will not be altered by that.
However, there is an ...
Use the data driven pages tool in ArcGIS. You can point the tool at your shape file and it will automatically generate a new page for each of your parcels.
It is then possible to export each of these as separate PDF or as a single PDF from the normal export map dialog.
If you're actually exporting maps in different projections, as your first sentence says, the maps probably won't line up even at the same scale. Different projections have different distortions of shape, area, distance, and direction. Sometimes it's subtle, and sometimes it's extreme.
If you're actually using the same projection and just want to create an ...
The distance by which the canvas is moved with the arrow keys depends on the current width/height.
If you first zoom into the scene (Page Up or scale combobox) you can pan with the arrow keys in smaller steps. Finally zoom out again (Page Down or scale combobox) to revert to the original scale.
Someone at work just pointed the problem out to me, I had the wrong Data Frame was selected.
I don't think it is documented anywhere that Bookmarks are tied to the Data Frame rather than the Map but it makes sense because data frames can be displayed in different coordinate systems with different units and a bookmark is effectively just four numbers and a ...
This is the code for a script tool I use for such tasks (exporting to PDF), it works just fine. Just adapt the script in order to produce an .ai file. (more information on how to set up a script tool can be found here)
There are a few downsides to this method however: you cannot easily switch layers on / off with this script (as mentioned in the comments, ...
From the documentation, listBookmarks can take a wildcard to search on. You cannot pass three parameters to it, like you are doing.
Try something like:
bkmks = mf.map.listBookmarks('A*')
One alternative would be to retrieve all the bookmarks, then in your loop below, check to see if they are in your list.
# add name of bookmark
bkmks = mf.map....
If I remember correctly, QGIS 3 asked me at first start whether it should adopt settings from QGIS 2 or I wish a clean QGIS 3 start. Not unlikely, that your bookmarks might have been converted via adopting settings from QGIS 2.
The other way is (or as least should be...) exporting your bookmarks in QGIS 2 and re-importing them in QGIS 3 this way:
I just ...
QGIS Bookmarks are saved in qgis.db (SQLite Database) under your profile folder. You can view this folder by clicking on "Settings->Open Active Profile Folder" as show below
On windows you will find it in C:\Users\Me\AppData\Roaming\QGIS\QGIS3\profiles\default
Please include this folder in your backup so that you can retrieve all profile related settings ...
Working from @PolyGeo's answer, here's some code that gets the info out of ArcMap:
srcPath = "D:\\SomeFolder\\Data\\"
srcFile = "MyMap.mxd"
# set working mxd
mxd = arcpy.mapping.MapDocument(srcPath+srcFile)
with open(srcPath+'filename.txt', "w") as outtxt:
for df in arcpy.mapping.ListDataFrames(mxd,"*"):...