[Qgis-user] Determining QGIS version on command line

2020-03-26 Per discussione Steve Malers
QGIS list:

I have tried to find the answer for this and hope the user community can
help.  I need a robust and consistent way to determine the QGIS version on
the command line that I can call from a bat file on Windows (and similar on
Linux), something like:  qgis-bin.exe --version

Background:  I am developing a complex Python tool that uses PyQGIS and
PyQt and is distributed as a virtual environment (venv) created using a
specific version of QGIS Python, for example QGIS 3.10 python37.  The
deployed environment requires that QGIS is installed separately  The run
script modifies its PYTHONPATH to include packages for PyQGIS and the
application. The venv includes a text file that indicates the QGIS version
that the venv was built with and verifies that a compatible QGIS is
installed.  The run script properly handles the typical case where
stand-alone QGIS is installed because it looks at the file path, such as
C:\Program Files\QGIS 3.10.  If it finds a match, then that version of QGIS
is used in PYTHONPATH and the application starts OK.

The problem is that if someone has not installed a stand-alone QGIS but has
installed OSGeo464 version (C:\OSGeo4W64), there is no indicator of QGIS
version in the installation folder.   I cannot find documentation for
qgis-bin.exe command line options and experiments did not show support for
--version or variants.  I could scrape the QGIS version from files
somewhere in the distribution but looking into the code it seems to get
complicated due to handoff from Python to C/C++ code.  If I can determine
the version I can check to make sure that the OsGeo4W64 QGIS version
matches that of the distributed venv.  Lacking this, the run script cannot
do the check.  Supporting OSGeo4W64 is needed because some development and
deployed environments use it.  My plan B is to write a simple Python
program to access the version from the Python side, making general
assumptions to get started, and then configure the main application startup.

Any help would be appreciated.

-- 
Steve Malers
Chief Executive Officer and Chief Technology Officer
Open Water Foundation
openwaterfoundation.org
Support the Open Water Foundation by selecting on smile.amazon.com

Open data.  Open software.   Open decisions with positive social impact.
___
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] CRS Issue

2020-03-26 Per discussione Priv.-Doz. Dr. Maria Shinoto
Great, I just opened this issue on github: 

CRS problems: EPSG code not correctly applied in QGIS 3.4 #35395

It is the first ticket that I open at github, if anything went wrong, please 
tell me. 

Best, 
Maria


> Am 27.03.2020 um 09:18 schrieb Nyall Dawson :
> 
> On Fri, 27 Mar 2020 at 09:54, Priv.-Doz. Dr. Maria Shinoto
>  wrote:
>> 
>> Thank you for looking into this. It seems to be related to the CRS problems 
>> I reported twice in the last weeks; here I get a non existent EPSG instead 
>> of the correct 6670; the name (2011 Plane Rectangular II -- for Kyūshū) is 
>> correct though.
>> 
>> If you need material, please tell me.
> 
> Can you open a ticket on
> https://github.com/qgis/QGIS/issues with a sample dataset which shows
> this issue?
> 
>> 
>> Maria
>> 
>> 
>>> Am 27.03.2020 um 07:07 schrieb Nyall Dawson :
>>> 
>>> On Fri, 27 Mar 2020 at 04:33, Tyler Veinot  wrote:
 
 All;
 For some reason my QGIS thinks all my data is in EPSG 2292 but Esri says 
 it is in EPSG 2954 2954 is the only ESPG we use but QGIS keeps defaulting 
 back to 2292, is there a way I can delete 2292 entirely?
>>> 
>>> I'd like to look into this. Can you open a ticket on
>>> https://github.com/qgis/QGIS/issues with a sample dataset which shows
>>> this issue?
>>> 
>>> Nyall
>>> ___
>>> 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
>> 

___
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] CRS Issue

2020-03-26 Per discussione Nyall Dawson
On Fri, 27 Mar 2020 at 09:54, Priv.-Doz. Dr. Maria Shinoto
 wrote:
>
> Thank you for looking into this. It seems to be related to the CRS problems I 
> reported twice in the last weeks; here I get a non existent EPSG instead of 
> the correct 6670; the name (2011 Plane Rectangular II -- for Kyūshū) is 
> correct though.
>
> If you need material, please tell me.

Can you open a ticket on
 https://github.com/qgis/QGIS/issues with a sample dataset which shows
this issue?

