Re: [QGIS-Developer] How to enable debugging mode on QGIS start in Win11

2023-06-20 Thread Vedran Stojnović via QGIS-Developer
Thank you very much to both of you!

After installing an additional dev version I added the same two lines in
qgis-dev-bin.env and after starting qgis-dev-bin.exe, now I got some output
to the txt file:
C:\src\OSGeo4W\src\qgis-dev\qgis\src\app\main.cpp(514) : (main) [0ms]
Starting qgis main
C:\src\OSGeo4W\src\qgis-dev\qgis\src\core\qgsapplication.cpp(470) :
(QgsApplication::installTranslators) [13ms] loading of qgis translation
failed C:/OSGeo4W/apps/qgis-dev/./i18n//qgis_hr_HR
C:\src\OSGeo4W\src\qgis-dev\qgis\src\core\qgsapplication.cpp(470) :
(QgsApplication::installTranslators) [3ms] loading of qgis translation
failed C:/OSGeo4W/apps/qgis-dev/./i18n//qgis_hr_HR

Is it possible that these two translation files block the entire QGIS
application? Should I bug report this? Or there is some other hidden
problem according to your experience?

uto, 20. lip 2023. u 16:57 Richard Duivenvoorde 
napisao je:

> In windows/osgeo4w the 'nightly builds' (with -dev- in there package
> names) are build in DEBUG mode if I am correct...
>
> so these should show you logging info, but I think you also need to
> install a tool to SEE that logging. I know there was some utility for it.
> Not sure if you can see it in the Event Log of WIndows...
> Juergen posted some answers in the old issue tracker, but cannot find it...
>
> Ah wait: from historical docs:
> https://issues.qgis.org/projects/qgis/wiki/Bugreports
> use:
> https://learn.microsoft.com/en-us/sysinternals/downloads/debugview
> (but maybe Windows can do that now without tools...)
>
> Regards,
>
> Richard Duivenvoorde
>
> On 6/20/23 16:38, Alessandro Pasotti via QGIS-Developer wrote:
> > QGIS_DEBUG=X has no effect if QGIS was not built in debug mode.
> >
> >
> > On Tue, Jun 20, 2023 at 4:18 PM Vedran Stojnović via QGIS-Developer
> >  wrote:
> >>
> >> Hi,
> >>
> >> I just installed QGIS 3.30.3 via web installer ("qgis-full" version)
> and QGIS won't start at all, nor does throw any error when I start it from
> PowerShell by executing "qgis-bin.exe".
> >> I tried reinstalling a few times using different servers (default one
> and norbit.de) and I also cleaned the cache folder before changing the
> server.
> >>
> >> I already tried adding these two lines to "qgis-bin.env" and I created
> "qgislog.txt" on the desktop, but I still do not get any output to the
> command line and txt file is empty after trying to start qgis:
> >> QGIS_DEBUG=9
> >> QGIS_LOG_FILE=C:\Users\phidr\Desktop\qgislog.txt
> >>
> >> so the current contents of "qgis-bin.env" is:
> >>
> PATH=C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\apps\grass\grass82\lib;C:\OSGeo4W\apps\grass\grass82\bin;C:\OSGeo4W\apps\qt5\bin;C:\OSGeo4W\apps\Python39\Scripts;C:\OSGeo4W\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem
> >> GDAL_DATA=C:\OSGeo4W\apps\gdal\share\gdal
> >> GDAL_DRIVER_PATH=C:\OSGeo4W\apps\gdal\lib\gdalplugins
> >> GDAL_FILENAME_IS_UTF8=YES
> >> PDAL_DRIVER_PATH=C:\OSGeo4W\apps\pdal\plugins
> >> GISBASE=C:\OSGeo4W\apps\grass\grass82
> >> GRASS_PROJSHARE=C:\OSGeo4W\share\proj
> >> GRASS_PYTHON=C:\OSGeo4W\bin\python3.exe
> >> OSGEO4W_ROOT=C:\OSGeo4W
> >> PROJ_LIB=C:\OSGeo4W\share\proj
> >> PYTHONHOME=C:\OSGeo4W\apps\Python39
> >> PYTHONPATH=C:\OSGeo4W\apps\grass\grass82\etc\python;
> >> PYTHONUTF8=1
> >> QGIS_PREFIX_PATH=C:/OSGeo4W/apps/qgis
> >>
> QT_PLUGIN_PATH=C:\OSGeo4W\apps\qgis\qtplugins;C:\OSGeo4W\apps\qt5\plugins
> >> VSI_CACHE=TRUE
> >> VSI_CACHE_SIZE=100
> >> O4W_QT_PREFIX=C:/OSGeo4W/apps/Qt5
> >> O4W_QT_BINARIES=C:/OSGeo4W/apps/Qt5/bin
> >> O4W_QT_PLUGINS=C:/OSGeo4W/apps/Qt5/plugins
> >> O4W_QT_LIBRARIES=C:/OSGeo4W/apps/Qt5/lib
> >> O4W_QT_TRANSLATIONS=C:/OSGeo4W/apps/Qt5/translations
> >> O4W_QT_HEADERS=C:/OSGeo4W/apps/Qt5/include
> >> QGIS_WIN_APP_NAME=OSGeo4W\QGIS Desktop 3.30.3
> >> SSL_CERT_DIR=C:\OSGeo4W\apps\openssl\certs
> >> SSL_CERT_FILE=C:\OSGeo4W\bin\curl-ca-bundle.crt
> >> QGIS_DEBUG=9
> >> QGIS_LOG_FILE=C:\Users\phidr\Desktop\qgislog.txt
> >>
> >> --
> >> Kind regards,
> >> Vedran Stojnović.
> >> ___
> >> QGIS-Developer mailing list
> >> QGIS-Developer@lists.osgeo.org
> >> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >
> >
> >
>
>

