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

2023-04-25 Thread Loren Dawe via QGIS-User
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  
Sent: Sunday, April 9, 2023 8:47 AM
To: Loren Dawe 
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-requ...@lists.osgeo.org wrote:
> Date: Tue, 4 Apr 2023 23:51:14 +
> From: Loren Dawe 
> To:"qgis-user@lists.osgeo.org"  
> Subject: [Qgis-user] Zoom QGIS to specific location by command line 
> Message-ID:<3ab1e395443e43f2923ca5668ea21...@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.

___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


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

2023-04-05 Thread Loren Dawe via QGIS-User
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  
Sent: Tuesday, April 4, 2023 7:19 PM
To: qgis-user@lists.osgeo.org
Cc: Loren Dawe 
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.
___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user