>
> Maria
>
>
> > Am 27.03.2020 um 07:07 schrieb Nyall Dawson :
> >
> > On Fri, 27 Mar 2020 at 04:33, Tyler Veinot  wrote:
> >>
> >> All;
> >> For some reason my QGIS thinks all my data is in EPSG 2292 but Esri says 
> >> it is in EPSG 2954 2954 is the only ESPG we use but QGIS keeps defaulting 
> >> back to 2292, is there a way I can delete 2292 entirely?
> >
> > I'd like to look into this. Can you open a ticket on
> > https://github.com/qgis/QGIS/issues with a sample dataset which shows
> > this issue?
> >
> > Nyall
> > ___
> > 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
>
___
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] CRS Issue

2020-03-26 Per discussione Priv.-Doz. Dr. Maria Shinoto
Thank you for looking into this. It seems to be related to the CRS problems I 
reported twice in the last weeks; here I get a non existent EPSG instead of the 
correct 6670; the name (2011 Plane Rectangular II -- for Kyūshū) is correct 
though.

If you need material, please tell me. 

Maria


> Am 27.03.2020 um 07:07 schrieb Nyall Dawson :
> 
> On Fri, 27 Mar 2020 at 04:33, Tyler Veinot  wrote:
>> 
>> All;
>> For some reason my QGIS thinks all my data is in EPSG 2292 but Esri says it 
>> is in EPSG 2954 2954 is the only ESPG we use but QGIS keeps defaulting back 
>> to 2292, is there a way I can delete 2292 entirely?
> 
> I'd like to look into this. Can you open a ticket on
> https://github.com/qgis/QGIS/issues with a sample dataset which shows
> this issue?
> 
> Nyall
> ___
> 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

___
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] CRS Issue

2020-03-26 Per discussione Nyall Dawson
On Fri, 27 Mar 2020 at 06:54, Jeff McKenna
 wrote:
>
> Hi Tyler,

> Now you might say 'but jeff I asked how to delete 2292...", well
> honestly I would not recommend it (others may recommend this, but I do
> not).  However if you wish to proceed here is a possible way (proceed at
> your own risk):
>
> open Command Prompt
> cd "C:\Program Files\QGIS 3.12\apps\qgis\resources"
> sqlite3 srs.db
>  .tables
>  .schema tbl_srs
>  select * from tbl_srs where srid = 2292;
>  delete from tbl_srs where srid = 2292;
>  .quit

I wouldn't suggest doing this approach on builds based on proj > 6
(i.e. 3.12). It won't change the CRS autodetection logic, and will
only have the effect of hiding that CRS as a choice when manually
picking a CRS.

All the CRS detection logic now happens in PROJ, not QGIS.

Nyall

>
> *restart QGIS
>
> -jeff
>
>
>
> --
> Jeff McKenna
> MapServer Consulting and Training Services
> https://gatewaygeomatics.com/
>
>
>
>
> On 2020-03-26 3:33 p.m., Tyler Veinot wrote:
> > All;
> > For some reason my QGIS thinks all my data is in EPSG 2292 but Esri says
> > it is in EPSG 2954 2954 is the only ESPG we use but QGIS keeps
> > defaulting back to 2292, is there a way I can delete 2292 entirely?
> > Thanks;
> > Tyler
> >
> >
> ___
> 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
___
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] CRS Issue

2020-03-26 Per discussione Nyall Dawson
On Fri, 27 Mar 2020 at 04:33, Tyler Veinot  wrote:
>
> All;
> For some reason my QGIS thinks all my data is in EPSG 2292 but Esri says it 
> is in EPSG 2954 2954 is the only ESPG we use but QGIS keeps defaulting back 
> to 2292, is there a way I can delete 2292 entirely?

I'd like to look into this. Can you open a ticket on
https://github.com/qgis/QGIS/issues with a sample dataset which shows
this issue?

Nyall
___
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] CRS Issue

2020-03-26 Per discussione Jeff McKenna

Hi Tyler,

EPSG:2292 was phased out in 90's (it is marked as 'depcrecated' and not 
included in the current EPSG registry), and replaced by EPSG:2954.  They 
actually contain the exact same PROJ parameters; meaning that if your 
local QGIS defaults to 2292 for a dataset you can safely proceed without 
any worry.


Future QGIS versions (and other FOSS4G tools) leveraging an updated PROJ 
db will likely solve this for you.


Now you might say 'but jeff I asked how to delete 2292...", well 
honestly I would not recommend it (others may recommend this, but I do 
not).  However if you wish to proceed here is a possible way (proceed at 
your own risk):


