Re: [QGIS-Developer] Qgis 3.6.0 fail to read shapefile with python on buster

2019-03-28 Thread Jürgen E . Fischer
Hi David,

On Thu, 28. Mar 2019 at 19:25:15 +0100, David Marteau wrote:
> I have found the problem, qgis packaging on buster is totally broken: it 
> mixes 3.6.0 and 3.6.1 dependencies

> If you try to install  python-qgis you get the following packages installed:

You should install python3-qgis.


Jürgen

-- 
Jürgen E. Fischer   norBIT GmbH Tel. +49-4931-918175-31
Dipl.-Inf. (FH) Rheinstraße 13  Fax. +49-4931-918175-50
Software Engineer   D-26506 Nordenhttps://www.norbit.de
QGIS release manager (PSC)  GermanyIRC: jef on FreeNode


signature.asc
Description: PGP signature
norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
Rheinstrasse 13, 26506 Norden
GF: Juergen Fischer, Nils Kutscher HR: Amtsgericht Aurich HRB 100827
Datenschutzerklaerung: https://www.norbit.de/83/
___
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] Qgis 3.6.0 fail to read shapefile with python on buster

2019-03-28 Thread Régis Haubourg
Hi, I think Jürgen is aware of that situation and working on it.
Regis

Le jeu. 28 mars 2019 à 21:32, David Marteau  a écrit :

> I Forgot to mention that they are the packages from the
> https://qgis.org/debian/ repository and not the the packages from the
> debian distro.
>
> Le 28 mars 2019 à 19:25, David Marteau  a écrit :
>
> Hi Alessandro
>
> I have found the problem, qgis packaging on buster is totally broken: it
> mixes 3.6.0 and 3.6.1 dependencies
>
> If you try to install  python-qgis you get the following packages
> installed:
>
> ii  libqgis-3d3.6.0 1:3.6.0+15buster
>  amd64QGIS - shared 3d library
> ii  libqgis-analysis3.6.0   1:3.6.0+15buster
>  amd64QGIS - shared analysis library
> ii  libqgis-core3.6.0   1:3.6.0+15buster
>  amd64QGIS - shared core library
> ii  libqgis-core3.6.1   1:3.6.1+15buster
>  amd64QGIS - shared core library
> ii  libqgis-customwidgets   1:3.6.1+15buster
>  amd64QGIS custom widgets for Qt Designer
> ii  libqgis-gui3.6.01:3.6.0+15buster
>  amd64QGIS - shared gui library
> ii  libqgis-gui3.6.11:3.6.1+15buster
>  amd64QGIS - shared gui library
> ii  libqgis-native3.6.0 1:3.6.0+15buster
>  amd64QGIS - shared native gui library
> ii  libqgis-native3.6.1 1:3.6.1+15buster
>  amd64QGIS - shared native gui library
> ii  libqgis-server3.6.0 1:3.6.0+15buster
>  amd64QGIS - shared server library
> ii  libqgispython3.6.0  1:3.6.0+15buster
>  amd64QGIS - shared Python library
> ii  python-qgis 1:3.6.0+15buster
>  amd64Python bindings to QGIS
> ii  python-qgis-common  1:3.6.0+15buster
>  all  Python bindings to QGIS - architecture-independent files
>
> Packages are installed twice in both version 3.6.0 and 3.6.1 !
>
> This lead to very unpredictible behavior when using qgis in python (simply
> not working or crashing randomly)
>
>
> David,
>
> Le 26 mars 2019 à 18:38, David Marteau  a écrit :
>
>
> Hi Alessandro
>
> No there is nothing at all in the logs.
>
> I have used the same reduced snippet on qgis 3.4.5 (ltr) on Stretch and
> qgis 3.6.0 (release) on buster, using the same datasource:
>
> ```
> import os
> from qgis.core import QgsApplication, QgsVectorLayer
>
> # prevent display not found error
> os.environ['QT_QPA_PLATFORM'] = 'offscreen'
>
> qgis_application = QgsApplication([], False )
> layer = QgsVectorLayer('path/to/data')
>
> layer.isValid() # Return True on 3.4.5/stretch, False on 3.6.0/buster
> whatever the data
> ```
>
> If the release package has not been updated in the previous  24 h, I
> suspect that something has been broken on the buster distro.
>
> Note that I'm able to load shapefile in python with ogr (gdal-python).
>
>
> Le 26 mars 2019 à 17:47, Alessandro Pasotti  a écrit :
>
>
> On Tue, Mar 26, 2019 at 5:45 PM David Marteau  wrote:
>
>>
>> The situation seems to be worst: it seems that no layers can be read from
>> python whatever the format.
>>
>>
>> Le 26 mars 2019 à 17:38, David Marteau  a écrit :
>>
>> Hi devs,
>>
>> We use to build docker images of the latest qgis releases and we have a
>> regression  affecting version 3.6.0 official release on buster
>>
>> Qgis: 3.6.0 on Debian
>>
>> If we read a layer with python:
>>
>> layer = QgsVectorLayer('./mydata.shp')
>>
>>
>> Then the layer is invalid (no warning, no errors)
>>
>> Doing the same thing on stretch + Qgis 3.4.5 (ltr) with same data work
>> flawlessly and lead to a valid layer.
>>
>> This was not affecting previous build 24 h ago (release end
>> nightly-release)
>>
>> The tests were based with shapefiles from testdata in qgis sources.
>>
>> We are not sure it that come from Qgis itself or from a change on the
>> distribution.
>>
>> David,
>>
>>
>>
> Hi David,
>
> anything in the logs?
>
> I would check QGIS_PREFIX_PATH env var, and make sure the provider
> libraries are found and loaded.
>
>
> --
> Alessandro Pasotti
> w3:   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 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] Qgis 3.6.0 fail to read shapefile with python on buster

