[Qgis-user] [External] Zoom QGIS to specific location by command line

Loren Dawe Loren.Dawe at terraremote.com
Wed Apr 5 09:02:19 PDT 2023


Thanks Adam,
Looks like I missed the "--extents" command line somehow. I'll give that a try.
Loren.

________________________________________
Loren Dawe - Senior Geomatics Specialist
Terra Remote Sensing Inc.
250.656.0931

-----Original Message-----
From: Adam Nielsen <a.nielsen at shikadi.net> 
Sent: Tuesday, April 4, 2023 7:19 PM
To: qgis-user at lists.osgeo.org
Cc: Loren Dawe <Loren.Dawe at terraremote.com>
Subject: Re: [External] [Qgis-user] Zoom QGIS to specific location by command line

> I would like to zoom QGIS to a specific location (lat/lon coordinate) 
> or area (lat/lon bounding box) using a command line argument generated 
> outside of QGIS. I have looked through the available command line 
> arguments and cant see anything that will allow this.

I'm not sure whether you mean you want to load QGIS with a project showing a particular location, or whether QGIS is already running and you want to use a command line to zoom the already running QGIS to that location.

> Does anyone know of a method that this could be accomplished?

If you are loading a new QGIS instance it looks like --extent will open it with a specific view?

I'm not familiar enough with it to know what values to pass, but if you get the view how you want it then create a new spatial bookmark (on the View menu) and then look at the properties of that, it will show you the extents.  They appear to be lat/long if that's what your CRS uses.  If not, you might have to change the project CRS to one that uses lat/long.

Note that I haven't tested this and I'm new to QGIS myself, so my apologies if this turns out to be incorrect.

Cheers,
Adam.


More information about the QGIS-User mailing list