open Command Prompt
cd "C:\Program Files\QGIS 3.12\apps\qgis\resources"
sqlite3 srs.db
.tables
.schema tbl_srs
select * from tbl_srs where srid = 2292;
delete from tbl_srs where srid = 2292;
.quit

*restart QGIS

-jeff



--
Jeff McKenna
MapServer Consulting and Training Services
https://gatewaygeomatics.com/




On 2020-03-26 3:33 p.m., Tyler Veinot wrote:

All;
For some reason my QGIS thinks all my data is in EPSG 2292 but Esri says 
it is in EPSG 2954 2954 is the only ESPG we use but QGIS keeps 
defaulting back to 2292, is there a way I can delete 2292 entirely?

Thanks;
Tyler



___
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

[Qgis-user] CRS Issue

2020-03-26 Per discussione Tyler Veinot
All;
For some reason my QGIS thinks all my data is in EPSG 2292 but Esri says it
is in EPSG 2954 2954 is the only ESPG we use but QGIS keeps defaulting back
to 2292, is there a way I can delete 2292 entirely?
Thanks;
Tyler
___
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

[Qgis-user] SSH tunnel to remote PostGIS Backend

2020-03-26 Per discussione Gerald Kogler
Hi,
For security reasons I run my postgres servers with local access only
and then use an SSH tunnel. (Turning off passwords and relying on
key-based authentication hardens security even more.)

I tunnel the remote postgres port 5432 locally to port  using a ssh
config with something like:

ssh -L :localhost:5432 ssh_config_postgis

This works fine for Qgis creating a PostGIS connection with host
localhost and port .

Is there an Qgis inline or plugin solution - like it exists in pgadmin4
where I can specify a SSH Tunnel?

Thanks,
Gerald
___
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-it-user] problemi con la modifica di un poligono

2020-03-26 Per discussione Andrea Giudiceandrea
Antonella wrote
> per esempio, ho il poligono della Corsica, mi serve solo l'area che si
> estende dalla costa verso l'interno per un km

Ciao Antonella,
dovresti usare il tool di processing "Buffer" [1] indicando un valore di
distanza negativo (-1000) e poi usare il tool di processing "Difference" [2]
per ottenere il poligono della fascia costiera.

A presto.

Andrea

[1]
https://docs.qgis.org/3.10/it/docs/user_manual/processing_algs/qgis/vectorgeometry.html#buffer
https://docs.qgis.org/3.10/it/docs/gentle_gis_introduction/vector_spatial_analysis_buffers.html?highlight=buffer#buffering-outward-and-inward
https://docs.qgis.org/3.10/it/docs/training_manual/complete_analysis/analysis_exercise.html#creating-a-negative-buffer
[2]
https://docs.qgis.org/3.10/it/docs/user_manual/processing_algs/qgis/vectoroverlay.html#difference



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Italian-User-f5250612.html
___
QGIS-it-user mailing list
QGIS-it-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/qgis-it-user


Re: [QGIS-it-user] problemi con la modifica di un poligono

2020-03-26 Per discussione Antonella
grazie mille davvero, avevo pensato allo strumento buffer ma non mi era
venuto in mente che avrei potuto combinarli per ottenere il risultato :)



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Italian-User-f5250612.html
___
QGIS-it-user mailing list
QGIS-it-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/qgis-it-user


[QGIS-it-user] problemi con la modifica di un poligono

2020-03-26 Per discussione Antonella
Salve,
sono Antonella, mi sono appena iscritta quindi scusatemi fin da ora se
sbaglio qualcosa.

il mio problema è questo:
da un poligono ne devo estrapolare un altro che abbia lo stesso contorno e
che si estenda per una lunghezza determinata. Ovvero, per esempio, ho il
poligono della Corsica, mi serve solo l'area che si estende dalla costa
verso l'interno per un km, tecnicamente lo dovrei "bucare" o ritagliare in
un modo definito ma non lo so fare. C'è qualche plugin per questo o qualche
modo per farlo?

Grazie mille per l'aiuto



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Italian-User-f5250612.html
___
QGIS-it-user mailing list
QGIS-it-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/qgis-it-user


Re: [QGIS-it-user] Plugin CDU Creator: multi-selezione ora disponibile in versione beta

2020-03-26 Per discussione Totò
Grazie Roberta,
ottimo lavoro.

Appena posso provo.

saluti



-
https://pigrecoinfinito.wordpress.com/
--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Italian-User-f5250612.html
___
QGIS-it-user mailing list
QGIS-it-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/qgis-it-user