2019-03-28 Thread David Marteau
I Forgot to mention that they are the packages from the 
https://qgis.org/debian/  repository and not the the 
packages from the debian distro.

> Le 28 mars 2019 à 19:25, David Marteau  a écrit :
> 
> Hi Alessandro
> 
> I have found the problem, qgis packaging on buster is totally broken: it 
> mixes 3.6.0 and 3.6.1 dependencies
> 
> If you try to install  python-qgis you get the following packages installed:
> 
> ii  libqgis-3d3.6.0 1:3.6.0+15busteramd64 
>QGIS - shared 3d library
> ii  libqgis-analysis3.6.0   1:3.6.0+15busteramd64 
>QGIS - shared analysis library
> ii  libqgis-core3.6.0   1:3.6.0+15busteramd64 
>QGIS - shared core library 
> ii  libqgis-core3.6.1   1:3.6.1+15busteramd64 
>QGIS - shared core library
> ii  libqgis-customwidgets   1:3.6.1+15busteramd64 
>QGIS custom widgets for Qt Designer
> ii  libqgis-gui3.6.01:3.6.0+15busteramd64 
>QGIS - shared gui library
> ii  libqgis-gui3.6.11:3.6.1+15busteramd64 
>QGIS - shared gui library
> ii  libqgis-native3.6.0 1:3.6.0+15busteramd64 
>QGIS - shared native gui library
> ii  libqgis-native3.6.1 1:3.6.1+15busteramd64 
>QGIS - shared native gui library
> ii  libqgis-server3.6.0 1:3.6.0+15busteramd64 
>QGIS - shared server library
> ii  libqgispython3.6.0  1:3.6.0+15busteramd64 
>QGIS - shared Python library
> ii  python-qgis 1:3.6.0+15busteramd64 
>Python bindings to QGIS
> ii  python-qgis-common  1:3.6.0+15busterall   
>Python bindings to QGIS - architecture-independent files
> 
> Packages are installed twice in both version 3.6.0 and 3.6.1 !
> 
> This lead to very unpredictible behavior when using qgis in python (simply 
> not working or crashing randomly)
> 
> 
> David,
> 
>> Le 26 mars 2019 à 18:38, David Marteau > > a écrit :
>> 
>> 
>> Hi Alessandro
>> 
>> No there is nothing at all in the logs.
>> 
>> I have used the same reduced snippet on qgis 3.4.5 (ltr) on Stretch and qgis 
>> 3.6.0 (release) on buster, using the same datasource:
>> 
>> ```
>> import os
>> from qgis.core import QgsApplication, QgsVectorLayer
>> 
>> # prevent display not found error
>> os.environ['QT_QPA_PLATFORM'] = 'offscreen'
>> 
>> qgis_application = QgsApplication([], False )
>> layer = QgsVectorLayer('path/to/data')
>> 
>> layer.isValid() # Return True on 3.4.5/stretch, False on 3.6.0/buster 
>> whatever the data
>> ```
>> 
>> If the release package has not been updated in the previous  24 h, I suspect 
>> that something has been broken on the buster distro.
>> 
>> Note that I'm able to load shapefile in python with ogr (gdal-python).
>> 
>> 
>>> Le 26 mars 2019 à 17:47, Alessandro Pasotti >> > a écrit :
>>> 
>>> 
>>> On Tue, Mar 26, 2019 at 5:45 PM David Marteau >> > wrote:
>>> 
>>> The situation seems to be worst: it seems that no layers can be read from 
>>> python whatever the format.
>>> 
>>> 
 Le 26 mars 2019 à 17:38, David Marteau >>> > a écrit :
 
 Hi devs,
 
 We use to build docker images of the latest qgis releases and we have a 
 regression  affecting version 3.6.0 official release on buster
 
 Qgis: 3.6.0 on Debian
 
 If we read a layer with python:
 
