Re: [QGIS-Developer] How to retrieve all "virtual fields" of a layer?

2017-05-31 Thread Etienne Trimaille
Hi,

Both layer.fields() or layer.pendingFields() work for me. I got my virtual
field.

2017-06-01 3:34 GMT+08:00 Stefan Keller :

> Hi,
>
> In a Python plugin I want to retrieve information about all
> attributes/fields of a layer
> In the cookbook [1] it's described how to retrieve thems
>   for field in layer.pendingFields():
>   print field.name(), field.typeName()
>
> => But how do I get all "virtual fields" programmatically?
>
> :Stefan
>
> [1] http://docs.qgis.org/testing/en/docs/pyqgis_developer_
> cookbook/vector.html#retrieving-information-about-attributes
> ___
> 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] SIP coverage test removal and Travis optimization

2017-05-31 Thread Nyall Dawson
On 31 May 2017 at 22:15, Denis Rouzaud  wrote:
> Dear all,
>
> Our automatic SIP files generation is almost there and I would like to
> remove the SIP coverage test from running on Travis.

> Is this acceptable?

In general, but...

> Is there any reason to keep the test (running on Travis)?

There's 2 extra things the sip coverage test does which the sipify test doesn't:

1. Flags if a class is totally missing from the bindings. The sipify
test can't detect when someone's added a new header to the project
without adding a corresponding .sip include to the
core/gui/server/analysis.sip files. Ideally this would be fixed with
some cmake magic which avoids the need to even manually build the
core.sip/gui.sip/etc files...

2. Checks that the methods *are* actually accessible in the Python
bindings. Occasionally there'll be weird things where even though a
method is correctly listed in the .sip files, it just doesn't exist in
the Python library. There's no pattern here - it happens differently
on different platforms. But this is a sip bug, so I don't really care
if we lose this extra check.

For me 1 would need to be addressed before we can drop the test.

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] [Qgis-user] Wrong result with Saga Raster calculator

2017-05-31 Thread Pedro Venâncio
Hi Eugenio,

I've created a sample processing model (attached), that works ok, except a
small error in the result (decimals).

For instance:

*Raster* *ID* *Pixel value*
Z_top_res a 1202,03510276
t_top_res b 53,6123428345
topo c1 -182,584899902
SAGA Result 1 c 15,1783676147
SAGA Result 2 d 31,9437332153 *Diff*
Expected Result 1
15,1783679504 0,00335741
Expected Result 2
31,974087 0,0303540069
*Formula*
1 ifelse(c1>0,-(0.0065*c1-16),(0.0045*c1+16))
2 ifelse(a<500,0,((b-c)/a)*1000)
Using SAGA GUI there is no error.