-- 
Srdačan pozdrav,
Vedran Stojnović.
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [QGIS-Developer] How to enable debugging mode on QGIS start in Win11

2023-06-20 Thread Richard Duivenvoorde via QGIS-Developer

In windows/osgeo4w the 'nightly builds' (with -dev- in there package names) are 
build in DEBUG mode if I am correct...

so these should show you logging info, but I think you also need to install a 
tool to SEE that logging. I know there was some utility for it. Not sure if you 
can see it in the Event Log of WIndows...
Juergen posted some answers in the old issue tracker, but cannot find it...

Ah wait: from historical docs: 
https://issues.qgis.org/projects/qgis/wiki/Bugreports
use:
https://learn.microsoft.com/en-us/sysinternals/downloads/debugview
(but maybe Windows can do that now without tools...)

Regards,

Richard Duivenvoorde

On 6/20/23 16:38, Alessandro Pasotti via QGIS-Developer wrote:

QGIS_DEBUG=X has no effect if QGIS was not built in debug mode.


On Tue, Jun 20, 2023 at 4:18 PM Vedran Stojnović via QGIS-Developer
 wrote:


Hi,

I just installed QGIS 3.30.3 via web installer ("qgis-full" version) and QGIS won't start 
at all, nor does throw any error when I start it from PowerShell by executing 
"qgis-bin.exe".
I tried reinstalling a few times using different servers (default one and 
norbit.de) and I also cleaned the cache folder before changing the server.

I already tried adding these two lines to "qgis-bin.env" and I created 
"qgislog.txt" on the desktop, but I still do not get any output to the command line and 
txt file is empty after trying to start qgis:
QGIS_DEBUG=9
QGIS_LOG_FILE=C:\Users\phidr\Desktop\qgislog.txt

