Re: [QGIS-Developer] GPKG: Group Transaction

2017-12-29 Thread Tobias Wendorff
Am Sa, 30.12.2017, 00:12 schrieb Nyall Dawson:
> It's already done transparently for operations which would benefit
> from this, such as adding many features at once.

Hmm, so the switch is only für PostgreSQL? ;)

___
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] GPKG: Group Transaction

2017-12-29 Thread Nyall Dawson
On 29 December 2017 at 21:50, Tobias Wendorff
 wrote:
> Hi there!
>
> In QGIS3, The tooltip for "Automatically create transaction groups
> where possible" informs that group transactions (=GT) would only
> possible in PostGIS right now.
>
> Are there plans to add GT support on SQLite-based databases, like
> GPKG? The benefit is a much faster writing of datasets.
>
> It's already supported by OGR since v1.11 and earlier.
>

It's already done transparently for operations which would benefit
from this, such as adding many features at once.

Nyall
___
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] Removing QgsProject.instance() from Python bindings?

2017-12-29 Thread Luigi Pirelli
+1 I can't see any problem
Luigi Pirelli

**
* LinkedIn: https://www.linkedin.com/in/luigipirelli
* Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
* GitHub: https://github.com/luipir
* Mastering QGIS 2nd Edition:
* 
https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition
* Hire me: http://goo.gl/BYRQKg
**


On 23 December 2017 at 05:40, Nyall Dawson  wrote:
> Hi all,
>
> Just wondering... before 3.0 launch, should we remove
> QgsProject.instance() from the Python bindings, in favour of something
> like iface.activeProject()?
>
> Sometime in the future (4.0?) we'll end up killing
> QgsProject.instance(), but in the meantime is it a good move to push
> people away from relying on this method?
>
> I'd say yes, given that the 2.x -> 3.0 api break is so huge anyway and
> will generally result in substantial plugin rewriting (vs just
> modifying a few methods), maybe we're better off to get PyQGIS
> developers to deal with this now and factor it into their new
> designs?*
>
> Nyall
>
> * based on the belief that 3.x -> 4.0 will be a gentler transition!!
> ___
> 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] Problems accessing Dockwidget Features

2017-12-29 Thread Luís Miguel Royo Pérez
 It worked!

self.dockwidget = MyDockWidget()

That's the way it worked for me!

Thanks a lot !! ^^




2017-12-29 13:05 GMT+01:00 Richard Duivenvoorde :

> Hi,
>
> Apparently you do not declare the self.dockwidget anywhere?
> As everwhere where you try to USE that it appears to be None.
>
> Normally in the 'initGui' function you create your dialog or dockwidget
> using something like:
>
> self.dlg = MyDialog(self.iface)
> or in your case there should be:
> self.dockwidget = MyDockWidget(self.iface)   <= your constructor
>
> my feeling is that you miss that step (or have a small naming error)
>
> HTH
>
> Richard Duivenvoorde
>
> On 29-12-17 12:58, Luís Miguel Royo Pérez wrote:
> > Hello, I'm writing a QGIS plugin but I'm facing some basic problems. The
> > plugin is a dockwidget. I've built it with plugin Builder and then
> > compiled the resources file.
> >
> > When I try to access the comboBox to populate it with values, an error
> > happens:
> >
> > /self.dockwidget.comboBox.clear() AttributeError: 'NoneType' object
> > has no attribute 'comboBox'/
> >
> > I checked in the Qt _Designer the object name and it's comboBox. When I
> > do the same with a dialog plugin, instead a dockwidget, everything seems
> > to be right, and the comboBox is populated. This is the code for the run
> > method.
> >
> > |defrun(self):"""Run method that loads and starts the
> > plugin"""self.dockwidget.comboBox.clear()fori
> > inrange(9):self.dockwidget.comboBox.addItem(str(i))
> ifnotself.pluginIsActive:self.pluginIsActive
> > =True#print "** STARTING PruebaExp"# dockwidget may not exist if:# first
> > run of plugin# removed on close (see self.onClosePlugin
> > method)ifself.dockwidget ==None:# Create the dockwidget (after
> > translation) and keep referenceself.dockwidget =PruebaExpDockWidget()#
> > connect to provide cleanup on closing of
> > dockwidgetself.dockwidget.closingPlugin.connect(self.onClosePlugin)#
> > show the dockwidget# TODO: fix to allow choice of dock
> > locationself.iface.addDockWidget(Qt.LeftDockWidgetArea,self.
> dockwidget)self.dockwidget.show()|
> >
> > I don't know if it's related, but when I try to create a signal this
> > error is show:
> >
> > /File "XXX/PruebaExp.py", line 176, in initGui
> > self.dockwidget.signalBox.connect(self.enviadato) AttributeError:
> > 'NoneType' object has no attribute 'signalBox'/
> >
> > Same error when I try to acces a pushButton:
> >
> > /File "/home/luismi/.qgis2/python/plugins/PruebaExp/PruebaExp.py", line
> > 221, in run/
> >
> > /self.dockwidget.pushButton.clicked.connect(self.enviadato)/
> >
> > /AttributeError: 'NoneType' object has no attribute 'pushButton'/
> >
> > Maybe is due to something I missed during the building of the plugin.
> > I'm using QGIS 2.18.14.
> >
> >
> >
> > --
> > Luís Miguel Royo Pérez.
> > Analista-Programador GIS
> > Av. Blasco Ibañez nº 1. Manises (Valencia)
> > Teléfono: 679846103
> > web: inisig.com 
> >
> >
> >
> > ___
> > 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
> >
>
>


