Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Sandro Santilli
On Tue, Oct 18, 2016 at 11:00:54AM +0200, Mark Johnson wrote:

> Inside QgsOgrProvider all of this is done as needed, but when using the
> OGR-API directly each step must be done manually.

This is done in multi-step already, is it not ?
https://github.com/qgis/QGIS/blob/dc5abfed892c0e8d8eac0e016dc5ee37e7725632/python/plugins/processing/tools/vector.py#L573-L579

The problem, as Germán found out, is that the URI passed as parameter
is not necessarely an OGR provider URI, but a generic QGIS uri, from
any provider, so it cannot always be opened via ogr.Open.

In ogrConnectionString there seem to be an attempt to fetch the actual
layer from the uri, but doesn't seem to work always.

I've pushed a further tweak to the ogrLayerName function so to have
it properly documented AND correctly handle PostgreSQL provider URIs

--strk;
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Sandro Santilli
On Tue, Oct 18, 2016 at 11:55:21AM +0200, Mark Johnson wrote:
> >
> > The problem, as Germán found out, is that the URI passed as parameter
> > is not necessarely an OGR provider URI, but a generic QGIS uri, from
> > any provider, so it cannot always be opened via ogr.Open.
> 
> Yes, ogr-sysntax must be used.
> 
> # -- Spatialite provider
> 
> # dbname='/tmp/x.sqlite' table="t" (geometry) sql='
> 
> would need to call 'GetLayerByName'

But the above is NOT an ogrDataSource
Please see with current master_2 branch if the test work for you
with both GDAL 1 and GDAL 2:

Running the automated test is done via:

  ctest -V -R ProcessingToolsTest

Manual tests imply importing layers to postgis (via processing).

They pass here with GDAL 2


--strk;
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Victor Olaya
I made a fix to the check that verifies if a string parameter is left
blank or not. Before, it just checked that it was None, so empty
strings where considered valid values. However, an empty string should
be considered a null one (mainly, to raise an exception if that is
used for a parameter that is not optional). Before that, an empty
string was accepted even if the parameter was mandatory.

looks like ogr algorithms use unicode(getParameterValue()), and they
should instead get the param value and check whether is None or not.

Actually, there is no need to cast it to str or unicode, the value is
already a string. So it looks like ogr algorithms have to be modified
to adapat to this.

A simpler solution is that now, when a null value is passed (None,
empty string, anything that evaluates to false...), it sets the value
of the parameter as None. It could set it to an empty string, so no
need to do any change. Not such a clean solution, but it will work.

Any thoughts on that?

2016-10-18 12:29 GMT+02:00 Sandro Santilli :
> I've noticed lots of "None" strings in the ogr2ogr call from master_2
> branch onward and it looks like what you get from unicode(None) in
> python.
>
> The code checks for parameter values's length being > 0 before adding
> params to ogr2ogr call but all the empty param are now real "None"
> strings (due to unicode call).
>
> This doesn't seem happen in 2.16 branch.
>
> Victor: something to mass-clean ?
>
> --strk;
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Backport of master feature in QGIS 2.18

2016-10-18 Thread DelazJ
2016-10-18 11:40 GMT+02:00 Jürgen E. Fischer :

> Hi Harrissou,
>
> On Tue, 18. Oct 2016 at 11:30:57 +0200, DelazJ wrote:
> > > Transifex is already target for QGIS3 (as it sticked with master).
> >
> > @Jürgen, are you sure about that?
>
> Yes.  But it's not updated regularly.  So you might find stuff that isn't
> in
> master anymore, but still appears in master_2.  Not sure if that fits your
> example.
>
> Actually, the string still exists in both file but not at the same row
(few lines differences). And it's the address in master_2 that matches the
one in Transifex.
But I trust you if you say 2.18 is not being translated in Transifex.
Could be nice to announce the interim steps of 2.18 translation in the
translators/community(?) list.

Harrissou


> > > master_2, we talked about returning to the old scheme (ie.
> > > scripts/update_ts_files.sh and committing language update individual).
>
> > As stated above, I don't know if this decision is effective but I'm not
> sure
> > translators were informed about it.
>
> I'm not sure either.  And at the time it wasn't clear that there would be
> any
> more 2.x releases at all.
>
>
> 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 Norden
> http://www.norbit.de
> QGIS release manager (PSC)  GermanyIRC: jef on FreeNode
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Sandro Santilli
On Mon, Oct 17, 2016 at 04:31:51PM +0200, Mark Johnson wrote:

> In this case, if I have now understood correctly, you are opening the
> source before retrieving the layer.

What do you mean by "opening the source" and "retrieving the layer" ?
They sound like the same operation to me ?

--strk;
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Mark Johnson
>
> The problem, as Germán found out, is that the URI passed as parameter
> is not necessarely an OGR provider URI, but a generic QGIS uri, from
> any provider, so it cannot always be opened via ogr.Open.


Yes, ogr-sysntax must be used.



# -- Spatialite provider

# dbname='/tmp/x.sqlite' table="t" (geometry) sql='


would need to call 'GetLayerByName'

Here again there is a problem between gdal 1.* and gdal 2.*

Where there is a table with more than 1 geometry the syntax
 'tablename(fieldname)' can be used

In gdal 2.* that syntax can also be used with a table with only 1 geometry
- but not in gdal 1.*: there only the tablename can be used

sLayername="t(geometry)"; // ok for gdal 2.* or gdal 1.* with > 1 geometry
sLayername="t"; // ok for gdal 2.* or gdal 1.* with 1 geometry

ogrLayer = OGR_DS_GetLayerByName( ogrDataSource, TO8( sLayerName ) );

This should work for both PostgreSQL and spatialite based on your samples.

Mark Johnson
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Add scripts from file Processing

2016-10-18 Thread matteo
Hi devs,

I'm trying to duplicate the "Add script from file" in Processing also
for R algorithms.

I'm struggling with an error that happens both with "my" code but also
with the default "Add script from file" method.

When you click the "Add script from file" menu a dialog opens and you
can browse for the scripts. Here the problem, if you click both on OK
and Cancel the following error appears:



An error has occurred while executing Python code:

ValueError: need more than 0 values to unpack
Traceback (most recent call last):
  File
"/home/matteo/.qgis2/python/plugins/processing/gui/ProcessingToolbox.py",
line 276, in executeAlgorithm
action.execute()
  File