so the current contents of "qgis-bin.env" is:
PATH=C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\apps\grass\grass82\lib;C:\OSGeo4W\apps\grass\grass82\bin;C:\OSGeo4W\apps\qt5\bin;C:\OSGeo4W\apps\Python39\Scripts;C:\OSGeo4W\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem
GDAL_DATA=C:\OSGeo4W\apps\gdal\share\gdal
GDAL_DRIVER_PATH=C:\OSGeo4W\apps\gdal\lib\gdalplugins
GDAL_FILENAME_IS_UTF8=YES
PDAL_DRIVER_PATH=C:\OSGeo4W\apps\pdal\plugins
GISBASE=C:\OSGeo4W\apps\grass\grass82
GRASS_PROJSHARE=C:\OSGeo4W\share\proj
GRASS_PYTHON=C:\OSGeo4W\bin\python3.exe
OSGEO4W_ROOT=C:\OSGeo4W
PROJ_LIB=C:\OSGeo4W\share\proj
PYTHONHOME=C:\OSGeo4W\apps\Python39
PYTHONPATH=C:\OSGeo4W\apps\grass\grass82\etc\python;
PYTHONUTF8=1
QGIS_PREFIX_PATH=C:/OSGeo4W/apps/qgis
QT_PLUGIN_PATH=C:\OSGeo4W\apps\qgis\qtplugins;C:\OSGeo4W\apps\qt5\plugins
VSI_CACHE=TRUE
VSI_CACHE_SIZE=100
O4W_QT_PREFIX=C:/OSGeo4W/apps/Qt5
O4W_QT_BINARIES=C:/OSGeo4W/apps/Qt5/bin
O4W_QT_PLUGINS=C:/OSGeo4W/apps/Qt5/plugins
O4W_QT_LIBRARIES=C:/OSGeo4W/apps/Qt5/lib
O4W_QT_TRANSLATIONS=C:/OSGeo4W/apps/Qt5/translations
O4W_QT_HEADERS=C:/OSGeo4W/apps/Qt5/include
QGIS_WIN_APP_NAME=OSGeo4W\QGIS Desktop 3.30.3
SSL_CERT_DIR=C:\OSGeo4W\apps\openssl\certs
SSL_CERT_FILE=C:\OSGeo4W\bin\curl-ca-bundle.crt
QGIS_DEBUG=9
QGIS_LOG_FILE=C:\Users\phidr\Desktop\qgislog.txt

--
Kind regards,
Vedran Stojnović.
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer






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


Re: [QGIS-Developer] How to enable debugging mode on QGIS start in Win11

2023-06-20 Thread Alessandro Pasotti via QGIS-Developer
QGIS_DEBUG=X has no effect if QGIS was not built in debug mode.


On Tue, Jun 20, 2023 at 4:18 PM Vedran Stojnović via QGIS-Developer
 wrote:
>
> Hi,
>
> I just installed QGIS 3.30.3 via web installer ("qgis-full" version) and QGIS 
> won't start at all, nor does throw any error when I start it from PowerShell 
> by executing "qgis-bin.exe".
> I tried reinstalling a few times using different servers (default one and 
> norbit.de) and I also cleaned the cache folder before changing the server.
>
> I already tried adding these two lines to "qgis-bin.env" and I created 
> "qgislog.txt" on the desktop, but I still do not get any output to the 
> command line and txt file is empty after trying to start qgis:
> QGIS_DEBUG=9
> QGIS_LOG_FILE=C:\Users\phidr\Desktop\qgislog.txt
>
> so the current contents of "qgis-bin.env" is:
> PATH=C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\apps\grass\grass82\lib;C:\OSGeo4W\apps\grass\grass82\bin;C:\OSGeo4W\apps\qt5\bin;C:\OSGeo4W\apps\Python39\Scripts;C:\OSGeo4W\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem
> GDAL_DATA=C:\OSGeo4W\apps\gdal\share\gdal
> GDAL_DRIVER_PATH=C:\OSGeo4W\apps\gdal\lib\gdalplugins
> GDAL_FILENAME_IS_UTF8=YES
> PDAL_DRIVER_PATH=C:\OSGeo4W\apps\pdal\plugins
> GISBASE=C:\OSGeo4W\apps\grass\grass82
> GRASS_PROJSHARE=C:\OSGeo4W\share\proj
> GRASS_PYTHON=C:\OSGeo4W\bin\python3.exe
> OSGEO4W_ROOT=C:\OSGeo4W
> PROJ_LIB=C:\OSGeo4W\share\proj
> PYTHONHOME=C:\OSGeo4W\apps\Python39
> PYTHONPATH=C:\OSGeo4W\apps\grass\grass82\etc\python;
> PYTHONUTF8=1
> QGIS_PREFIX_PATH=C:/OSGeo4W/apps/qgis
> QT_PLUGIN_PATH=C:\OSGeo4W\apps\qgis\qtplugins;C:\OSGeo4W\apps\qt5\plugins
> VSI_CACHE=TRUE
> VSI_CACHE_SIZE=100
> O4W_QT_PREFIX=C:/OSGeo4W/apps/Qt5
> O4W_QT_BINARIES=C:/OSGeo4W/apps/Qt5/bin
> O4W_QT_PLUGINS=C:/OSGeo4W/apps/Qt5/plugins
> O4W_QT_LIBRARIES=C:/OSGeo4W/apps/Qt5/lib
> O4W_QT_TRANSLATIONS=C:/OSGeo4W/apps/Qt5/translations
> O4W_QT_HEADERS=C:/OSGeo4W/apps/Qt5/include
> QGIS_WIN_APP_NAME=OSGeo4W\QGIS Desktop 3.30.3
> SSL_CERT_DIR=C:\OSGeo4W\apps\openssl\certs
> SSL_CERT_FILE=C:\OSGeo4W\bin\curl-ca-bundle.crt
> QGIS_DEBUG=9
> QGIS_LOG_FILE=C:\Users\phidr\Desktop\qgislog.txt
>
> --
> Kind regards,
> Vedran Stojnović.
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



