Re: [Qgis-user] QGIS 3.6 - can't load new Postgis layer using DB Manager

2019-02-28 Thread CzendaZdenda
Thanks a lot Jürgen :)

For now, I just changed "_getSqlExecutableQuery()" to
"_getExecutableSqlQuery()" at DB Manager plugin.

Have a nice day :)



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
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] QGIS 3.6 - can't load new Postgis layer using DB Manager

2019-02-28 Thread Jürgen E . Fischer
Hi Czenda,

On Thu, 28. Feb 2019 at 20:21:05 -0700, CzendaZdenda wrote:
> *QGIS 3.6.0*
> File 
> "D:/OSGeo4W64/apps/qgis-ltr/./python/plugins\db_manager\dlg_sql_window.py", 
> line 396, in loadSqlLayer
> layer = self._getSqlLayer(self.filter)
> File 
> "D:/OSGeo4W64/apps/qgis-ltr/./python/plugins\db_manager\dlg_sql_window.py", 
> line 358, in _getSqlLayer
> query = self._getSqlExecutableQuery()
> AttributeError: 'DlgSqlWindow' object has no attribute 
> '_getSqlExecutableQuery'
> 
> *QGIS 3.4.5*
> File "D:/OSGeo4W64/apps/qgis/./python/plugins\db_manager\dlg_sql_window.py", 
> line 434, in loadSqlLayer
> layer = self._getSqlLayer(self.filter)
> File "D:/OSGeo4W64/apps/qgis/./python/plugins\db_manager\dlg_sql_window.py", 
> line 396, in _getSqlLayer
> query = self._getSqlExecutableQuery()
> AttributeError: 'DlgSqlWindow' object has no attribute 
> '_getSqlExecutableQuery'

See https://issues.qgis.org/issues/21353


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-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] QGIS 3.6 - can't load new Postgis layer using DB Manager

2019-02-28 Thread CzendaZdenda
Hi all,

I am using Windows 10 64-bit, via OSGEO4W I have installed QGIS. Everything
works ok, but when I update QGIS to version 3.6.0-Noosa and QGIS
3.4.5-Madeira (as LTR) I can't load new Postgis layers using DB Manager and
its query window. I can add directly whole table (with geometry column)
using 'Add to Canvas'. But when I want to "Load" layer from query window, I
get an error:

*QGIS 3.6.0*
File
"D:/OSGeo4W64/apps/qgis-ltr/./python/plugins\db_manager\dlg_sql_window.py",
line 396, in loadSqlLayer
layer = self._getSqlLayer(self.filter)
File
"D:/OSGeo4W64/apps/qgis-ltr/./python/plugins\db_manager\dlg_sql_window.py",
line 358, in _getSqlLayer
query = self._getSqlExecutableQuery()
AttributeError: 'DlgSqlWindow' object has no attribute
'_getSqlExecutableQuery'


*QGIS 3.4.5*
File "D:/OSGeo4W64/apps/qgis/./python/plugins\db_manager\dlg_sql_window.py",
line 434, in loadSqlLayer
layer = self._getSqlLayer(self.filter)
File "D:/OSGeo4W64/apps/qgis/./python/plugins\db_manager\dlg_sql_window.py",
line 396, in _getSqlLayer
query = self._getSqlExecutableQuery()
AttributeError: 'DlgSqlWindow' object has no attribute
'_getSqlExecutableQuery'

I can also load new Postgis layer using pyqgis. When I open old projects old
layers are loaded without any problem also.

It looks like GUI issue (DlgSqlWindow).

Maybe it is not connected with updating to new QGIS version, but does
anybody know, how to fix it?

Thanks,
Czenda

 



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
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] [QGIS-Developer] QEP 140: QGIS Processing standalone executable

2019-02-28 Thread Nyall Dawson
On Wed, 27 Feb 2019 at 18:16, David Marteau  wrote:
>
> Hi Nyall
>
> You may be interested in some work already done for running qgis processing 
> algorithms at server side with no gui and direct calls to "createAlgorithms":
>
> https://github.com/3liz/py-qgis-wps
>
> Development of embedding the processing machinery has raised some interesting 
> questions about using processing in stand alone programs.

Right -- use cases like this are actually one of the main motivations
behind the standalone executable!

The way I see it, benefits of using a standalone executable called via
subprocess (vs direct use of the PyQGIS API) for tools like
py-qgis-wps are:
- safer: less risk of the processing subprocess crashing and bringing
down the whole server process with it
- easier to use: no need to worry about the process of initializing
qgis and processing manually - this is all taken care of for you.
- works correctly with plugins, without the complexity of manually handling this
- easier to multithread without incurring Python GIL locks

Nyall


>
> David
>
> Le 27 févr. 2019 à 04:36, Nyall Dawson  a écrit :
>
> Hi all,
>
> Just a heads up for a newly filed QEP regarding a standalone tool for
> executing QGIS Processing algorithms outside of the desktop GUI
> application. Read the full details and comment here:
>
> https://github.com/qgis/QGIS-Enhancement-Proposals/issues/140
>
> Nyall
> ___
> QGIS-Developer mailing list
> qgis-develo...@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
___
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] adding text field from PostgreSQL table without geometry

2019-02-28 Thread wambacher
Hi,

i would like to add a variable text to the graph,  where data is in a
postgres *table **without geometries*.

it's the timestamp of the currently used dataset.

Query is "select timestamp from timestamps where
tablename='collected_admin_boundaries';"  which returns a timestamp like
"2019-02-27 23:00:03+01"

this value should be visible on the graph.

any ideas?

walter/germany

-- 
My projects:

Admin Boundaries of the World 
Missing Boundaries