"/home/matteo/.qgis2/python/plugins/processing/script/AddScriptFromFileAction.py",
line 57, in execute
self.tr('Script files (*.py *.PY)', 'AddScriptFromFileAction'))
ValueError: need more than 0 values to unpack




Obviously I get the same error for my code because I took that code as
template.

I cannot fix it, someone has an idea?


Thanks

Matteo
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Mark Johnson
>
> But the above is NOT an ogrDataSource

yes, but you are using the OGR-API directly
- so you must use the OGR-Syntax

i.e. you must 'translate' the syntax used in QgsSpatiaLiteProvider to
something OGR will understand.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Sandro Santilli
On Tue, Oct 18, 2016 at 12:41:32PM +0200, Mark Johnson wrote:
> >
> > > Running the automated test is done via:
> > >
> > >   ctest -V -R ProcessingToolsTest
> 
> I have never used this before, from where should it be called?

From the root of the build tree.
The corresponding code is in
${SRCDIR}/python/plugins/processing/tests/ToolsTest.py

Contributions to the test coverage are welcome

--strk;
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Master_2: error: ‘isinf’ was not declared in this scope

2016-10-18 Thread René-Luc Dhont

Thanks Matthias,

it works!

can I push this bugfix and backport it ? Or do I have to create a PR ?

Regards,
René-Luc

Le 17/10/2016 à 18:41, Matthias Kuhn a écrit :

Hmmm...