-- 
Alessandro Pasotti
QCooperative:  www.qcooperative.net
ItOpen:   www.itopen.it
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


[QGIS-Developer] How to enable debugging mode on QGIS start in Win11

2023-06-20 Thread Vedran Stojnović via QGIS-Developer
Hi,

I just installed QGIS 3.30.3 via web installer ("qgis-full" version) and
QGIS won't start at all, nor does throw any error when I start it from
PowerShell by executing "qgis-bin.exe".
I tried reinstalling a few times using different servers (default one and
norbit.de) and I also cleaned the cache folder before changing the server.

I already tried adding these two lines to "qgis-bin.env" and I
created "qgislog.txt" on the desktop, but I still do not get any output to
the command line and txt file is empty after trying to start qgis:
QGIS_DEBUG=9
QGIS_LOG_FILE=C:\Users\phidr\Desktop\qgislog.txt

so the current contents of "qgis-bin.env" is:
PATH=C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\apps\grass\grass82\lib;C:\OSGeo4W\apps\grass\grass82\bin;C:\OSGeo4W\apps\qt5\bin;C:\OSGeo4W\apps\Python39\Scripts;C:\OSGeo4W\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem
GDAL_DATA=C:\OSGeo4W\apps\gdal\share\gdal
GDAL_DRIVER_PATH=C:\OSGeo4W\apps\gdal\lib\gdalplugins
GDAL_FILENAME_IS_UTF8=YES
PDAL_DRIVER_PATH=C:\OSGeo4W\apps\pdal\plugins
GISBASE=C:\OSGeo4W\apps\grass\grass82
GRASS_PROJSHARE=C:\OSGeo4W\share\proj
GRASS_PYTHON=C:\OSGeo4W\bin\python3.exe
OSGEO4W_ROOT=C:\OSGeo4W
PROJ_LIB=C:\OSGeo4W\share\proj
PYTHONHOME=C:\OSGeo4W\apps\Python39
PYTHONPATH=C:\OSGeo4W\apps\grass\grass82\etc\python;
PYTHONUTF8=1
QGIS_PREFIX_PATH=C:/OSGeo4W/apps/qgis
QT_PLUGIN_PATH=C:\OSGeo4W\apps\qgis\qtplugins;C:\OSGeo4W\apps\qt5\plugins
VSI_CACHE=TRUE
VSI_CACHE_SIZE=100
O4W_QT_PREFIX=C:/OSGeo4W/apps/Qt5
O4W_QT_BINARIES=C:/OSGeo4W/apps/Qt5/bin
O4W_QT_PLUGINS=C:/OSGeo4W/apps/Qt5/plugins
O4W_QT_LIBRARIES=C:/OSGeo4W/apps/Qt5/lib
O4W_QT_TRANSLATIONS=C:/OSGeo4W/apps/Qt5/translations
O4W_QT_HEADERS=C:/OSGeo4W/apps/Qt5/include
QGIS_WIN_APP_NAME=OSGeo4W\QGIS Desktop 3.30.3
SSL_CERT_DIR=C:\OSGeo4W\apps\openssl\certs
SSL_CERT_FILE=C:\OSGeo4W\bin\curl-ca-bundle.crt
QGIS_DEBUG=9
QGIS_LOG_FILE=C:\Users\phidr\Desktop\qgislog.txt