> layer = QgsVectorLayer('./mydata.shp')
 
 Then the layer is invalid (no warning, no errors)
 
 Doing the same thing on stretch + Qgis 3.4.5 (ltr) with same data work 
 flawlessly and lead to a valid layer.
 
 This was not affecting previous build 24 h ago (release end 
 nightly-release)
 
 The tests were based with shapefiles from testdata in qgis sources.
 
 We are not sure it that come from Qgis itself or from a change on the 
 distribution.
 
 David,
 
>>> 
>>> 
>>> Hi David,
>>> 
>>> anything in the logs?
>>> 
>>> I would check QGIS_PREFIX_PATH env var, and make sure the provider 
>>> libraries are found and loaded.
>>> 
>>> 
>>> -- 
>>> Alessandro Pasotti
>>> w3:   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

Re: [QGIS-Developer] Qgis 3.6.0 fail to read shapefile with python on buster

2019-03-28 Thread David Marteau
Hi Alessandro

I have found the problem, qgis packaging on buster is totally broken: it mixes 
3.6.0 and 3.6.1 dependencies

If you try to install  python-qgis you get the following packages installed:

ii  libqgis-3d3.6.0 1:3.6.0+15busteramd64   
 QGIS - shared 3d library
ii  libqgis-analysis3.6.0   1:3.6.0+15busteramd64   
 QGIS - shared analysis library
ii  libqgis-core3.6.0   1:3.6.0+15busteramd64   
 QGIS - shared core library 
ii  libqgis-core3.6.1   1:3.6.1+15busteramd64   
 QGIS - shared core library
ii  libqgis-customwidgets   1:3.6.1+15busteramd64   
 QGIS custom widgets for Qt Designer
ii  libqgis-gui3.6.01:3.6.0+15busteramd64   
 QGIS - shared gui library
ii  libqgis-gui3.6.11:3.6.1+15busteramd64   
 QGIS - shared gui library
ii  libqgis-native3.6.0 1:3.6.0+15busteramd64   
 QGIS - shared native gui library
ii  libqgis-native3.6.1 1:3.6.1+15busteramd64   
 QGIS - shared native gui library
ii  libqgis-server3.6.0 1:3.6.0+15busteramd64   
 QGIS - shared server library
ii  libqgispython3.6.0  1:3.6.0+15busteramd64   
 QGIS - shared Python library
ii  python-qgis 1:3.6.0+15busteramd64   
 Python bindings to QGIS
ii  python-qgis-common  1:3.6.0+15busterall 
 Python bindings to QGIS - architecture-independent files

Packages are installed twice in both version 3.6.0 and 3.6.1 !

This lead to very unpredictible behavior when using qgis in python (simply not 
working or crashing randomly)


David,

> Le 26 mars 2019 à 18:38, David Marteau  a écrit :
> 
> 
> Hi Alessandro
> 
> No there is nothing at all in the logs.
> 
> I have used the same reduced snippet on qgis 3.4.5 (ltr) on Stretch and qgis 
> 3.6.0 (release) on buster, using the same datasource:
> 
> ```
> import os
> from qgis.core import QgsApplication, QgsVectorLayer
> 
> # prevent display not found error
> os.environ['QT_QPA_PLATFORM'] = 'offscreen'
> 
> qgis_application = QgsApplication([], False )
> layer = QgsVectorLayer('path/to/data')
> 
> layer.isValid() # Return True on 3.4.5/stretch, False on 3.6.0/buster 
> whatever the data
> ```
> 
> If the release package has not been updated in the previous  24 h, I suspect 
> that something has been broken on the buster distro.
> 
> Note that I'm able to load shapefile in python with ogr (gdal-python).
> 
> 
>> Le 26 mars 2019 à 17:47, Alessandro Pasotti > > a écrit :
>> 
>> 
>> On Tue, Mar 26, 2019 at 5:45 PM David Marteau > > wrote:
>> 
>> The situation seems to be worst: it seems that no layers can be read from 
>> python whatever the format.
>> 
>> 
>>> Le 26 mars 2019 à 17:38, David Marteau >> > a écrit :
>>> 
>>> Hi devs,
>>> 
>>> We use to build docker images of the latest qgis releases and we have a 
>>> regression  affecting version 3.6.0 official release on buster
>>> 
>>> Qgis: 3.6.0 on Debian
>>> 
>>> If we read a layer with python:
>>> 
 layer = QgsVectorLayer('./mydata.shp')