What about replacing isinf with qIsInf? (and if required #include "qgis.h")?

On 10/17/2016 06:32 PM, René-Luc Dhont wrote:

Hi Matthias,

It does not help me if I add #include  in
src/gui/qgsscalerangewidget.cpp

Regards,
René-Luc

Le 17/10/2016 à 18:26, Matthias Kuhn a écrit :

He René-Luc

does it help if you #include  in src/gui/qgsscalerangewidget.cpp?

Matthias

On 10/17/2016 06:08 PM, René-Luc Dhont wrote:

Hi devs,

I have this error during the qgis master_2 building:
```
../src/gui/qgsscalerangewidget.cpp:93:21: error: ‘isinf’ was not
declared in this scope
 if ( isinf( scale ) )
   ^
../src/gui/qgsscalerangewidget.cpp:93:21: note: suggested alternative:
In file included from /usr/include/c++/5/random:38:0,
   from /usr/include/c++/5/bits/stl_algo.h:66,
   from /usr/include/c++/5/algorithm:62,
   from /usr/include/qt4/QtCore/qglobal.h:68,
   from /usr/include/qt4/QtCore/qnamespace.h:45,
   from /usr/include/qt4/QtCore/qobjectdefs.h:45,
   from /usr/include/qt4/QtCore/qobject.h:47,
   from /usr/include/qt4/QtGui/qlayout.h:45,
   from /usr/include/qt4/QtGui/qgridlayout.h:45,
   from /usr/include/qt4/QtGui/QGridLayout:1,
   from ../src/gui/qgsscalerangewidget.h:19,
   from ../src/gui/qgsscalerangewidget.cpp:16:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
   isinf(_Tp __x)
   ^
../src/gui/qgsscalerangewidget.cpp: In member function ‘void
QgsScaleRangeWidget::setMaximumScale(double)’:
../src/gui/qgsscalerangewidget.cpp:105:21: error: ‘isinf’ was not
declared in this scope
 if ( isinf( scale ) )
   ^
../src/gui/qgsscalerangewidget.cpp:105:21: note: suggested alternative:
In file included from /usr/include/c++/5/random:38:0,
   from /usr/include/c++/5/bits/stl_algo.h:66,
   from /usr/include/c++/5/algorithm:62,
   from /usr/include/qt4/QtCore/qglobal.h:68,
   from /usr/include/qt4/QtCore/qnamespace.h:45,
   from /usr/include/qt4/QtCore/qobjectdefs.h:45,
   from /usr/include/qt4/QtCore/qobject.h:47,
   from /usr/include/qt4/QtGui/qlayout.h:45,
   from /usr/include/qt4/QtGui/qgridlayout.h:45,
   from /usr/include/qt4/QtGui/QGridLayout:1,
   from ../src/gui/qgsscalerangewidget.h:19,
   from ../src/gui/qgsscalerangewidget.cpp:16:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
   isinf(_Tp __x)
   ^
```
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Sandro Santilli
On Mon, Oct 17, 2016 at 09:37:36AM -0500, Germán Carrillo wrote:
> Hi All,
> 
> 
> I've been studying ogrLayerName and GDAL/OGR algorithms in recent days. I
> understand ogrLayerName expects a URI from QGIS layers.

Of *any* provider, right ? And there's no way to know the provider
name from the URI. I think such interface is too fragile and should
be changed ASAP, don't you think ?

> One valid QGIS layer URI might be (talking about Spatialite layers):
> 
> 'dbname=\'/tmp/test.sqlite\' table="test" (geometry) sql='
> 
> The PR you merged [1] made it impossible to run an OGR algorithm with a
> Spatialite layer with such URI. Hence my comment to the corresponding
> commit.

I fixed that with a subsequent commit:
https://github.com/qgis/QGIS/commit/fdc3542a2c39cdd12262826d5d92b3e1b62859ea

Please rebase your PR to take that into account.

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   https://strk.kbt.io/services.html
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Mark Johnson
>
> What do you mean by "opening the source" and "retrieving the layer" ?
> They sound like the same operation to me ?


 In the Python code you are using the OGR Interface

ds = ogr.Open(ogruri)

in c++ (as used in QgsOgrProvider) this corresponds to:

OGRDataSourceH hDS = OGROpen( pszPath, bUpdate,  );

it will only open the Datasource for use.

OGR will read the datasource and create the infastructure needed during
reading
- such as a list of layers
-- in gdal 1.* each geometry is 1 layer (with only 1 geometry-field)
-- in gdal 2.* each table is 1 layer that may contain more than 1
geometry-field

At this point you can decide what to do
- list the layers and the fields
- select a specific layer with a geometry-field

Either with the layer-id:
python:
ly = ds.GetLayer(layerid)

in c++ (as used in QgsOgrProvider) this corresponds to:
ogrLayer = OGR_DS_GetLayer( ogrDataSource, iLayerIndex );

or with the layer-name
ogrLayer = OGR_DS_GetLayerByName( ogrDataSource, TO8( sLayerName ) );

when all tasks are completed, the Datasource is closed.

Inside QgsOgrProvider all of this is done as needed, but when using the
OGR-API directly each step must be done manually.

Mark Johnson
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Backport of master feature in QGIS 2.18

2016-10-18 Thread DelazJ
Hi,

2016-10-18 2:02 GMT+02:00 Jürgen E. Fischer :

> Hi Even,
>
> On Thu, 13. Oct 2016 at 12:18:38 +0200, Even Rouault wrote:
> > - this PR adds new strings to translate (the DBManager changes might
> also).
> > Will translators do another round of translations for 2.18.x ? If not,
> this
> > might not be material appropriate for 2.18.x
>
> Transifex is already target for QGIS3 (as it sticked with master).



@Jürgen, are you sure about that?
Looking at the metadata of this new string in Transifex (
https://www.transifex.com/qgis/QGIS/translate/#fr/qgis-application/96618210
- sorry, it may not be visible to all), it appears that its source is
../src/ui/qgslabelingguibase.ui:4009

While https://github.com/qgis/QGIS/blob/master_2/src/ui/
qgslabelingguibase.ui#L4009 leads to the same strings,
https://github.com/qgis/QGIS/blob/master/src/ui/qgslabelingguibase.ui#L4009
doesn't.



>   For
> master_2, we talked about returning to the old scheme (ie.
> scripts/update_ts_files.sh and committing language update individual).
>

As stated above, I don't know if this decision is effective but I'm not
sure translators were informed about it. Afaics, I didn't see such
information and believed that (if my previous assumptions are false) I was
translating the next release (2.18) in Transifex and not the one after. And
unfortunately I may not be alone.

Regards,
Harrissou


> > - as we are in 2.18.0 feature freeze, must I wait for 2.18.0 to be
> released
> > before backporting (depending on previous question) ?
>
> When we decided on the time frame for 2.18 in Bonn, we also decided that
> you
> can add your geopackage improvements into 2.18.1 and I can add DWG support
> once
> it ready - regardless of the feature freeze that normally applies to
> releases.
> IMHO it shouldn't be applied now before 2.18 is released.
>
>
> 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 Norden
> http://www.norbit.de
> QGIS release manager (PSC)  GermanyIRC: jef on FreeNode
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Sandro Santilli
I've noticed lots of "None" strings in the ogr2ogr call from master_2
branch onward and it looks like what you get from unicode(None) in
python.

The code checks for parameter values's length being > 0 before adding
params to ogr2ogr call but all the empty param are now real "None"
strings (due to unicode call).

This doesn't seem happen in 2.16 branch.

Victor: something to mass-clean ?

--strk; 
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Victor Olaya
>
> It sounds like having getParamaterValue() always return a string
> (possibly empty) would reduce regression probabilities.
>
> Or do you think it's important to distinguish between empty string
> and None ?
>

sounds safe to me. And it would be nicer to make that distinction, but
i think it is not so important. I cannot think of any major issue with
that
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Sandro Santilli
On Tue, Oct 18, 2016 at 12:45:10PM +0200, Sandro Santilli wrote:
> On Tue, Oct 18, 2016 at 12:37:39PM +0200, Victor Olaya wrote:
> > I made a fix to the check that verifies if a string parameter is left
> > blank or not. Before, it just checked that it was None, so empty
> > strings where considered valid values. However, an empty string should
> > be considered a null one (mainly, to raise an exception if that is
> > used for a parameter that is not optional). Before that, an empty
> > string was accepted even if the parameter was mandatory.
> > 
> > looks like ogr algorithms use unicode(getParameterValue()), and they
> > should instead get the param value and check whether is None or not.
> > 
> > Actually, there is no need to cast it to str or unicode, the value is
> > already a string. So it looks like ogr algorithms have to be modified
> > to adapat to this.
> > 
> > A simpler solution is that now, when a null value is passed (None,
> > empty string, anything that evaluates to false...), it sets the value
> > of the parameter as None. It could set it to an empty string, so no
> > need to do any change. Not such a clean solution, but it will work.
> > 
> > Any thoughts on that?
> 
> It sounds like having getParamaterValue() always return a string
> (possibly empty) would reduce regression probabilities.
> 
> Or do you think it's important to distinguish between empty string
> and None ?

Note that I see more than Ogr algortihms using the unicode(getParam())
construct:

  git grep  'unicode(self.getParameterValue' python/plugins/

As long as unicode(None) returns u'None', all those calls are bound
to fail if getParametervalue can possibly return None.

I agree it would be cleaner to drop the unicode() wrapper while making
sure len(val) is avoided. Not sure about the testcase coverage that
would help with such a big change.

--strk;
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Master_2: error: ‘isinf’ was not declared in this scope

2016-10-18 Thread Matthias Kuhn
Already done yesterday [1]. Nothing to port (yet) ;)

Cheers

[1]
https://github.com/qgis/QGIS/commit/9a962524cae2010d1e22e3e28d081bc057c1134d

On 10/18/2016 09:53 AM, René-Luc Dhont wrote:
> Thanks Matthias,
> 
> it works!
> 
> can I push this bugfix and backport it ? Or do I have to create a PR ?
> 
> Regards,
> René-Luc
> 
> Le 17/10/2016 à 18:41, Matthias Kuhn a écrit :
>> Hmmm...
>>
>> What about replacing isinf with qIsInf? (and if required #include
>> "qgis.h")?
>>
>> On 10/17/2016 06:32 PM, René-Luc Dhont wrote:
>>> Hi Matthias,
>>>
>>> It does not help me if I add #include  in
>>> src/gui/qgsscalerangewidget.cpp
>>>
>>> Regards,
>>> René-Luc
>>>
>>> Le 17/10/2016 à 18:26, Matthias Kuhn a écrit :
 He René-Luc

 does it help if you #include  in
 src/gui/qgsscalerangewidget.cpp?

 Matthias

 On 10/17/2016 06:08 PM, René-Luc Dhont wrote:
> Hi devs,
>
> I have this error during the qgis master_2 building:
> ```
> ../src/gui/qgsscalerangewidget.cpp:93:21: error: ‘isinf’ was not
> declared in this scope
>  if ( isinf( scale ) )
>^
> ../src/gui/qgsscalerangewidget.cpp:93:21: note: suggested alternative:
> In file included from /usr/include/c++/5/random:38:0,
>from /usr/include/c++/5/bits/stl_algo.h:66,
>from /usr/include/c++/5/algorithm:62,
>from /usr/include/qt4/QtCore/qglobal.h:68,
>from /usr/include/qt4/QtCore/qnamespace.h:45,
>from /usr/include/qt4/QtCore/qobjectdefs.h:45,
>from /usr/include/qt4/QtCore/qobject.h:47,
>from /usr/include/qt4/QtGui/qlayout.h:45,
>from /usr/include/qt4/QtGui/qgridlayout.h:45,
>from /usr/include/qt4/QtGui/QGridLayout:1,
>from ../src/gui/qgsscalerangewidget.h:19,
>from ../src/gui/qgsscalerangewidget.cpp:16:
> /usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
>isinf(_Tp __x)
>^
> ../src/gui/qgsscalerangewidget.cpp: In member function ‘void
> QgsScaleRangeWidget::setMaximumScale(double)’:
> ../src/gui/qgsscalerangewidget.cpp:105:21: error: ‘isinf’ was not
> declared in this scope
>  if ( isinf( scale ) )
>^
> ../src/gui/qgsscalerangewidget.cpp:105:21: note: suggested
> alternative:
> In file included from /usr/include/c++/5/random:38:0,
>from /usr/include/c++/5/bits/stl_algo.h:66,
>from /usr/include/c++/5/algorithm:62,
>from /usr/include/qt4/QtCore/qglobal.h:68,
>from /usr/include/qt4/QtCore/qnamespace.h:45,
>from /usr/include/qt4/QtCore/qobjectdefs.h:45,
>from /usr/include/qt4/QtCore/qobject.h:47,
>from /usr/include/qt4/QtGui/qlayout.h:45,
>from /usr/include/qt4/QtGui/qgridlayout.h:45,
>from /usr/include/qt4/QtGui/QGridLayout:1,
>from ../src/gui/qgsscalerangewidget.h:19,
>from ../src/gui/qgsscalerangewidget.cpp:16:
> /usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
>isinf(_Tp __x)
>^
> ```
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
 ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
 Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>> ___
>>> Qgis-developer mailing list
>>> Qgis-developer@lists.osgeo.org
>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> ___
>> Qgis-developer mailing list
>> Qgis-developer@lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Mark Johnson
>
> > Running the automated test is done via:
> >
> >   ctest -V -R ProcessingToolsTest


I have never used this before, from where should it be called?

Mark
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Mark Johnson
Sorry, but I often have problems with python ...

Are you supposed to configure something beforehand?
This is what I get:

UpdateCTestConfiguration  from
:.../QGIS/build_release-2_16/DartConfiguration.tcl
Parse Config
file:/home/mj10777/000_links/gis_software/qgis_git/mj10777/QGIS/build_release-2_16/DartConfiguration.tcl
 Add coverage exclude regular expressions.
 Add coverage exclude: /CMakeFiles/CMakeTmp/
 Add coverage exclude: .*/Testing/Utilities/.*
 Add coverage exclude: .*/Utilities/.*
 Add coverage exclude: .*/Code/Wrappers/SWIG/otbApplicationPYTHON_wrap.*
 Add coverage exclude: .*/Code/Wrappers/SWIG/otbApplicationJAVA_wrap.*
UpdateCTestConfiguration  from
:/home/mj10777/000_links/qgis_git/QGIS/build_release-2_16/DartConfiguration.tcl
Parse Config
file:/home/mj10777/000_links/qgis_git/QGIS/build_release-2_16/DartConfiguration.tcl
Test project
/home/mj10777/000_links/gis_software/qgis_git/mj10777/QGIS/build_release-2_16
Constructing a list of tests
Done constructing a list of tests
Checking test dependency graph...
Checking test dependency graph end
No tests were found!!!

Calling the test directly

python ToolsTest.py
Traceback (most recent call last):
  File "ToolsTest.py", line 29, in 
from processing.tests.TestData import points2
ImportError: No module named processing.tests.TestData

The directory data exists and contains points2.shp
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Sandro Santilli
On Tue, Oct 18, 2016 at 12:37:39PM +0200, Victor Olaya wrote:
> I made a fix to the check that verifies if a string parameter is left
> blank or not. Before, it just checked that it was None, so empty
> strings where considered valid values. However, an empty string should
> be considered a null one (mainly, to raise an exception if that is
> used for a parameter that is not optional). Before that, an empty
> string was accepted even if the parameter was mandatory.
> 
> looks like ogr algorithms use unicode(getParameterValue()), and they
> should instead get the param value and check whether is None or not.
> 
> Actually, there is no need to cast it to str or unicode, the value is
> already a string. So it looks like ogr algorithms have to be modified
> to adapat to this.
> 
> A simpler solution is that now, when a null value is passed (None,
> empty string, anything that evaluates to false...), it sets the value
> of the parameter as None. It could set it to an empty string, so no
> need to do any change. Not such a clean solution, but it will work.
> 
> Any thoughts on that?

It sounds like having getParamaterValue() always return a string
(possibly empty) would reduce regression probabilities.

Or do you think it's important to distinguish between empty string
and None ?

--strk;
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] PG credentials

2016-10-18 Thread Paolo Cavallini
Hi all,
if I open a project without saved credentials for PostgreSQL access,
they seem to be taken from the system (the last used credentials). Is
this confirmed, and the expected behaviour?
All the best, and thanks.
-- 
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all=IT=qgis,arcgis
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Even Rouault
Le mardi 18 octobre 2016 11:59:04, Sandro Santilli a écrit :
> On Tue, Oct 18, 2016 at 11:55:21AM +0200, Mark Johnson wrote:
> > > The problem, as Germán found out, is that the URI passed as parameter
> > > is not necessarely an OGR provider URI, but a generic QGIS uri, from
> > > any provider, so it cannot always be opened via ogr.Open.
> > 
> > Yes, ogr-sysntax must be used.
> > 
> > # -- Spatialite provider
> > 
> > # dbname='/tmp/x.sqlite' table="t" (geometry) sql='
> > 
> > would need to call 'GetLayerByName'
> 
> But the above is NOT an ogrDataSource
> Please see with current master_2 branch if the test work for you
> with both GDAL 1 and GDAL 2:
> 
> Running the automated test is done via:
> 
>   ctest -V -R ProcessingToolsTest
> 
> Manual tests imply importing layers to postgis (via processing).
> 
> They pass here with GDAL 2