-- 
Kind regards,
Vedran Stojnović.
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [QGIS-Developer] PyQGIS zoom to layer not working

2023-06-20 Thread Richard Duivenvoorde via QGIS-Developer

On 6/20/23 14:56, Frank Broniewski wrote:

I did set the QGIS default CRS to 2169 in the options, but this did not help 
unfortunately.


Mmm, that should work:

Settings / CRS and Transforms/ CRS for projects / Use a default CRS
AND I would maybe also set the CRS for layer to epsg:2169

Another option is to create a 'Default Project' (empty, BUT crs set to 
epsg:2169)
Settings / General / Set Current Project As Default
and
Checkbox 'Create new project from default project'

fiddling with those I'm pretty sure it should be possible to start QGIS in the 
right crs..

Suc6

Richard Duivenvoorde
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [QGIS-Developer] PyQGIS zoom to layer not working

2023-06-20 Thread Frank Broniewski via QGIS-Developer
Hi Richard,

thank you for your response, you may have already given me a good hint. QGIS is 
started from another app with an empty/no project, and the default CRS is in 
effect (WGS84 here). My layers are in epsg:2169 (Luxembourg), so I definitely 
need to correct this. Since all layers are in 2169, I could set the project's 
CRS in the plugin ...
But here are the extents, grabbed from the console

georecord_layer extent:


mapCanvas extent:


When I run setExtent in the console, it works ...
iface.mapCanvas().setExtent(plugin.georecord_layer.layer.extent())

I did set the QGIS default CRS to 2169 in the options, but this did not help 
unfortunately.

Many thanks,
Frank


-Ursprüngliche Nachricht-
Von: Richard Duivenvoorde  
Gesendet: Dienstag, 20. Juni 2023 13:37
An: Frank Broniewski ; qgis-developer@lists.osgeo.org
Betreff: Re: [QGIS-Developer] PyQGIS zoom to layer not working

Hi Frank,

It really depends on:
- what is the crs of your project
- what is the crs of your layer
- if they match, it should work
- if they do not match you have to reproject the layer extent to the crs of the 
mapcanvas

I think the python console will be helpfull here.

While loaded, does the plugin have a handle to the actual QGIS layer?
If so, say it is called 'self.georecord_layer.layer' in the plugin.

Then you can do (in the console):

# first find out the name of your plugin qgis.utils.plugins # will show you all 
loaded layers AND there key/name # say your plugins name is 'franks_plugin'
# then
plugin = qgis.utils.plugins['franks_plugin']
# will give you a handle (in the console) to your plugin # then 
plugin.georecord_layer.layer.extent should give you an extent... eg:
 # NOTE 
that this is in the layers crs !
# you can also use (making the right layer active in legend):
iface.activeLayer().extent()
# you can also look at the extent of the mapcanvas from the console:
iface.mapCanvas().extent()

(you can off course also use logging see the extent somewhere)

Can you show us both the canvas and the layer extent?

Regards,

Richard Duivenvoorde