-- 
Luís Miguel Royo Pérez.
Analista-Programador GIS
Av. Blasco Ibañez nº 1. Manises (Valencia)
Teléfono: 679846103
web: inisig.com
___
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] Removing QgsProject.instance() from Python bindings?

2017-12-29 Thread kimaidou
Hi,

Ok for this change, but please take the Server into account, where iface is
not usable, but serverIface instead. Please add the activeProject method to
the server interface too, as server plugins shall use the project

Regards
Michaël

2017-12-23 11:23 GMT+01:00 Matthias Kuhn :

> +1
>
> for the advantage, that when we go MultiProject we can just add a
> activeProjectChanged signal
>
> Matthias
>
>
> On 12/23/2017 05:40 AM, Nyall Dawson wrote:
> > Hi all,
> >
> > Just wondering... before 3.0 launch, should we remove
> > QgsProject.instance() from the Python bindings, in favour of something
> > like iface.activeProject()?
> >
> > Sometime in the future (4.0?) we'll end up killing
> > QgsProject.instance(), but in the meantime is it a good move to push
> > people away from relying on this method?
> >
> > I'd say yes, given that the 2.x -> 3.0 api break is so huge anyway and
> > will generally result in substantial plugin rewriting (vs just
> > modifying a few methods), maybe we're better off to get PyQGIS
> > developers to deal with this now and factor it into their new
> > designs?*
> >
> > Nyall
> >
> > * based on the belief that 3.x -> 4.0 will be a gentler transition!!
> > ___
> > 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 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] GPKG: Group Transaction

2017-12-29 Thread Tobias Wendorff
Hi there!

In QGIS3, The tooltip for "Automatically create transaction groups
where possible" informs that group transactions (=GT) would only
possible in PostGIS right now.

Are there plans to add GT support on SQLite-based databases, like
GPKG? The benefit is a much faster writing of datasets.

It's already supported by OGR since v1.11 and earlier.

Best regards,
Tobias

___
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] Problems accessing Dockwidget Features

2017-12-29 Thread Richard Duivenvoorde
Hi,

Apparently you do not declare the self.dockwidget anywhere?
As everwhere where you try to USE that it appears to be None.

Normally in the 'initGui' function you create your dialog or dockwidget
using something like:

self.dlg = MyDialog(self.iface)
or in your case there should be:
self.dockwidget = MyDockWidget(self.iface)   <= your constructor

my feeling is that you miss that step (or have a small naming error)

HTH

Richard Duivenvoorde

On 29-12-17 12:58, Luís Miguel Royo Pérez wrote:
> Hello, I'm writing a QGIS plugin but I'm facing some basic problems. The
> plugin is a dockwidget. I've built it with plugin Builder and then
> compiled the resources file.
> 
> When I try to access the comboBox to populate it with values, an error
> happens:
> 
> /self.dockwidget.comboBox.clear() AttributeError: 'NoneType' object
> has no attribute 'comboBox'/
> 
> I checked in the Qt _Designer the object name and it's comboBox. When I
> do the same with a dialog plugin, instead a dockwidget, everything seems
> to be right, and the comboBox is populated. This is the code for the run
> method.
> 
> |defrun(self):"""Run method that loads and starts the
> plugin"""self.dockwidget.comboBox.clear()fori
> inrange(9):self.dockwidget.comboBox.addItem(str(i))ifnotself.pluginIsActive:self.pluginIsActive
> =True#print "** STARTING PruebaExp"# dockwidget may not exist if:# first
> run of plugin# removed on close (see self.onClosePlugin
> method)ifself.dockwidget ==None:# Create the dockwidget (after
> translation) and keep referenceself.dockwidget =PruebaExpDockWidget()#
> connect to provide cleanup on closing of
> dockwidgetself.dockwidget.closingPlugin.connect(self.onClosePlugin)#
> show the dockwidget# TODO: fix to allow choice of dock
> locationself.iface.addDockWidget(Qt.LeftDockWidgetArea,self.dockwidget)self.dockwidget.show()|
> 
> I don't know if it's related, but when I try to create a signal this
> error is show:
> 
> /File "XXX/PruebaExp.py", line 176, in initGui
> self.dockwidget.signalBox.connect(self.enviadato) AttributeError:
> 'NoneType' object has no attribute 'signalBox'/
> 
> Same error when I try to acces a pushButton:
> 
> /File "/home/luismi/.qgis2/python/plugins/PruebaExp/PruebaExp.py", line
> 221, in run/
> 
> /self.dockwidget.pushButton.clicked.connect(self.enviadato)/
> 
> /AttributeError: 'NoneType' object has no attribute 'pushButton'/
> 
> Maybe is due to something I missed during the building of the plugin.
> I'm using QGIS 2.18.14.
> 
> 
> 
> -- 
> Luís Miguel Royo Pérez.
> Analista-Programador GIS
> Av. Blasco Ibañez nº 1. Manises (Valencia)
> Teléfono: 679846103
> web: inisig.com 
> 
> 
> 
> ___
> 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] Problems accessing Dockwidget Features

