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

Loren Dawe Loren.Dawe at terraremote.com
Tue Apr 25 12:57:14 PDT 2023


Hi All,

Finally had time to look into this. Command line that works is as follows:

qgis --project f:\qgis\WorldMap.qgs --extent -119.270002,46.195891,-119.263714,46.200514

where: 
- extent parameters are xmin,ymin,xmax,ymax
- project CRS units must match extent coordinates

Loren

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

-----Original Message-----
From: Mike Flannigan <mflan at mflan.com> 
Sent: Sunday, April 9, 2023 8:47 AM
To: Loren Dawe <Loren.Dawe at terraremote.com>
Subject: [External] [Qgis-user] Zoom QGIS to specific location by command line


How did this work out for you?
I am also interested in doing this.
Can you give an example command line argument?


Mike Flannigan
Houston, TX
281-286-6869
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.mflan.com_index.htm&d=DwICaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=6kvQ62QVrK2dV679VmN7CpDFtHmnVuFuQc4Ctbq_t8g&m=att5eJv7IamuCPbAN0OsG41PFTY9IriFNdk43iuZwTc&s=QNfLA21Czc8jItUL6RO65kDnLm_IENx1IRNpVdP6wIQ&e=


On 4/5/23 14:00, qgis-user-request at lists.osgeo.org wrote:
> Date: Tue, 4 Apr 2023 23:51:14 +0000
> From: Loren Dawe<Loren.Dawe at terraremote.com> 
> To:"qgis-user at lists.osgeo.org"  <qgis-user at lists.osgeo.org>
> Subject: [Qgis-user] Zoom QGIS to specific location by command line 
> Message-ID:<3ab1e395443e43f2923ca5668ea21792 at terraremote.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi,
> 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.
>
> Does anyone know of a method that this could be accomplished?
>
> I could generate a disk file containing the coordinates in any documented format if that is a solution (tried to use the Google Earth plugin and send a KML file but that doesn't work from the command line).
>
> QGIS 3.20.3
> Windows 10
>
> Thanks in Advance,
> Loren.



More information about the QGIS-User mailing list