On 6/20/23 12:59, Frank Broniewski via QGIS-Developer wrote:
> Hi,
> 
> I am writing a plugin, in which I am loading a bunch of layers, and I want to 
> zoom on one of them. Layers are loaded through an action (click).
> 
> def load_layer(self):
> 
>      self.project.addMapLayers(
> 
>      [
> 
>      self.addresses_layer.layer,
> 
>      self.adminunits_layer.layer,
> 
>      self.georecord_layer,
> 
>      ],
> 
>      addToLegend=False,
> 
>      )
> 
>      self.project.addMapLayers(
> 
>      [
> 
>      self.geolocation_point_layer.layer,
> 
>      self.geolocation_line_layer.layer,
> 
>      self.geolocation_poly_layer.layer,
> 
>      self.ortho_layer
> 
>      ]
> 
>      )
> 
>      
> self.iface.mapCanvas().setExtent(self.georecord_layer.layer.extent())
> 
>      self.iface.mapCanvas().refresh()
> 
> but unfortunately, that does not work as expected. QGIS zooms just on the 
> ortho_layer in the end. I have the suspicion, that the extent I set, gets 
> overwritten by another layer that loads in in a later stage. Layers are from 
> a PostGIS, and the ortho_layer is a WMS layer.
> 
> I tried googleing, mapCanvas().waitWhileRendering() and whatnot, it just will 
> not zoom. I am completely clueless now, so any hints are greatly appreciated.
> 
> This is on OSGeo4W, QGIS 3.28 and Python , for explanation, the .layer 
> attribute is the actual QGIS layer …
> 
> Many thanks,
> 
> Frank
> 
> 
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

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


Re: [QGIS-Developer] GeoFerver canno't read QGIS server WFS Services

2023-06-20 Thread Walter Lorenzetti via QGIS-Developer

Hi René-Luc any idea about it?

W

Il 05/06/23 15:48, Walter Lorenzetti via QGIS-Developer ha scritto:


René-Luc there it is:

http://www.qgis.org/gml;
    xmlns:ogc="http://www.opengis.net/ogc;
    xmlns:gml="http://www.opengis.net/gml; version="1.0"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema;
    xmlns="http://www.w3.org/2001/XMLSchema; 
elementFormDefault="qualified"

    xmlns:qgs="http://www.qgis.org/gml;>
    schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd; 
namespace="http://www.opengis.net/gml"/>
    substitutionGroup="gml:_Feature" 
type="qgs:Particelle_terreni_e_fabbricatiType"/>

    
    
    
    
    type="gml:PolygonPropertyType" maxOccurs="1" minOccurs="0"/>

    
    
    
    
    nillable="true"/>
    nillable="true"/>

    
    nillable="true"/>
    nillable="true"/>

    
    
    
    


Il 05/06/23 09:59, René-Luc Dhont ha scritto:

Hi Walter,

The issue concerns Particelle_terreni_e_fabbricati layer.
Can you check the DescribeFeatureType for this layer: 
Particelle_terreni_e_fabbricati ?


Regards,
René-Luc

Le 05/06/2023 à 09:26, Walter Lorenzetti a écrit :


Hi René-Luc,

yes it fail on DescribeFeatureType.

This is the repsonse of QGIS 3.28.7:

http://www.opengis.net/gml; 
targetNamespace="http://www.qgis.org/gml; 
xmlns="http://www.w3.org/2001/XMLSchema; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; version="1.0" 
xmlns:qgs="http://www.qgis.org/gml; 
xmlns:ogc="http://www.opengis.net/ogc; elementFormDefault="qualified">
 schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd; 
namespace="http://www.opengis.net/gml"/>
 type="qgs:buildingsType"/>

 
  
   
    
 type="gml:MultiSurfacePropertyType"/>

 
 
 nillable="true"/>

 
 
 
 
 
 
 
 
 nillable="true"/>
 nillable="true"/>
 nillable="true"/>
 nillable="true"/>
 nillable="true"/>

 
 type="string" nillable="true"/>
 type="long" nillable="true"/>
 
 type="string" nillable="true"/>
 nillable="true"/>

    
   
  
 


and following a DescribeFeatureType response which does not fail on 
geoservers from a Italy government  service:


http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/wfs/Alluvioni_Estensione.map=ITH2018_Estensione_LPH=DescribeFeatureType=1.1.0=WFS


http://mapserver.gis.umn.edu/mapserver;
   xmlns:ms="http://mapserver.gis.umn.edu/mapserver;
   xmlns:ogc="http://www.opengis.net/ogc;
   xmlns:xsd="http://www.w3.org/2001/XMLSchema;
   xmlns="http://www.w3.org/2001/XMLSchema;
   xmlns:gml="http://www.opengis.net/gml;
   elementFormDefault="qualified" version="0.1" >

  http://www.opengis.net/gml;
  
schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd; />


  

  
    
  
    
  minOccurs="0" maxOccurs="unbounded"/>

  
  
  
  
  
  
  
  
  
  
  
  
  
    
  
    
  




I can't see a substantial difference :(

W

Il 31/05/23 15:28, René-Luc Dhont via QGIS-Developer ha scritto:

Hi Walter,

You have to check the result of DescribeFeatureType WFS Request.
This request has to provide the XSD to validate the GML.

Regards,
René-Luc

Le 31/05/2023 à 14:59, Walter Lorenzetti via QGIS-Developer a écrit :


Hi,

when I try to add a WFS service layer to a GeoServer instance I 
get an exception like this:


```

...

Caused by: java.lang.RuntimeException: 
org.geotools.data.DataSourceException: No XSDElementDeclaration 
found for {http://www.opengis.net/wfs}Particelle_terreni_e_fabbricati
    at 
org.geotools.data.store.ContentFeatureSource.getAbsoluteSchema(ContentFeatureSource.java:329)
    at 
org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:296)
    at 
org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:105)
    at 
org.geoserver.catalog.CatalogBuilder.buildFeatureType(CatalogBuilder.java:342)
    at 
org.geoserver.catalog.CatalogBuilder.buildFeatureType(CatalogBuilder.java:325)
    at 
org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.java:409)


...

```

Any idea about this issue? It seams a XML error validation..

Thanks in advance.

W


--

Walter Lorenzetti phD
email: lorenze...@gis3w.it
site: gis3w.it 
twitter: w_lorenzetti
Tel/Cell: (+39) 347-6597931
Viale Verdi 24 - 51016 Montecatini Terme (PT)


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



___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org

Re: [QGIS-Developer] PyQGIS zoom to layer not working

2023-06-20 Thread Richard Duivenvoorde via QGIS-Developer

Hi Frank,

It really depends on:
- what is the crs of your project
- what is the crs of your layer
- if they match, it should work
- if they do not match you have to reproject the layer extent to the crs of the 
mapcanvas

I think the python console will be helpfull here.

While loaded, does the plugin have a handle to the actual QGIS layer?
If so, say it is called 'self.georecord_layer.layer' in the plugin.

Then you can do (in the console):

# first find out the name of your plugin
qgis.utils.plugins
# will show you all loaded layers AND there key/name
# say your plugins name is 'franks_plugin'
# then
plugin = qgis.utils.plugins['franks_plugin']
# will give you a handle (in the console) to your plugin
# then
plugin.georecord_layer.layer.extent should give you an extent... eg:

# NOTE that this is in the layers crs !
# you can also use (making the right layer active in legend):
iface.activeLayer().extent()
# you can also look at the extent of the mapcanvas from the console:
iface.mapCanvas().extent()

(you can off course also use logging see the extent somewhere)

Can you show us both the canvas and the layer extent?

Regards,

Richard Duivenvoorde

On 6/20/23 12:59, Frank Broniewski via QGIS-Developer wrote:

Hi,

I am writing a plugin, in which I am loading a bunch of layers, and I want to 
zoom on one of them. Layers are loaded through an action (click).

def load_layer(self):

     self.project.addMapLayers(

     [

     self.addresses_layer.layer,

     self.adminunits_layer.layer,

     self.georecord_layer,

     ],

     addToLegend=False,

     )

     self.project.addMapLayers(

     [

     self.geolocation_point_layer.layer,

     self.geolocation_line_layer.layer,

     self.geolocation_poly_layer.layer,

     self.ortho_layer

     ]

     )

     self.iface.mapCanvas().setExtent(self.georecord_layer.layer.extent())

     self.iface.mapCanvas().refresh()

but unfortunately, that does not work as expected. QGIS zooms just on the 
ortho_layer in the end. I have the suspicion, that the extent I set, gets 
overwritten by another layer that loads in in a later stage. Layers are from a 
PostGIS, and the ortho_layer is a WMS layer.