Could this be because of some roundings in the input / output? (I'm sending
for the developer's list also).

Thanks!

Best regards,
Pedro Venâncio



2017-05-31 10:56 GMT+01:00 Eugenio Trumpy :

>
> Hi Pedro,
>
> thank you very much to have tested the computation with my test data!
> You are right, I checked again the computation and actually it works.
>
> However, I was using Saga raster calculation in a processing modeler, and
> one of the layer I share with you
> is the resulting from a previous computation.
>
> In other word the raster layer c=temp_recal.tif comes from a previous
> computation (raster calculator):
> ifelse(a>0,-(0.0065*a-16),(0.0045*a+16))
> where a is the layer attached, and hence c of the previous  formula is the
> resulting of this first computation.
>
> E.
>
> --
> *Da:* Pedro Venâncio 
> *Inviato:* mercoledì 31 maggio 2017 11:37
> *A:* frippe12573; qgis-user
> *Oggetto:* Re: [Qgis-user] Wrong result with Saga Raster calculator
>
> Hi Eugenio,
>
> The result with SAGA Raster Calculator seems ok here, on QGIS 2.18.9, SAGA
> 2.3.2, both from OSGeo4W64 (result attached).
>
> Z_top_res.tif have values from 724.403 to 1423.553, and so, the first
> condition is never true. Then, it always make ((b-c)/a)*1000, and the
> result seems ok to me.
>
>
> Pedro
>
>
>
> 2017-05-31 10:19 GMT+01:00 frippe12573 :
>
>> Hi Paolo,
>>
>> the raster have the same size and origin.
>> The pixels are precisely overlapped.
>>
>> I tried also r.mapcalc, but I got a worst result.
>> Here the output of the log:
>> https://pastebin.com/jNyyzHgf
>>
>> E.
>>
>>
>>
>> --
>> View this message in context: http://osgeo-org.1560.x6.nabbl
>> e.com/Wrong-result-with-Saga-Raster-calculator-tp5322429p5322442.html
>> Sent from the QGIS - User mailing list archive at Nabble.com.
>> ___
>> Qgis-user mailing list
>> qgis-u...@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
>


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

[QGIS-Developer] How to retrieve all "virtual fields" of a layer?

2017-05-31 Thread Stefan Keller
Hi,

In a Python plugin I want to retrieve information about all
attributes/fields of a layer
In the cookbook [1] it's described how to retrieve thems
  for field in layer.pendingFields():
  print field.name(), field.typeName()

=> But how do I get all "virtual fields" programmatically?

:Stefan

[1] 
http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/vector.html#retrieving-information-about-attributes
___
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] Building QGIS 2.18 on OSX

2017-05-31 Thread William Kyngesburye
Well, I build the OS X package.  I recently upgraded to Sierra and it messed up 
my development setup.  I had problems with QGIS also, but didn't want to spend 
time figuring it out (I need to build for older systems, and I was way behind 
on QGIS updates) so I used my other Mac that I kept at Yosemite.

- installing Qt4 - I had already installed Qt4 so running the installer was not 
a problem.  But what I have is a standard OS X installer package for Qt4, that 
should not crash anyways.  BUT, it installs a couple important items in 
/usr/lib and /usr/bin, which are protected in Sierra by SIP and will fail.  
You'd have to hack those bits so they are available elsewhere in an unprotected 
location.  You can use Pacifist to extract installer files so you can put them 
in custom locations.

- compiling Qt4 - I never had much luck with this in the past, even in 
supported OS X versions, but it's long past supported OS X versions and you 
will at least get lots of warnings, if not errors.  Maybe homebrew and the like 
have patches to work around these, but sounds like you still had problems.


> On May 29, 2017, at 9:33 AM, Helton Costa  wrote:
> 
> Hi everybody,
> 
> This is my first post here and I hope there's not already a post related to 
> this, even thought I searched through the list a little.
> 
> I have been trying to build QGIS 2.18 for about 3 weeks following a few step 
> by steps I found but none of them gave me success. I'm on OSX 10.12.
> I first followed the official step by step from QGIS, and then, other ones 
> using homebrew, but wasn't able to finish the build for the intended version.
> I do believe I have a polluted OS and libraries, but I invested around 6 
> hours cleaning it and my environments to try it all again, and still, no 
> success.
> 
> Mainly, I believe my issue is regarding Qt4, which is already deprecated and 
> I'm not able to install it properly. I already tried the .dmg from official's 
> qt website (which crashes) and some cartr and osgeo formulaes from homebrew 
> and still no success.
> Somewhere along the configuration and build process I get errors regarding 
> Qt4 or some of their python bindings libraries and even thought I did manage 
> to fix some of them, the build was never able to finish.
> 
> Do you guys believe it is still possible to build non-master versions of QGIS 
> on OSX, and if so, what would be some kind of different approach in order to 
> be able to achieve it?
> 
> Kind regards, 
> 
> Helton Costa
> 
> ___
> 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 
> 
-
William Kyngesburye 
http://www.kyngchaos.com/

Earth: "Mostly harmless"

- revised entry in the HitchHiker's Guide to the Galaxy