Sandro,

Mark's point is for the particular case of layers with multiple geometry fields 
(as may be found in some spatialite DB for example). That's a different issue 
than the one you tackle.

Even

> 
> 
> --strk;
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Mark Johnson
>
> Didn't you use "ctest" ?

Yes, the first list of errors was from that


> PYTHONPATH to include ${BUILDDIR}/output/python/plugins.

Have done that and now am building the latest branch


> using latest tree
> in release-2_16 branch

Before you wrote branch 'master_2'
- that is what I checked out after committing my 'master' (where the need
changes for gdal 2.* have been made - was a September version of release-2_16
branch) and am now building.

2 weeks ago I found:
test_provider_ogr_sqlite.py

where I was planning to add some tests.

Since the original version is now compiling against gdal 2.*, I will
attempt to write a test that when running against gdal 1.* should cause a
'symbol lookup error'.

Also to test the ogr autotest database 'spatialite_8_2' which contains more
than 1 geometry in the main table
- which for the present code should fail.

The 3rd test was to test if the kml file sent for bugreport 15168
(non-unique layer-name) can be read correctly.

Mark
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] PG credentials

2016-10-18 Thread Neumann, Andreas
Hi Paolo, 

hm - not sure. 

If you have a .pgpass file it may take credentials from the .pgpass
file. 

Not sure what you mean "from the system" - you mean the credentials from
the operating system? Yes - this is another fallback mechanism - but it
depends how you configured your PostgreSQL access controls. 

Greetings, 

Andreas 

On 2016-10-18 13:25, Paolo Cavallini wrote:

> Hi all,
> if I open a project without saved credentials for PostgreSQL access,
> they seem to be taken from the system (the last used credentials). Is
> this confirmed, and the expected behaviour?
> All the best, and thanks.

  ___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Sandro Santilli
On Tue, Oct 18, 2016 at 12:48:18PM +0200, Victor Olaya wrote:
> >
> > It sounds like having getParamaterValue() always return a string
> > (possibly empty) would reduce regression probabilities.
> >
> > Or do you think it's important to distinguish between empty string
> > and None ?
> 
> sounds safe to me. And it would be nicer to make that distinction, but
> i think it is not so important. I cannot think of any major issue with
> that

Well, I tried and SURPRISE ! The parameter is actually *set*
to the "None" string. So I guess the bug is also on the *set* side,
not (just) *get* one.

Also, a quick review of the set side (setValue functions) reveal that
the value of parameters don't necessarely need to be strings ?

--strk; 
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Sandro Santilli
On Tue, Oct 18, 2016 at 03:38:27PM +0200, Sandro Santilli wrote:
> On Tue, Oct 18, 2016 at 12:48:18PM +0200, Victor Olaya wrote:
> > >
> > > It sounds like having getParamaterValue() always return a string
> > > (possibly empty) would reduce regression probabilities.
> > >
> > > Or do you think it's important to distinguish between empty string
> > > and None ?
> > 
> > sounds safe to me. And it would be nicer to make that distinction, but
> > i think it is not so important. I cannot think of any major issue with
> > that
> 
> Well, I tried and SURPRISE ! The parameter is actually *set*
> to the "None" string. So I guess the bug is also on the *set* side,
> not (just) *get* one.
> 
> Also, a quick review of the set side (setValue functions) reveal that
> the value of parameters don't necessarely need to be strings ?

It looks like reverting 61a10df45283a47782bf49ac62f9c5e5f9b27b21
removes all those "None" literals.

See
https://github.com/qgis/qgis/commit/61a10df45283a47782bf49ac62f9c5e5f9b27b21


--strk;
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Building QGIS master on Windows