>>> 
>>> Then the layer is invalid (no warning, no errors)
>>> 
>>> Doing the same thing on stretch + Qgis 3.4.5 (ltr) with same data work 
>>> flawlessly and lead to a valid layer.
>>> 
>>> This was not affecting previous build 24 h ago (release end nightly-release)
>>> 
>>> The tests were based with shapefiles from testdata in qgis sources.
>>> 
>>> We are not sure it that come from Qgis itself or from a change on the 
>>> distribution.
>>> 
>>> David,
>>> 
>> 
>> 
>> Hi David,
>> 
>> anything in the logs?
>> 
>> I would check QGIS_PREFIX_PATH env var, and make sure the provider libraries 
>> are found and loaded.
>> 
>> 
>> -- 
>> Alessandro Pasotti
>> w3:   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] QField 1.0 is here

2019-03-28 Thread Marco Bernasocchi
Hi all, sorry for cross posting but I think after almost 8 years from
the first QGIS android commit ("added first scripts" [0]) you will all
be happy to know about a commit [1] I did very recently.

It read: "and Matterhorn it is... both a beauty :)"

Yes, we did name QField 1.0 after the most iconic mountain as they are
both, indeed, a beauty!

You can get it while it’s hot on the Playstore [2] or on GitHub [3]

Here the beginning of the release blog post:

> We are incredibly pleased and proud of just having released such a
jewel and are convinced that, thanks to all its features and conscious
design choices, QField will make your field digitizing work much more
efficient and pleasant.
> Packed with loads of useful features like online and offline features
digitizing, geometry and attributes editing, attribute search, powerful
forms, theme switching, GPS support, camera integration and much more,
QField is the powerful > tool for those who need to edit on the go and
would like to avoid standing in the swamp with a laptop or paper charts.

The whole post with a lot of information about QField can be found at [4]

I'd like to thank the fantastic QGIS and QField community for all the
great translations, documentations, bug reports and general feedback
they gave us. Thanks to all this, we were able to fix plenty of bugs,
address performance issues and even add some super cool new features.

Ciao Marco

[0]
https://github.com/qgis/QGIS-Android/commit/664145015f31783a5687807a7b77049d4e6938c9
[1]
https://github.com/opengisch/QField/commit/4ffd5cedeedde219d9329721209e5bda602dc57d
[2] http://qfield.org/get
[3] https://github.com/opengisch/QField/releases
[4] https://new.opengis.ch/2019/03/28/qfield-1-0-is-here/

-- 
Marco Bernasocchi
QGIS.org Co-chair
ma...@opengis.ch 
+41 (0)79 467 24 70 

OPENGIS.ch Logo 


signature.asc
Description: OpenPGP digital signature
___
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] QgsProcessingAlgorithm / add Layer to project

2019-03-28 Thread Denis Rouzaud
Hi Valérian,

It was an issue in processing code, that Nyall finally itdentified and
fixed here:
https://github.com/qgis/QGIS/pull/9640

Cheers,
Denis

On Wed, 27 Mar 2019, 10:51 Valérian Lebert,  wrote:

> Nous avons complètement migré sur 3.4.
>
> A terme le script doit permettre à l'utilisateur de sélectionner
>
>- la couche des communes
>- le field des noms de commune
>- le field des "codes INSEE" de communes
>
> Par habitude, je souhaitais donc utiliser l'API processing pour packager
> cela dans une interface utilisateur simple (voir PJ) pour le choix des
> différentes inputs.
>
> Nous avons développés plusieurs outils ainsi, mais pour la première fois
> nous devons charger un layer dans le processing et ce n'est pas aussi
> simple que je le pensais.
>
> Est-ce clair?
>
> Valérian
>
> Le mer. 27 mars 2019 à 16:44, Denis Rouzaud  a
> écrit :
>
>> Bonjour,
>>
>> Mais du coup, quel est intérêt de faire ce script sous 3.x?
>>
>>
>>
>>
>> Le mer. 27 mars 2019 à 10:20, Valérian Lebert  a
>> écrit :
>>
>>> Voici ci-joint.
>>> C'est juste un script de test, mon but derrière cela étant de mettre à
>>> jour un script QGIS 2.18 qui permet de charger un fond de plan cadastral à
>>> partir d'une table de communes.
>>>
>>> Les lignes du script "cadastre_temp" entrées directement dans la console
>>> QGIS donnent un résultat valide
>>>
>>> Merci
>>> Valérian
>>>
>>> Le mer. 27 mars 2019 à 16:14, Denis Rouzaud  a
>>> écrit :
>>>
 Bonjour Valérian,

 Est-ce que vous pouvez me transmettre le script complet pour que je
 puisse regarger?
 (je travaille chez OpenGIS).

 Merci,
 Denis

 Le mer. 27 mars 2019 à 09:27, Valérian Lebert  a
 écrit :

