[Qgis-user] script to simplify 'Set to Map Canvas Extent'

Willem Coetzer W.Coetzer at saiab.ac.za
Mon May 15 01:00:29 PDT 2017


I was amazed that QGIS doesn't have a button to simplify this critical function. Thank you Christine, I do appreciate the response. I found a script that makes a new composer and then zooms to the extent of the map canvas in the new composer, but the script is not ideal (dependent on objects that won't always be present e.g. the filename of the QGIS template). Ideally one should be able to create a new button on a toolbar and then simply associate the 'Set to Map Canvas Extent' function with the button. If that is not possible I guess the next best thing would be a python script that does the same i.e. zooms to the extent of the map in the active composer.

I teach basic GIS skills to non-technical people and without this simple function it will be very hard to make any progress. Even the default procedure is too complex for them to remember.

I strongly suggest that QGIS developers look at this.

I really expected the 'Refresh' button to refresh the zoom extent as well. Why wouldn't a user want to refresh the zoom extent when refreshing the display of layers? It doesn't make sense to me.

If anyone can help with that script I'd be grateful.



Somerset StreetWillem Coetzer
Grahamstown, 6139Biodiversity Information Manager
Private Bag 1015Tel:+27 46 603 5841
Grahamstown, 6140Fax:+27 46 622 2403
South AfricaEmail:mailto:W.Coetzer at saiab.ac.za
http://www.saiab.ac.za/
Disclaimer: http://www.nrf.ac.za/email-legal-notice.php

-----Original Message-----
From: Qgis-user [mailto:qgis-user-bounces at lists.osgeo.org] On Behalf Of qgis-user-request at lists.osgeo.org
Sent: 13 May 2017 09:00 PM
To: qgis-user at lists.osgeo.org
Subject: [Marketing Mail] Qgis-user Digest, Vol 135, Issue 17

Send Qgis-user mailing list submissions to
qgis-user at lists.osgeo.org

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
qgis-user-request at lists.osgeo.org

You can reach the person managing the list at
qgis-user-owner at lists.osgeo.org

When replying, please edit your Subject line so it is more specific than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. refresh zoom extent in composer (Willem Coetzer)
   2. Re: refresh zoom extent in composer (Christine)


----------------------------------------------------------------------

Message: 1
Date: Sat, 13 May 2017 10:44:44 +0000
From: Willem Coetzer <W.Coetzer at saiab.ac.za>
To: "qgis-user at lists.osgeo.org" <qgis-user at lists.osgeo.org>
Subject: [Qgis-user] refresh zoom extent in composer
Message-ID: <5f079d395252426b9a6f1f0d6af33499 at ZAGRH01EX02.saiab.local>
Content-Type: text/plain; charset="utf-8"

If the zoom extent in the view changes, is there a way to update the composer to reflect the same extent or do you need to create a new composer?

Thanks


[cid:image40e5f3.PNG at 44bf3bf6.42823550]<http://www.saiab.ac.za/>




Somerset Street
        Willem Coetzer

Grahamstown, 6139       Biodiversity Information Manager
Private Bag 1015        Tel:    +27 46 603 5841
Grahamstown, 6140       Fax:    +27 46 622 2403
South Africa    Email:  W.Coetzer at saiab.ac.za<mailto:W.Coetzer at saiab.ac.za>
http://www.saiab.ac.za/<http://http://www.saiab.ac.za/>


Disclaimer:<http://www.nrf.ac.za/email-legal-notice.php> http://www.nrf.ac.za/email-legal-notice.php


Please consider the environment before printing this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20170513/19d720de/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image40e5f3.PNG
Type: image/png
Size: 33578 bytes
Desc: image40e5f3.PNG
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20170513/19d720de/attachment-0001.png>

------------------------------

Message: 2
Date: Sat, 13 May 2017 06:42:50 -0700 (MST)
From: Christine <geo.guide at web.de>
To: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] refresh zoom extent in composer
Message-ID: <1494682970839-5320434.post at n6.nabble.com>
Content-Type: text/plain; charset=us-ascii

Willem Coetzer wrote
> If the zoom extent in the view changes, is there a way to update the
> composer to reflect the same extent or do you need to create a new
> composer?

Dear Willem,
you don't need to create a new composer. Procedure may depend on your QGIS version, in elder versions the window to select an item may be missing.

First select the map item in the composer view (right column). In the item properties tab (below) scroll to the extents section. There you can find the two buttons "set to map canvas extent" and "view extent in map canvas".

Click the first one to transfer your map window extent coordinates (your
"view") to your composer map extents (your "composer"). That's what you wanted to do as I understand it.

With the second button you might do the reverse: transfer the composer map extent coordinates (your "composer") to your map window (your "view").

Regards, Christine




--
View this message in context: http://osgeo-org.1560.x6.nabble.com/refresh-zoom-extent-in-composer-tp5320428p5320434.html
Sent from the QGIS - User mailing list archive at Nabble.com.


------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 135, Issue 17
******************************************


More information about the Qgis-user mailing list