___
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-psc] [Qgis-developer] Are there plans to create a unique "Add layer" tool?

2017-05-31 Thread Alessandro Pasotti
Hi,

final update: the development of what was in phase 1 is done.

Actually, a bit more than phase 1 considering that we've redesigned the
delimited text dialog GUI and I've done quite a bit of small refactorings
of the providers selection dialogs interfaces.

There has been a lot of feed-back, thank you all!

As expected, there is no complete agreement over the final GUI bits for the
menus and toolbars, and we still miss an icon (the green plus that I've
used was only meant as a placeholder). I tried to keep the old toolbar
available (disabled by default) mainly because it can spare a click and
power users might want it back. Also, the new icon is the most prominent in
the left bar and it's the first menu item in the layers menu.

I have not a strong opinion about those toolbars and menus but I think I
should wait no more and merge it as it is, then give the people some time
to test the actual implementation and decide how to improve it.

I kept the controversial part in a single commit so that it will be very
easy to revert and propose a different placement for menus, icons and
toolbars.


Any objections if I proceed?



On Wed, May 24, 2017 at 2:29 PM, Alessandro Pasotti 
wrote:

> Hi,
>
> a quick update:
>
> I've prepared a PR with a working prototype in
> https://github.com/qgis/QGIS/pull/4629, I need some feed-back and some
> help, expecially UX/UI about if we want it as a dockable dialog too (and
> how to make it user-configurable).
>
> Feed-back welcome (but please keep it limited in scope to phase 1).
>
> Cheers
>
>
>
> On Fri, May 19, 2017 at 9:45 AM, Richard Duivenvoorde  > wrote:
>
>> On 19-05-17 01:23, Nyall Dawson wrote:
>>
>> > On this note - I've recently discovered the need for some type of
>> > reusable layer selection widget which allows choice of existing
>> > layers/loading new layers from the file system/loading new layers from
>> > available db/online connections. This would be extremely valuable for
>> > processing too!
>> >
>> > So I'm really glad to hear that you'll be pushing ahead with this work
>> > - thanks Boundless!
>>
>> Yep, and thanks Alessandro for the screenie. Makes me want more!
>>
>> @Nyall in Essen the talk was to start with what Alessandro wrote in his
>> email, so 1 dialog 'merging' all buttons/widgets/dialogs into one, reuse
>> as much as possible. So it was possible to get it into 3.0
>>
>> Off course people (.../me) started brainstorming about features which
>> w/could be added too :-)
>>
>> Your idea adds (I think) to the idea to make some kind of
>> 'datamanagement-console' in near future, where you can create/copy
>> data(!), move data around (browser part) or delete it.
>> Your note fits in this isn't it?
>>
>> Regards,
>>
>> Richard
>>
>>
>> ___
>> QGIS-Developer mailing list
>> QGIS-Developer@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
>
>
> --
> Alessandro Pasotti
> w3:   www.itopen.it
>



-- 
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] SIP coverage test removal and Travis optimization

2017-05-31 Thread Denis Rouzaud
Dear all,

Our automatic SIP files generation is almost there and I would like to
remove the SIP coverage test from running on Travis.

I think it is harmless since any change on a header will have a direct
impact on the SIP file (or the SIP test will fail if one did not take care
of updating the SIP file).

The idea behind it is a bit of time saving on Travis:

* remove sip coverage test: ~15 sec
* move Doxygen build to the "code_layout" config (rather than on the main
"linux" Travis config) ~30-120 sec (not sure about the time here though)
* move doc coverage test to the "code_layout" config: ~20 sec

Without removing the sip coverage test, we cannot move Doxygen build away
from main build, since the test requires both the python API and the
Doxygen build.

Is this acceptable?
Is there any reason to keep the test (running on Travis)?

Cheers,
Denis
___
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 Plugin not in repository