> Thanks Denis for your answer.
>
> It helps but I still have some issues with rasterLayers :
>
> --
> vlayer2 =
> QgsVectorLayer('Point?crs=epsg:4326&field=id:integer&field=name:string(20)&index=yes',
> 'vlayer2', "memory")
>
> c_insee = '57533'
> n_couche = 'test_cadastre'
> EPSG_code = '2154'
> urlWithParams = "url=http://inspire.cadastre.gouv.fr/scpc/
> "+c_insee+".wms?contextualWMSLegend=0&crs=EPSG:"+EPSG_code+"&dpiMode=7&featureCount=10&format=image/png&layers=AMORCES_CAD&layers=LIEUDIT&layers=CP.CadastralParcel&layers=SUBFISCAL&layers=CLOTURE&layers=DETAIL_TOPO&layers=HYDRO&layers=VOIE_COMMUNICATION&layers=BU.Building&layers=BORNE_REPERE&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&maxHeight=1024&maxWidth=1280"
>
> rlayer = QgsRasterLayer(urlWithParams,
> 'Cadastre_'+n_couche+'_'+c_insee, 'wms')
>
> context.temporaryLayerStore().addMapLayer(vlayer2)
> context.temporaryLayerStore().addMapLayer(rlayer)
>
> context.addLayerToLoadOnCompletion(vlayer2.id(),context.LayerDetails('test2',
> context.project(), 'test2'))
> context.addLayerToLoadOnCompletion(rlayer.id(),context.LayerDetails('cadastre',
> context.project(), 'cadastre'))
> --
>
> vlayer2 is properly added to the project but i still get an error for
> rlayer
>
>
> Chargement des couches de résultat
>
> Les couches suivantes n'ont pas été générées
> correctement.Cadastre_test_cadastre_57533_249deb86_fd00_4df3_af9a_8d084388ca91Vous
> pouvez vérifier le Panel de messages du journal dans la fenêtre principale
> de QGIS pour trouver plus d'informations à propos de l'exécution de
> l'algorithme.
>
> Any idea?
>
> Le mer. 27 mars 2019 à 14:40, Denis Rouzaud 
> a écrit :
>
>> Hi Valérian,
>>
>> Not 100% sure, but I think you miss
>> context.temporaryLayerStore().addMapLayer(vlayer1) and up to vlayer4
>> before actually adding them to the context.
>>
>> Let me know if it works,
>>
>> Denis
>>
>> Le mer. 27 mars 2019 à 04:32, Valérian Lebert  a
>> écrit :
>>
>>> Hello,
>>>
>>> I am trying to add a layer to project in a QgsProcessingAlgorithm.
>>>
>>> I run the folowing test code, just to find a way to add a layer to
>>> the project. I don't want to use featureSink because at the end the 
>>> layer I
>>> want to add is a raster layer :
>>>
>>> def processAlgorithm(self, parameters, context, feedback):
>>> """
>>> Here is where the processing itself takes place.
>>> """
>>>
>>> vlayer1 =
>>> QgsVectorLayer('Point?crs=epsg:4326&field=id:integer&field=name:string(20)&index=yes',
>>> 'vlayer1', "memory")
>>> vlayer2 =
>>> QgsVectorLayer('Point?crs=epsg:4326&field=id:integer&field=name:string(20)&index=yes',
>>> 'vlayer2', "memory")
>>> vlayer3 =
>>> QgsVectorLayer('Point?crs=epsg:4326&field=id:integer&field=name:string(20)&index=yes',
>>> 'vlayer3', "memory")
>>> vlayer4 =
>>> QgsVectorLayer('Point?crs=epsg:4326&field=id:integer&field=name:string(20)&index=yes'