2017-12-29 Thread Luís Miguel Royo Pérez
Hello, I'm writing a QGIS plugin but I'm facing some basic problems. The
plugin is a dockwidget. I've built it with plugin Builder and then compiled
the resources file.

When I try to access the comboBox to populate it with values, an error
happens:

*self.dockwidget.comboBox.clear() AttributeError: 'NoneType' object has no
attribute 'comboBox'*

I checked in the Qt _Designer the object name and it's comboBox. When I do
the same with a dialog plugin, instead a dockwidget, everything seems to be
right, and the comboBox is populated. This is the code for the run method.

def run(self):
"""Run method that loads and starts the plugin"""
self.dockwidget.comboBox.clear()
for i in range(9):
self.dockwidget.comboBox.addItem(str(i))

if not self.pluginIsActive:
self.pluginIsActive = True

#print "** STARTING PruebaExp"

# dockwidget may not exist if:
#first run of plugin
#removed on close (see self.onClosePlugin method)
if self.dockwidget == None:
# Create the dockwidget (after translation) and keep reference
self.dockwidget = PruebaExpDockWidget()

# connect to provide cleanup on closing of dockwidget
self.dockwidget.closingPlugin.connect(self.onClosePlugin)

# show the dockwidget
# TODO: fix to allow choice of dock location
self.iface.addDockWidget(Qt.LeftDockWidgetArea, self.dockwidget)
self.dockwidget.show()

I don't know if it's related, but when I try to create a signal this error
is show:

*File "XXX/PruebaExp.py", line 176, in initGui
self.dockwidget.signalBox.connect(self.enviadato) AttributeError:
'NoneType' object has no attribute 'signalBox'*

Same error when I try to acces a pushButton:

*File "/home/luismi/.qgis2/python/plugins/PruebaExp/PruebaExp.py", line
221, in run*

* self.dockwidget.pushButton.clicked.connect(self.enviadato)*

* AttributeError: 'NoneType' object has no attribute 'pushButton'*

Maybe is due to something I missed during the building of the plugin. I'm
using QGIS 2.18.14.


-- 
Luís Miguel Royo Pérez.
Analista-Programador GIS
Av. Blasco Ibañez nº 1. Manises (Valencia)
Teléfono: 679846103
web: inisig.com
___
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] WFS vs WMS data types

2017-12-29 Thread Richard Duivenvoorde
Hi Dev's,

(talking about 2.18 here)

WFS and WMS of the same service seem to create different attribute
data-types?

Going to this WFS:

https://geodata.nationaalgeoregister.nl/bag/ows?

there is a layer with 'panden' (houses), which have a column
'identification' which is (should be) a long integer (up to about 15
positions long).

On a WMS GetFeatureInfo request (same url) you will see those id's as
nice long integers/strings:
159810022426

BUT if you request the same house in a WFS layer, you will see floats:
1.5981002243e+15
for example in the attribute table, or if you use the info-tool.

This is a problem if you need that id to create joints/relations.

I had a look into the sqlite file which is created in:
~/.qgis2/cache/wfsprovider/pid_16544
and indeed see this create table sql:

CREATE TABLE 'features' ( "__ogc_fid" INTEGER PRIMARY KEY AUTOINCREMENT,
'identificatie' FLOAT, 'bouwjaar' FLOAT, 'status' VARCHAR(255),
'gebruiksdoel' VARCHAR(255), 'oppervlakte_min' FLOAT, 'oppervlakte_max'
FLOAT, 'aantal_verblijfsobjecten' BIGINT, 'actualiteitsdatum' BIGINT,
'__qgis_gen_counter' INTEGER, '__qgis_gmlid' VARCHAR(255),
'__qgis_hexwkb_geom' VARCHAR(255), "__spatialite_geometry" POLYGON)

Is this a fixable (hopefully 2.18 only) problem?
As 2.18 will be LTR for some time.

Happy to create an issue for this. I also attache a 2.18 project file
which has these 2 layers zoomed in on a place with those long ids.

Regards,

Richard Duivenvoorde


wfsdatatypes.qgs
Description: application/qgis
___
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