2017-05-31 Thread Paolo Cavallini
Il 31/05/2017 12:56, Etienne Trimaille ha scritto:
> Bonjour Sophie (since the university in Montpellier ;-) )
> 
> You should use a .gitignore file in your git repository with "*.pyc". It
> will avoid having you to delete these files everytime.

Hi,
please note that a cleaner directory structure is preferable.
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: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] QGIS Plugin not in repository

2017-05-31 Thread Etienne Trimaille
Bonjour Sophie (since the university in Montpellier ;-) )

You should use a .gitignore file in your git repository with "*.pyc". It
will avoid having you to delete these files everytime.

Etienne

2017-05-31 18:12 GMT+08:00 Sophie Crommelinck 
:

> Oh my mistake, I haven't seen that open issue.
> I solved it by deleting all .pyc files and closed the ticket.
>
> Best,
>
> Sophie
>
>
> On 31 May 2017 at 12:02, Paolo Cavallini  wrote:
>
>> Hi Sphie,
>>
>> Il 31/05/2017 11:51, Sophie Crommelinck ha scritto:
>>
>> > about 3-4 weeks ago, I uploaded a QGIS Plugin called BoundaryDelineation
>> > to the QGIS Plugin Repository via http://plugins.qgis.org/plugins/add/
>> > .
>> >
>> > I haven't heard anything about its acceptance or refusal.
>>
>> I opened a ticket:
>> https://github.com/SCrommelinck/BoundaryDelineation/issues
>> and received no reply. I'll be glad of publishing it once issues are
>> fixed.
>> 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: 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] dwg import 100% cpu?

2017-05-31 Thread Régis Haubourg
Hi all,
I encounter troubles when trying to import a dwg to a new gpkg using the
dwg import feature from project menu.

I worked well in 2.18.2 and now I get a 100% cpu in 2.18.3 > 2.18.9.

It could be related to that particular dwg file  ( I can't share it here
unfortunately)

Did anyone encounter any trouble?

Is there any available log file I could check to see what's happening?

Cheers
Régis
___
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 Plugin not in repository

2017-05-31 Thread Sophie Crommelinck
Oh my mistake, I haven't seen that open issue.
I solved it by deleting all .pyc files and closed the ticket.

Best,

Sophie

On 31 May 2017 at 12:02, Paolo Cavallini  wrote:

> Hi Sphie,
>
> Il 31/05/2017 11:51, Sophie Crommelinck ha scritto:
>
> > about 3-4 weeks ago, I uploaded a QGIS Plugin called BoundaryDelineation
> > to the QGIS Plugin Repository via http://plugins.qgis.org/plugins/add/
> > .
> >
> > I haven't heard anything about its acceptance or refusal.
>
> I opened a ticket:
> https://github.com/SCrommelinck/BoundaryDelineation/issues
> and received no reply. I'll be glad of publishing it once issues are fixed.
> 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: 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 Plugin not in repository

2017-05-31 Thread Paolo Cavallini
Hi Sphie,

Il 31/05/2017 11:51, Sophie Crommelinck ha scritto:

> about 3-4 weeks ago, I uploaded a QGIS Plugin called BoundaryDelineation
> to the QGIS Plugin Repository via http://plugins.qgis.org/plugins/add/
> .
> 
> I haven't heard anything about its acceptance or refusal.

I opened a ticket:
https://github.com/SCrommelinck/BoundaryDelineation/issues
and received no reply. I'll be glad of publishing it once issues are fixed.
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: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] QGIS Plugin not in repository

2017-05-31 Thread Sophie Crommelinck
Hello,

about 3-4 weeks ago, I uploaded a QGIS Plugin called BoundaryDelineation to
the QGIS Plugin Repository via http://plugins.qgis.org/plugins/add/.

I haven't heard anything about its acceptance or refusal.

I am not sure if this mailing list is the right place to ask: how can I
find out more about the acceptance status of my plugin?

Best,

Sophie Crommelinck
___
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