2016-10-18 Thread Frits van Veen
I'm having trouble running a self built QGIS 2.99 from Visual Studio 2015. In
QgsPythonUtilsImpl::initPython I get an exception when running the line:
runString( "qgis.utils.initInterface(" + QString::number(( unsigned long )
interface ) + ')' );
Debug output:
D:\QGIS\Fork\Source\src\app\qgisapp.cpp(8731) : (QgisApp::loadPythonSupport)
[1ms] load library qgispython (2.99.0)
'qgis.exe' (Win32): Loaded
'D:\QGIS\Fork\Build\output\bin\RelWithDebInfo\qgispython.dll'. Symbols
loaded.
'qgis.exe' (Win32): Loaded 'C:\Python35\python35.dll'. Symbols loaded.
'qgis.exe' (Win32): Loaded 'C:\Python35\python3.dll'. Cannot find or open
the PDB file.
'qgis.exe' (Win32): Loaded 'C:\Python35\Lib\site-packages\sip.pyd'. Module
was built without symbols.
'qgis.exe' (Win32): Loaded 'C:\Python35\Lib\site-packages\PyQt5\QtCore.pyd'.
Module was built without symbols.
'qgis.exe' (Win32): Loaded 'C:\Python35\Lib\site-packages\PyQt5\QtGui.pyd'.
Module was built without symbols.
'qgis.exe' (Win32): Loaded
'D:\QGIS\Fork\Build\output\python\qgis\_core.pyd'. Symbols loaded.
'qgis.exe' (Win32): Loaded
'C:\Python35\Lib\site-packages\PyQt5\QtWidgets.pyd'. Module was built
without symbols.
'qgis.exe' (Win32): Loaded
'C:\Python35\Lib\site-packages\PyQt5\QtPrintSupport.pyd'. Module was built
without symbols.
'qgis.exe' (Win32): Loaded 'C:\Python35\Lib\site-packages\PyQt5\QtSql.pyd'.
Module was built without symbols.
'qgis.exe' (Win32): Loaded
'C:\Python35\Lib\site-packages\PyQt5\QtNetwork.pyd'. Module was built
without symbols.
'qgis.exe' (Win32): Loaded 'C:\Python35\Lib\site-packages\PyQt5\QtXml.pyd'.
Module was built without symbols.
'qgis.exe' (Win32): Loaded 'D:\QGIS\Fork\Build\output\python\qgis\_gui.pyd'.
Symbols loaded.
'qgis.exe' (Win32): Loaded 'C:\Python35\Lib\site-packages\PyQt5\Qsci.pyd'.
Module was built without symbols.
Exception thrown at 0x77C71214 (Qt5Core.dll) in qgis.exe:
0xC005: Access violation reading location 0x17B0BF30.
Unhandled exception at 0x77C71214 (Qt5Core.dll) in qgis.exe:
0xC005: Access violation reading location 0x17B0BF30.
Call stack:
Qt5Core.dll!77c71214()  Unknown
_gui.pyd!sipSubClass_QgsComposerView(void * * sipCppRet) Line 14
C++
sip.pyd!7ffeaba28458()  Unknown
sip.pyd!7ffeaba2160d()  Unknown
sip.pyd!7ffeaba21ffa()  Unknown
python35.dll!PyCFunction_Call(_object * func, _object * args, _object *
kwds) Line 145  C
python35.dll!call_function(_object * * * pp_stack, int oparg) Line 4705 
C
python35.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3239
C
python35.dll!fast_function(_object * func, _object * * * pp_stack, int 
n,
int na, int nk) Line 4804   C
python35.dll!call_function(_object * * * pp_stack, int oparg) Line 4730 
C
python35.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3239
C
python35.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals,
_object * locals, _object * * args, int argcount, _object * * kws, int
kwcount, _object * * defs, int defcount, _object * kwdefs, _object *
closure, _object * name, _object * qualname) Line 4018  C
python35.dll!run_mod(_mod * mod, _object * filename, _object * globals,
_object * locals, PyCompilerFlags * flags, _arena * arena) Line 977 C
python35.dll!PyRun_StringFlags(const char * str, int start, _object *
globals, _object * locals, PyCompilerFlags * flags) Line 900C
qgispython.dll!QgsPythonUtilsImpl::runStringUnsafe(const QString &
command, bool single) Line 299  C++
qgispython.dll!QgsPythonUtilsImpl::runString(const QString & command,
QString msgOnError, bool single) Line 311   C++
>   qgispython.dll!QgsPythonUtilsImpl::initPython(QgisInterface * interface)
Line 221C++
qgis_app.dll!QgisApp::loadPythonSupport() Line 8763 C++
qgis_app.dll!QgisApp::QgisApp(QSplashScreen * splash, bool 
restorePlugins,
bool skipVersionCheck, QWidget * parent, QFlags fl)
Line 914C++
qgis.exe!main(int argc, char * * argv) Line 1074C++
[External Code] 
Has anyone an idea how to proceed?

Frits




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Building-QGIS-master-on-Windows-tp5291245.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] ogrLayerName in processing/tools/vector.py

2016-10-18 Thread Sandro Santilli
On Tue, Oct 18, 2016 at 01:36:14PM +0200, Mark Johnson wrote:
> Sorry, but I often have problems with python ...
> 
> Are you supposed to configure something beforehand?
> This is what I get:
> 
> python ToolsTest.py

Didn't you use "ctest" ?

> Traceback (most recent call last):
>   File "ToolsTest.py", line 29, in 
> from processing.tests.TestData import points2
> ImportError: No module named processing.tests.TestData

I think ctest would do that automatically but  you have to tweak
PYTHONPATH to include ${BUILDDIR}/output/python/plugins.
Make sure to build the code, and that you're using latest tree
in release-2_16 branch.

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   https://strk.kbt.io/services.html
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Victor Olaya
I just made this fix, which should solve those issues

https://github.com/qgis/QGIS/commit/d7bd5dc50705eec3f37ef82fc819b5bc47cce0f0

Let me know if we need to do something else.

2016-10-18 17:40 GMT+02:00 Sandro Santilli :
> German, I think the best way would be to:
>
>  1) File a ticket, targetted at 2.18 and marked as Sever/Regression
>  2) Make a PR containing an automated testcase showing the problem
>  3) Add a revert of the offending commit in the PR, showing how
> it fixes the testcase.
>
> Do you agree, Victor ?
>
> --strk;
>
> On Tue, Oct 18, 2016 at 10:24:15AM -0500, Germán Carrillo wrote:
>> 2016-10-18 8:42 GMT-05:00 Sandro Santilli :
>>
>> > https://github.com/qgis/qgis/commit/61a10df45283a47782bf49ac62f9c5
>> > e5f9b27b21
>>
>>
>> Hi All,
>>
>> what would be the way to deal with this?
>> It's currently preventing me from pushing my final commit to this PR [1],
>> which I hope can make it into QGIS v.2.18.
>>
>> Regards,
>>
>> Germán
>> --
>> [1] https://github.com/qgis/QGIS/pull/3591
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Sandro Santilli
On Tue, Oct 18, 2016 at 05:44:43PM +0200, Victor Olaya wrote:
> I just made this fix, which should solve those issues
> 
> https://github.com/qgis/QGIS/commit/d7bd5dc50705eec3f37ef82fc819b5bc47cce0f0
> 
> Let me know if we need to do something else.

I still think a testcase would be very useful.
Besides, there seem to be tests checking for "None" (string)
being returned by setting None (type) in 

 python/plugins/processing/tests/ParametersTest.py

Should they be updated ?

--strk;

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Plugin [284] Semi-Automatic Classification Plugin approval notification.

2016-10-18 Thread noreply

Plugin Semi-Automatic Classification Plugin approval by pcav.
The plugin version "[284] Semi-Automatic Classification Plugin 5.1.3" is now 
approved
Link: http://plugins.qgis.org/plugins/SemiAutomaticClassificationPlugin/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] PG credentials

2016-10-18 Thread Paolo Cavallini
Il 18/10/2016 18:23, Matthias Kuhn ha scritto:

> Something else that is able to cache passwords persistently is the auth
> system
> 
> https://docs.qgis.org/2.14/en/docs/user_manual/auth_system/auth_overview.html

Yes, but this has to be done explicitly, the base mechanism is
transparent (and may be surprising) to the user.
All the best.

-- 
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all=IT=qgis,arcgis
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Plugin [1104] wfsOutputExtension approval notification.

2016-10-18 Thread noreply

Plugin wfsOutputExtension approval by pcav.
The plugin version "[1104] wfsOutputExtension 1.0.1 Experimental" is now 
approved
Link: http://plugins.qgis.org/plugins/wfsOutputExtension/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] PG credentials