Emergency Map 
Postal Code Map (Germany only) 
Fools (QA for zipcodes in Germany) 
Postcode Boundaries of Germany 
___
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] python qgis 3 adding features fails partly

2019-02-28 Thread Reginald
Thanks Michel for this explanation.
I can now indeed add the table to QGIS.

I used MultiPolygon in stead of Point and created the test table.
I changed my code to:


from qgis.PyQt.QtCore import *
from PyQt5.QtGui import *

perceellayer=None
premielayer=None
layers = [layer for layer in QgsProject.instance().mapLayers().values()]
for lyr in layers:
if lyr.name() == "Adpf1836007": #layer we use to copy existing geometry
perceellayer = lyr
if lyr.name() == "test":
premielayer = lyr
features = perceellayer.selectedFeatures()
geom = None
for f in features:
if geom == None:
geom = f.geometry()
else:
geom = geom.combine(f.geometry())

caps = premielayer.dataProvider().capabilities()
if caps & premielayer.dataProvider().AddFeatures:
# de laag is editeerbaar
feat = QgsFeature(premielayer.fields())
feat.setGeometry(geom)
result = iface.openFeatureForm(premielayer, feat, showModal=False)
print(result)
premielayer.addFeature(feat)
premielayer.updateFields()
print("klaar")
else:
print("Gelieve de laag met betreffende premies editeerbaar te maken door
op het potloodje te klikken")

When I select a parcel and run the code with the test layer set as editable
I get this error when I click OK:

2019-02-28T12:43:18 CRITICALLaag test : PostGIS fout bij het
toevoegen van objecten: ERROR: null value in column "id" violates not-null
constraint
 DETAIL: Failing row contains (null, null,
0106208A7A0100010300010008FE43FAC654...).

I used 'testwaarde' as naam and 1 as id.

Any idea what is going wrong here?

Regards,



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
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] retrieve the Legend from wms using the SCALE parameter

2019-02-28 Thread Andrea Peri
Hi,
I notice that in qgis 2.18 and also in qgis 3.0
is not possible to retrieve the legend from the wms layer (using of course
the getLegendGraphic comand) apply-ing the SCALE parameter.

SCALE parameter is a STANDARD OGC parameter (optional) to retrieve the
legend
at the actual scale

QGIS allow to retrieve the legend using the the CONTEXTUAL option.
But it is anot standard parameter.
The contextual is of course more powerful but is a not standard and so not
always all the wms support it.

So' actually the only option is the standard getlegendgraphics that
retrieve without the scale parameter.

This some time give wrong lgends.

I report two eample.

The first is a good legend retrieved using the SCALE parameter from a wms
layer.

The second is a good example of what mean "sometime" retrieve the legend
without the scale parameter.

The second example repeat three time the same domain because there are
three different rendering at three scale interval.
Without the scale parameter the wms send ALL the legend for EVERY scale
interval.

The first example instead using the sCALE parameter obtain the right legend
for the scale of the MAP.

A.

-- 
-
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-
___
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] Menu item missing in QGIS 3.6

2019-02-28 Thread SIGéal

You can find it in the processing panel.

--
Christophe Damour

Le 28/02/2019 à 10:48, stl a écrit :


In QGIS 3.4.4 I had a menu item …vector…geometry tools…polygon to line.

That menu item is missing in QGIS 3.6 and I can’t find a way to get it 
back.


In the menu configuration the point is missing too.

Any ideas on how to get it back?


___
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] python qgis 3 adding features fails partly

2019-02-28 Thread Michel Stuyts
You can add an empty table to QGIS but it depends on the definition of your 
geometry column.

This table can be added:
CREATE TABLE public.test
(
id oid NOT NULL,
naam text COLLATE pg_catalog."default" NOT NULL,
geom geometry(Point,31370),
CONSTRAINT test_pkey PRIMARY KEY (id)
)


This table cannot be added:
CREATE TABLE public.test
(
id oid NOT NULL,
naam text COLLATE pg_catalog."default" NOT NULL,
geom geometry(Geometry,31370),
CONSTRAINT test_pkey PRIMARY KEY (id)
)

The easiest way to create the new table is to use the DB Manager.

Michel

-Oorspronkelijk bericht-
Van: Qgis-user  Namens Reginald
Verzonden: donderdag 28 februari 2019 9:22
Aan: qgis-user@lists.osgeo.org
Onderwerp: Re: [Qgis-user] python qgis 3 adding features fails partly

Hi,

I'm still scratching my head over this one.
As a test I created a table 'test' in postgis:
id: pkey type oid
naam: type text
geom: type geometry

select updateGeometrySrid('test','geom',31370) # assigning projected CRS to 
geometry

When I try to add this table to qgis using the database explorer I get an error 
because there is no geometry in the table.
So I was wondering if it is impossible to add an empty postgis table to qgis?

Regards,



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
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

[Qgis-user] Menu item missing in QGIS 3.6

2019-02-28 Thread stl
In QGIS 3.4.4 I had a menu item .vector.geometry tools.polygon to line.



That menu item is missing in QGIS 3.6 and I can't find a way to get it back.

In the menu configuration the point is missing too.



Any ideas on how to get it back?





___
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] python qgis 3 adding features fails partly

2019-02-28 Thread Reginald
Hi,

I'm still scratching my head over this one.
As a test I created a table 'test' in postgis:
id: pkey type oid
naam: type text
geom: type geometry

select updateGeometrySrid('test','geom',31370) # assigning projected CRS to
geometry

When I try to add this table to qgis using the database explorer I get an
error because there is no geometry in the table.
So I was wondering if it is impossible to add an empty postgis table to
qgis?

Regards,



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
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