I tried googleing, mapCanvas().waitWhileRendering() and whatnot, it just will 
not zoom. I am completely clueless now, so any hints are greatly appreciated.

This is on OSGeo4W, QGIS 3.28 and Python , for explanation, the .layer 
attribute is the actual QGIS layer …

Many thanks,

Frank


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


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


[QGIS-Developer] PyQGIS zoom to layer not working

2023-06-20 Thread Frank Broniewski via QGIS-Developer
Hi,
I am writing a plugin, in which I am loading a bunch of layers, and I want to 
zoom on one of them. Layers are loaded through an action (click).

def load_layer(self):

self.project.addMapLayers(
[
self.addresses_layer.layer,
self.adminunits_layer.layer,
self.georecord_layer,
],
addToLegend=False,
)
self.project.addMapLayers(
[
self.geolocation_point_layer.layer,
self.geolocation_line_layer.layer,
self.geolocation_poly_layer.layer,
self.ortho_layer
]
)
self.iface.mapCanvas().setExtent(self.georecord_layer.layer.extent())
self.iface.mapCanvas().refresh()

but unfortunately, that does not work as expected. QGIS zooms just on the 
ortho_layer in the end. I have the suspicion, that the extent I set, gets 
overwritten by another layer that loads in in a later stage. Layers are from a 
PostGIS, and the ortho_layer is a WMS layer.

I tried googleing, mapCanvas().waitWhileRendering() and whatnot, it just will 
not zoom. I am completely clueless now, so any hints are greatly appreciated.

This is on OSGeo4W, QGIS 3.28 and Python , for explanation, the .layer 
attribute is the actual QGIS layer …

Many thanks,
Frank
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


[QGIS-Developer] Cannot convert Topocentric to Geocentric

2023-06-20 Thread Gabriele Ascolese via QGIS-Developer


 
 
  I simply try to convert a point from local Cartesian ENU centered on a point with lat,lon coordinates to geocentric ECEF coordinates. 
  With proj from command line all works well. I use strings from proj to create QGIS CRS, and it seems all works well, i receive true in return code. 
  But when i try to convert i receive I receive: 
  Error transforming "forward transform of\n (inf,inf)\n Error: Fallback transformation failed" 
    
    
  Is there any issues in qgis 3.22 LTS ? 
    
  This is C++ code. 
    
    
  void geoutils::TopoToECEF(const QgsPointXY , const QgsPointXY , QgsPointXY _wgs) 
  { 
    
      try { 
    
      QgsCoordinateReferenceSystem geocentricCRS; 
    
      QString projStringGeocentric = "+proj=cart +ellps=GRS80";  //ECEF CRS 
  bool res= geocentricCRS.createFromProj(projStringGeocentric); 
      qDebug() << "result 1 is " << res << geocentricCRS.toProj();  // this return true !!! 
    
      QgsCoordinateReferenceSystem topocentricCRS; 
    
      QString projStringTopocentric = "+proj=topocentric +ellps=WGS84"; 
      projStringTopocentric += " +lon_0=9"; // origin lon 
      projStringTopocentric += " +lat_0=44"; // origin lat 
      projStringTopocentric += " +h_0=0 +units=m"; // 
    
  res = topocentricCRS.createFromProj(projStringTopocentric); 
    
      qDebug() << "result 2 is " << res << topocentricCRS.toProj(); //this return true !!! 
    
  QgsProject::instance()->setCrs(geocentricCRS); 
    
  QgsCoordinateTransform *xformerFromTopocentricToGeocentric = new QgsCoordinateTransform(topocentricCRS, geocentricCRS, QgsProject::instance());  // src, dest, proj 
    
      qDebug() << "TopoToECEF Input point x: " << point.x() << " y: "<< point.y(); 
  point_wgs = xformerFromToTopocentricToWgs84->transform(point);  // this BOOOMMMSS : forward transform of\n (inf,inf)\n Error: Fallback transformation failed 
    
      qDebug() << "TopoToECEF -  Output x: " << point_wgs.x() << "  y: "<< point_wgs.y(); 
    
      }  catch (const QgsException& e) { 
      qDebug() << "error transforming " << e.what(); 
    
      } 
  }
 

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