2016-10-18 Thread Matthias Kuhn
Hi Paolo

On 10/18/2016 06:19 PM, Paolo Cavallini wrote:
> Il 18/10/2016 17:58, Jürgen E. Fischer ha scritto:
>> H Paolo,
>>
>> On Tue, 18. Oct 2016 at 16:44:31 +0200, Paolo Cavallini wrote:
>>> thanks for the feedback. The situation is:
>>> * a qgs project pointing to PostgreSQL, without username and password
>>> * if one inserts the credentials at project startup, these seem to be
>>> remembered upon further opening of the project (unsure about other
>>> projects), even after restarting QGIS.
>>> It seems therefore impossible that QGIS takes it from .pgpass.
>>
>> Entered passwords are cached for the session - but not stored in the layers.
> 
> Thanks Jürgen for the clarification. You mean the OS session, not the
> QGIS one, right? Is this documented in the manual?
> All the best.
> 

Something else that is able to cache passwords persistently is the auth
system

https://docs.qgis.org/2.14/en/docs/user_manual/auth_system/auth_overview.html

Matthias
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Sandro Santilli
German, I think the best way would be to:

 1) File a ticket, targetted at 2.18 and marked as Sever/Regression
 2) Make a PR containing an automated testcase showing the problem
 3) Add a revert of the offending commit in the PR, showing how
it fixes the testcase.

Do you agree, Victor ?

--strk;

On Tue, Oct 18, 2016 at 10:24:15AM -0500, Germán Carrillo wrote:
> 2016-10-18 8:42 GMT-05:00 Sandro Santilli :
> 
> > https://github.com/qgis/qgis/commit/61a10df45283a47782bf49ac62f9c5
> > e5f9b27b21
> 
> 
> Hi All,
> 
> what would be the way to deal with this?
> It's currently preventing me from pushing my final commit to this PR [1],
> which I hope can make it into QGIS v.2.18.
> 
> Regards,
> 
> Germán
> --
> [1] https://github.com/qgis/QGIS/pull/3591
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] PG credentials

2016-10-18 Thread Jürgen E . Fischer
H Paolo,

On Tue, 18. Oct 2016 at 16:44:31 +0200, Paolo Cavallini wrote:
> thanks for the feedback. The situation is:
> * a qgs project pointing to PostgreSQL, without username and password
> * if one inserts the credentials at project startup, these seem to be
> remembered upon further opening of the project (unsure about other
> projects), even after restarting QGIS.
> It seems therefore impossible that QGIS takes it from .pgpass.

Entered passwords are cached for the session - but not stored in the layers.


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 Norden http://www.norbit.de
QGIS release manager (PSC)  GermanyIRC: jef on FreeNode 



pgp0zU1cCDxsN.pgp
Description: PGP signature
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] PG credentials

2016-10-18 Thread Paolo Cavallini
Il 18/10/2016 17:58, Jürgen E. Fischer ha scritto:
> H Paolo,
> 
> On Tue, 18. Oct 2016 at 16:44:31 +0200, Paolo Cavallini wrote:
>> thanks for the feedback. The situation is:
>> * a qgs project pointing to PostgreSQL, without username and password
>> * if one inserts the credentials at project startup, these seem to be
>> remembered upon further opening of the project (unsure about other
>> projects), even after restarting QGIS.
>> It seems therefore impossible that QGIS takes it from .pgpass.
> 
> Entered passwords are cached for the session - but not stored in the layers.

Thanks Jürgen for the clarification. You mean the OS session, not the
QGIS one, right? Is this documented in the manual?
All the best.
-- 
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all=IT=qgis,arcgis
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Victor Olaya
Yes, they should. I will take care of that

2016-10-18 17:48 GMT+02:00 Sandro Santilli :
> On Tue, Oct 18, 2016 at 05:44:43PM +0200, Victor Olaya wrote:
>> I just made this fix, which should solve those issues
>>
>> https://github.com/qgis/QGIS/commit/d7bd5dc50705eec3f37ef82fc819b5bc47cce0f0
>>
>> Let me know if we need to do something else.
>
> I still think a testcase would be very useful.
> Besides, there seem to be tests checking for "None" (string)
> being returned by setting None (type) in
>
>  python/plugins/processing/tests/ParametersTest.py
>
> Should they be updated ?
>
> --strk;
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Plugin [976] QAD approval notification.

2016-10-18 Thread noreply

Plugin QAD approval by pcav.
The plugin version "[976] QAD 2.8.13" is now approved
Link: http://plugins.qgis.org/plugins/qad/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] PG credentials

2016-10-18 Thread Paolo Cavallini
Il 18/10/2016 13:54, Neumann, Andreas ha scritto:
> Hi Paolo,
> 
> hm - not sure.
> 
> If you have a .pgpass file it may take credentials from the .pgpass file.
> 
> Not sure what you mean "from the system" - you mean the credentials from
> the operating system? Yes - this is another fallback mechanism - but it
> depends how you configured your PostgreSQL access controls.

Hi Andreas,
thanks for the feedback. The situation is:
* a qgs project pointing to PostgreSQL, without username and password
* if one inserts the credentials at project startup, these seem to be
remembered upon further opening of the project (unsure about other
projects), even after restarting QGIS.
It seems therefore impossible that QGIS takes it from .pgpass.
All the best.
-- 
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all=IT=qgis,arcgis
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [processing] OGR imports full of "None" strings, lately

2016-10-18 Thread Germán Carrillo
2016-10-18 8:42 GMT-05:00 Sandro Santilli :

> https://github.com/qgis/qgis/commit/61a10df45283a47782bf49ac62f9c5
> e5f9b27b21


Hi All,

what would be the way to deal with this?
It's currently preventing me from pushing my final commit to this PR [1],
which I hope can make it into QGIS v.2.18.

Regards,

Germán
--
[1] https://github.com/qgis/QGIS/pull/3591




-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
http://about.me/germancarrillo


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Newbie question re: Qt, PyQt on MAC Yosemite, Sierra

2016-10-18 Thread William Kyngesburye
Ah, the Designer part is now a problem.

