Mycomputer died. However, I had everything backed up on Dropbox. So when I got a new one, I was able to just download everything onto it, retaining the exact same file structure under C:. After installing QGIS (the same version, 3.4), everything looks good except that the Bookmarks panel is empty. My understanding is that QGIS now stores bookmarks in the project file. Either way, I'm puzzled about them having disappeared. A search of this site turned up nothing pertinent to this problem.
My final goal for the project is to give a person who is not familiar with GIS but who would like to see those interesting points and features easy access to this data. My idea was to use bookmarks, so people can select a point they would like to see and the program selects automatically the right zoom and place. It works kind of what I expected but when I select a bookmark with the wrong layer it just zooms to the right place but it doesn't change the layer.
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 spatial bookmark is a useful way of saving a geographical area so that you can easily return to it later. A bookmark saves your chosen map canvas extent so that you can use it to return to the same location again, without the need to pan and zoom. This is useful if you are working on the same area a lot and always need to navigate to this location before you can get started. It is also useful for ensuring that the map canvas extent can be set to exactly the same view.
Step 4: Make sure that the coordinate reference system and extent are correct. The default setting for extent is to calculate it from the current map canvas view. However, you can also choose to draw the area yourself on the map canvas or calculate it from the extent of a layer in your project.
You can access spatial bookmarks that you have created via View Show spatial bookmarks. This will open a browser panel on the left side of the QGIS interface. Bookmarks that have created are saved under "User bookmarks". Simply double-click on the name of the bookmark and QGIS will change the map canvas to that location.
When installing a new instance of QGIS for another user it would be useful to be able to able to import a list of standard geospatial bookmarks. The standard list could be created (and then exported) by the GIS team and distributed to all users.
QgsBookmarkManager handles the storage, serializing and deserializingof geographic bookmarks. Usually this class is not constructed directly, butrather accessed through a QgsProject via QgsProject.bookmarkManager(), or viathe application-wide bookmark store at QgsApplication.bookmarkManager().
Learn how to create and navigate to map bookmarks using python in QGIS as part of this preview chapter, Creating Dynamic Maps from QGIS Python Programming CookBook. With 140 short, reusable recipes to automate geospatial processes in QGIS, the QGIS Python Programming CookBook teaches readers how to use Python and QGIS to create and transform data, produce appealing GIS visualizations, and build complex map layouts.
Map Bookmarks allow you to save a location on a map in QGIS so you can quickly jump to points you need to view repeatedly without manually panning and zooming the map. PyQGIS does not contain API commands to read, write, and zoom to bookmarks. But fortunately QGIS stores the bookmarks in an SQLite database. Python has a built-in SQLite library we can use to manipulate bookmarks using the database API.
Map bookmarks store important locations on a map so you can quickly find them later.You can programmatically navigate to bookmarks by using the python sqlite3 library to access the bookmarks database table in the QGIS user database and then using the PyQGIS canvas API.
Manually load this layer into QGIS after extracting it from the zip file. Also make sure you completed the previous recipe titled Creating a Map Bookmark. You will need a bookmark named BSL for an area of interest in the above shapefile.
Reading and writing bookmarks with SQLite is straight forward even though its not part of the main PyQGIS API. Notice that bookmarks have a placeholder for a project name which you can use to filter bookmarks by project if needed.
Had the same problem and blugeoned a work-a-round out of my PC using Excel to get points for each bookmark - which were then used as an index for a map series. Basically you can export the bookmarks to a BKMX file, drag that into Excel (Excel recognises the rows as a bkmx is just xml I think), use text-to-columns, a filter, an INDIRECT formula, and some helper columns to transpose into a simple table with 'name' 'x' and 'y' columns. Then bring that back into Pro as XY point data.
It works very similarly to the solution posted by @JohnWatt here in the comments, but makes it a little more user friendly. Just export a .bkmx, specify the output folder, name, and coordinate system, and it creates a feature class for your bookmarks. @TomBole mentioned that you can use Bookmarks as the input for your map series which is true, but it is convenient to be able to set your extents as bookmarks and then also have an option for dynamic text fields.
I know this is an oldish post but just wanted to send some praise this direction as this is a great little tool, thank you!! It also gets around the issue of not being able to use Python to automate export of multiple PNGs from a Map Series as I can just convert these to shapefiles instead :). Nice!!!
I was able to take the toolbox that the previous Anonymous User provided and create the working script from the Python Snippet they provided. I haven't been able to take the snippet that you provided and get it functional. I'm fairly new to Python and I'm still learning much of the basics and fundamentals, but when I run the script it states that Line 16 IndexError: list index out of range. I'm sure that I'm doing something wrong but would greatly love to use your provided tool. Thank you for any help provided.
A curated QGIS news feed is now shown on the welcome page. This finally gives us a direct channel to push project news to ALL our users! Expect to see lots of interesting QGIS news, tips, and events coming your way!
When a layer path is fixed in a project, QGIS 3.10 will automatically scan through all other broken paths and try to auto-fix any others which were also pointing to the same original broken file path. Any change which speeds up fixing broken layer paths is a welcome change in our view!
We've totally revamped how spatial bookmarks are exposed and managed in QGIS 3.10. Spatial Bookmarks are now shown in the browser panel, and can be regrouped into custom, categorized folders. This offers a much easier way to navigate and manage your bookmarks.
Bookmarks can also now be dragged and dropped onto canvases, allowing secondary canvases to zoom to a particular bookmark. This allows bookmarks to play nice in multi-canvas projects, since you can drop them onto a specific canvas to zoom.
Ever spend 10 minutes painstakingly creating an interactive selection of features, only to accidentally deselect them all through an errant mouse click? If so, this feature is designed just for you! Now, you can restore a layer's selection following a selection clear operation via the new "Reselect Features" option in the Edit menu.
The idea was to parallelize for each layer the snap cache computing (sequential at the moment) and to make it non blocking. As a consequence it is still possible to use QGIS even if snap cache is currently building. User can for instance start to edit node while the snap cache build is in progress.
QGIS 3.10 includes the ability to directly use Project Templates from the welcome page. Additionally, you can now ship project templates to your whole organisation by placing them in a system folder, next to the already existing possibility to put it into a user profile folder.
We're passionate about making QGIS a user-friendly cartographic tool which is a joy to work with, so we've added a bunch of new shortcuts throughout the interface which allow you to copy and paste symbols from one part of QGIS to another. E.g, you can copy a symbol from a category and paste it directly onto another category, or a layout shape item, or inside the style manager dialog!
We've added a brand new "Center of segment" mode for placement of marker line or hashed lines symbols. This allows you to place markers or hash lines over the center point of individual line segments, exposing cartographic effects which were not possible before (and improving the quality of layers converted from ArcMap using the SLYR tool).
In previous QGIS releases, only string values of the format 'x,y' would be permitted for data-defined symbol and label offsets. We've listened to user feedback that this was confusing, and in QGIS 3.10 we now allow arrays of numbers as a valid expression result for offsets. E.g. "array(3,5)".
Now, the Style Manager dialog can be used to manage text formats (which store the font, color, buffers, shadows, and backgrounds of text formats) and layer-wide label settings. (A "text format" includes just font settings and other appearance related settings, while a "labe setting" also includes layer-type specific settings such as label placement, priority, and rendering settings).
Text Formats and Label Settings offer all the same functionality as you're used to for managing symbols and color ramps within styles, including import and export to XML files, tagging, smart groups, favoriting etc...
Alongside all the other exciting labeling improvements which we've landed in 3.10, we now allow use of marker symbols as a background for labels. This allows you to use all the rich functionality available for marker symbols as a background to labels, and complements the existing shapes and SVG background choices!
3a8082e126