You could try using Pacifist to manually extract the needed parts from the Qt 
installer, 4.8 still uses Apple's installer packaging (Qt5 started using their 
own packaging mechanism, bleh), and either skip the /usr/* stuff or put it 
somewhere else.  I don't know if Designer uses them, all I see is direct links 
to the Qt frameworks, but it might also need the executables, which would be a 
problem.

Another thing that might be a problem, regardless on how/if you install Qt, is 
if Designer loads or needs any Qt plugins - QGIS (Mac) currently ignores its 
qt.conf and tries to load the /Developer plugins and crashes, so you'd have to 
do work in Designer, quit, rename the plugins folder so QGIS doesn't see it, 
run QGIS to test your plugin, quit, rename plugins back, ...

> On Oct 18, 2016, at 12:53 PM, Chris Nicholas  
> wrote:
> 
> yeah;  lots of interesting sandboxing got introduced in El Cap; etc. Have yet 
> to upgrade to Sierra, but I hear it’s reasonably painless… at least from a 
> user’s perspective.
> 
> I want to do a plugin, and I need to do GUI design and layout and assign 
> event signals and slots, etc, and couldn’t find Qt designer… that’s when I 
> tried to install that .dmg and got the message I sent...
> 
> but… now that I look more closely, I see you have indeed built the tools 
> needed for at least compiling a design (pyrcc4   and pyuic4), that I 
> didn’t have on my PATH, in:
> /Applications/QGIS.app/Contents/MacOS/bin  (and of course, a WHOLE lot of 
> other very interesting items there…)
> 
> :-)
> 
> again, thanks for all your work.
> 
> Chris
> 
> 
>> On Oct 18, 2016, at 10:38 AM, William Kyngesburye  
>> wrote:
>> 
>> Interesting.  I suspect it has something to do with installing a few items 
>> in /usr/* (instead of /usr/local/*).  With SIP in El Capitan it may fail to 
>> install those bits (or they will install but will be blocked from running), 
>> which include all the executables that are needed during compilation of 
>> QGIS.  Worst case is that installing those bits will block your system from 
>> booting (not fatal or "damaging", but you'd have to boot in safe mode to 
>> delete them).
>> 
>> If you really want to compile your own, you could try Homebrew.
>> 
>> Is there something missing from my QGIS package that your plugin needs?  
>> (No, I haven't "done" Qt, I just bundle their Qt binaries in QGIS)
>> 
>>> On Oct 18, 2016, at 11:59 AM, Chris Nicholas  
>>> wrote:
>>> 
>>> first and foremost. THANK YOU for all those years of building QGIS and 
>>> supporting libs on MAC… 
>>> :-]
>>> 
>>> hit this, and just went with my VirtualBox/Ubuntu 16 and things are working 
>>> great there…
>>> didn’t realize you had done the whole Qt Designer, etc frameworks.. bravo!
>>> 
>>> attached is the msg I got trying to install the 4.8 dmg from 
>>> http://download.qt.io/archive/ , and just said “blah…"
>>> 
>>> Chris
>>> 
>>> 
>>> 
 On Oct 17, 2016, at 6:30 PM, William Kyngesburye  
 wrote:
 
 Are you using my package or trying to compile from source?
 
 My package has everything needed in the app - Qt4 & PyQt4.
 
 QGIS 2 is not completely ready for Qt5, so yes you need to use Qt4.  Does 
 the Qt4 installer refuse to install on your system, or just give a 
 warning?  I've never heard of it refusing to install.  It should still 
 work as long as you use a system SDK.  I compile QGIS on Yosemite, but 
 using an old Mt Lion SDK.
 
> On Oct 17, 2016, at 4:43 PM, Chris Nicholas  
> wrote:
> 
> loaded up QGIS 2.14 ‘Essen’ got all psyched to dive in and do a plugin, 
> and seem to be hitting a brick wall…
> 
> From what I understand, you must use PyQt4, unless you compile EVERYTHING 
> from source with Qt5 …  
> 
> soo… thought I would just use an older Qt version… WRONG !  the installer 
> says it is incompatible with this version of OS X ..
> 
> so… thought I would compile the Qt4 sources from scratch … WRONG!  as 
> per: 
> https://bugreports.qt.io/browse/QTBUG-48079
> 
> so…. um …. am I outta luck?
> 
> advice/condolences/RTFMs welcomed
> 
> thanks in advance!
> Chris
> 
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
 
 -
 William Kyngesburye 
 http://www.kyngchaos.com/
 
 All generalizations are dangerous, even this one.
 
 
>>> 
>> 
>> -
>> William Kyngesburye 
>> http://www.kyngchaos.com/
>> 
>> "The beast is actively interested only in now, and, 

Re: [Qgis-developer] Building and debugging QGIS on Windows x64

2016-10-18 Thread fritsvanveen
Hi Casper

I have recently build QGIS on my Windows10 system with Visual Studio 2010
with partial success. I could run and debug QGIS, but Python support did not
work (yet).
This is my shortlist of fixes to get my build working:

add libs to qgis_core:
setupapi.lib
C:\OSGeo4W64\lib\lwgeom.lib
C:\OSGeo4W64\lib\libxml2.lib
C:\OSGeo4W64\lib\freexl_i.lib
C:\OSGeo4W64\lib\iconv.lib
C:\OSGeo4W64\lib\zlib.lib
legacy_stdio_definitions.lib

add libs to virtuallayerprovider:
C:\OSGeo4W64\lib\lwgeom.lib
C:\OSGeo4W64\lib\libxml2.lib
C:\OSGeo4W64\lib\freexl_i.lib
C:\OSGeo4W64\lib\iconv.lib
C:\OSGeo4W64\lib\zlib.lib

qgis_core
Ignore specific default libraries: LIBCMT.lib

remainder not found: define in gmath.c
double remainder(double X, double Y) { return fmod(X, Y); }

compile with /bigobj:
python_module_qgis__gui.vcxproj
python_module_qgis__core.vcxproj

spatialite.lib does not include the 5 libs from OSGeo4W64, so I added them.
The DLL which gets included  with spatialite_i.lib has those libs onboard,
so Jürgen's advice is probably better.
The other changes will manifest themselves as the compiler and linker start
to complain!
Each time, you update the source from the remote master, the changes have to
be performed again!
BTW, are you building master_2? The master depends now on Qt5 and Python3
and the build instructions are not targeted for that. I am now in the
process of building the master with Visual Studio 2015, where I have to
build some libraries myself from source.

Let me know if I can help.

Frits



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Building-and-debugging-QGIS-on-Windows-x64-tp5291058p5291188.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer