[QGIS-Developer] Plugin [1220] RS approval notification.

2017-05-05 Thread noreply

Plugin RS approval by pcav.
The plugin version "[1220] RS 0.2" is now approved
Link: http://plugins.qgis.org/plugins/NITK_RS-GIS_17/
___
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] Qgis keeps crashing

2017-05-05 Thread Richard Duivenvoorde

Hi All,

please create an issue about this crashing:

https://issues.qgis.org/projects/qgis/issues/

note that devs need as much as info possible (Operating System, versions
used, plugins used, and actual things to do to reproduce the crash, see
http://qgis.org/en/site/getinvolved/development/bugreporting.html)

Regards,

Richard


On 05-05-17 19:51, Βασίλης Στουρνάρας wrote:
> It seems like we all have the exact same problem, which is that when
> trying to zoom in or out the application is crashing. So yes, it would
> be definitely useful for the developers to know. Thanks 
> 
> Στις 5 Μαΐ 2017 8:48 μ.μ., ο χρήστης "C Hamilton"
> > έγραψε:
> 
> I am adding this to the developers mailing list as it is something
> to pay attention to. It looks like there are a number of individuals
> that are having QGIS crash.
> 
> On Fri, May 5, 2017 at 12:45 PM, Armin Konrad  > wrote:
> 
> I have the same problem and it is really annoying. The actual
> version of QGIS is crashing frequantly just when when changing
> the zoom level or shifting the map.
> I wonder if there is a setting where I can set an automatic save
> of the project and alll layers while I'm working on it. It cost
> me much time to restart QGIS and repeat work, that I have
> already done before.
>  
> Armin Konrad
>  
> *Gesendet:* Freitag, 05. Mai 2017 um 16:58 Uhr
> *Von:* "C Hamilton"  >
> *An:* "Βασίλης Στουρνάρας"  >
> *Cc:* qgis-user  >
> *Betreff:* Re: [Qgis-user] Qgis keeps crashing
> I can't answer your question, but I too have found the latest
> versions of QGIS to crash frequently - often with just zooming
> in and out. I haven't been using the georeferencer plugin
> recently but I think there are bigger problems here and I wish
> there could be more quality control and testing done before
> releases. It makes it difficult to recommend QGIS to others when
> it frequently crashes.
>  
> On Fri, May 5, 2017 at 5:35 AM, Βασίλης Στουρνάρας
>  > wrote:
> 
> When I am using the georeferencer plug in, the software is
> crashing and the "the application stopped unexpectedly"
> message appears. Does anyone knows why? 
> 
> ___
> 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
> 
> 
> ___ 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
> 
> 
> 
> 
> 
> 
> ___
> 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
> 

___
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] Qgis keeps crashing

2017-05-05 Thread C Hamilton
I am adding this to the developers mailing list as it is something to pay
attention to. It looks like there are a number of individuals that are
having QGIS crash.

On Fri, May 5, 2017 at 12:45 PM, Armin Konrad  wrote:

> I have the same problem and it is really annoying. The actual version of
> QGIS is crashing frequantly just when when changing the zoom level or
> shifting the map.
> I wonder if there is a setting where I can set an automatic save of the
> project and alll layers while I'm working on it. It cost me much time to
> restart QGIS and repeat work, that I have already done before.
>
> Armin Konrad
>
> *Gesendet:* Freitag, 05. Mai 2017 um 16:58 Uhr
> *Von:* "C Hamilton" 
> *An:* "Βασίλης Στουρνάρας" 
> *Cc:* qgis-user 
> *Betreff:* Re: [Qgis-user] Qgis keeps crashing
> I can't answer your question, but I too have found the latest versions of
> QGIS to crash frequently - often with just zooming in and out. I haven't
> been using the georeferencer plugin recently but I think there are bigger
> problems here and I wish there could be more quality control and testing
> done before releases. It makes it difficult to recommend QGIS to others
> when it frequently crashes.
>
> On Fri, May 5, 2017 at 5:35 AM, Βασίλης Στουρνάρας <
> vassilis.stourna...@gmail.com> wrote:
>>
>> When I am using the georeferencer plug in, the software is crashing and
>> the "the application stopped unexpectedly" message appears. Does anyone
>> knows why?
>>
>> ___
>> 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
>
> ___ 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
>
___
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] Python example with aggregate calculation

2017-05-05 Thread Neumann, Andreas

Hi,

Finally, with the support from Matthias, I got a working example of my 
custom Python expression:


@qgsfunction(args='auto', group='Custom', usesgeometry=False)
def get_ews_anlage_nr(gemeinde, feature, parent):
AnlageLayer = 
QgsMapLayerRegistry.instance().mapLayersByName('Anlage')[0]

aggParams = QgsAggregateCalculator.AggregateParameters()
aggParams.filter = 'substr("anlage_nr",1,2) = \''+gemeinde+'\''
maxVal = 
AnlageLayer.aggregate(QgsAggregateCalculator.Max,'to_int(substr("anlage_nr",4,4))',aggParams)[0]

return maxVal

When I define the QgsAggregateCalculator.AggregateParameters() upfront 
separately it works fine. First I was trying to set the parameter 
directly within AnlageLayer.aggregate() but failed to find the direct 
syntax of the QgsAggregateCalculator.AggregateParameters() parameters. 
There are hardly any examples out there. But hey - finally it works!


Have a nice weekend!
Andreas

On 2017-05-05 15:55, Neumann, Andreas wrote:


Hi,

I have a basic example using aggregates:

--

@qgsfunction(args='auto', group='Custom', usesgeometry=False)
def get_ews_anlage_nr(gemeinde, feature, parent):
AnlageLayer = 
QgsMapLayerRegistry.instance().mapLayersByName('Anlage')[0]

maxVal = AnlageLayer.aggregate(4,'to_int(substr("anlage_nr",4,4))')[0]
return maxVal

---

But I still have two questions:

1. I still struggle to define a filter. I can't find the correct syntax 
how to define that filter string.


2. the first parameter "4" stands for "Max" aggregate (according to 
http://qgis-python.kartoza.com/docs/core/other/QgsAggregateCalculator.html#class-qgsaggregatecalculator 
). Could this code be written more "readable" by specifying "Max" 
instead of 4?


Thanks,

Andreas

On 2017-05-05 14:31, Neumann, Andreas wrote:


Hi,

Does someone have an example how to use QgsVectorLayer.aggregate() 
from Python?


How would the syntax for the parameters in the 
QgsAggregateCalculator.calculate() method look like in Python?


Thanks,

Andreas

___
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] Fwd: OSGeo welcomes 15 GSoC students!

2017-05-05 Thread Werner Macho
QGIS has got a new GSoC project.

Congratulations


-- Forwarded message --
From: Margherita Di Leo 
Date: Fri, May 5, 2017 at 10:19 AM
Subject: OSGeo welcomes 15 GSoC students!
To: news_i...@osgeo.org
Cc: "gsoc-adminosgeo.org" 


Dear OSGeo community,


we are proud to announce that 15 students were selected to work on
GSoC at OSGeo this year!


Browse the projects at:
https://summerofcode.withgoogle.com/organizations/4660070039158784/


Congratulations to all of our students and welcome!


--
Margherita Di Leo
___
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] Python example with aggregate calculation

2017-05-05 Thread Neumann, Andreas
Hi, 

I have a basic example using aggregates: 

-- 

@qgsfunction(args='auto', group='Custom', usesgeometry=False)
def get_ews_anlage_nr(gemeinde, feature, parent):
AnlageLayer =
QgsMapLayerRegistry.instance().mapLayersByName('Anlage')[0]
maxVal = AnlageLayer.aggregate(4,'to_int(substr("anlage_nr",4,4))')[0]
return maxVal 

--- 

But I still have two questions: 

1. I still struggle to define a filter. I can't find the correct syntax
how to define that filter string. 

2. the first parameter "4" stands for "Max" aggregate (according to
http://qgis-python.kartoza.com/docs/core/other/QgsAggregateCalculator.html#class-qgsaggregatecalculator
). Could this code be written more "readable" by specifying "Max"
instead of 4? 

Thanks, 

Andreas 

On 2017-05-05 14:31, Neumann, Andreas wrote:

> Hi, 
> 
> Does someone have an example how to use QgsVectorLayer.aggregate() from 
> Python? 
> 
> How would the syntax for the parameters in the 
> QgsAggregateCalculator.calculate() method look like in Python? 
> 
> Thanks, 
> 
> Andreas
> 
> ___
> 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] Custom python expression question

2017-05-05 Thread Matthias Kuhn 
I hope you don't mind very verbose docs ;)

https://github.com/qgis/QGIS/blob/fd25288a6444c1fd6fb965a408550992d7d1f84b/python/user.py#L69-L94

On 05/05/2017 02:35 PM, Nathan Woodrow wrote:
> Yes please :) 
> 
> On Fri, May 5, 2017 at 10:29 PM, Matthias Kuhn   > wrote:
> 
> On 05/05/2017 02:22 PM, Nyall Dawson wrote:
> > On 5 May 2017 at 22:08, Matthias Kuhn   > wrote:
> >>
> >> I think we should also send this to the @qgsfunction in QGIS 3.
> >>
> >
> > Agreed. Shall I assign a ticket to you or will you file a PR for this?
> >
> > Nyall
> >
> 
> Is backwards compatibility a requirement?
> 
> Matthias
> ___
> 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] Problem reading project file

2017-05-05 Thread Jörg Höttges
Hi,

in a QGIS-plugin I need to read a template project file (*.qgs), modify it to 
adapt it to the currently loaded database
etc. using xml.etree.ElementTree, write it and read it again.




qgsxml.write(projectfile)   # writemodified project file

project = QgsProject.instance()
project.read(QFileInfo(projectfile)) # read the new project file

projectfilecontains the name of the new *.qgs projectfile

First attempt is successful, the second fails (groups are loaded but there are 
no layers), third attempt is successful,
fourth fails and so on...

Everything works fine when I use the menu "project > new" before starting the 
plugin.

Have i done something wrong?

Best wishes

Jörg

FH Aachen   
Prof. Dr.-Ing. Jörg Höttges
Fachbereich 2 - Bauingenieurwesen
Wasserwirtschaft und Bauinformatik
FH Aachen
University of Applied Sciences
Bayernallee 9
52066 Aachen | Germany
T +49 (0)241 6009-51176
F +49 (0)241 6009-51206
http://www.fh-aachen.de/hoettges/
hoett...@fh-aachen.de 

___
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] Python example with aggregate calculation

2017-05-05 Thread Neumann, Andreas
Hi, 

Does someone have an example how to use QgsVectorLayer.aggregate() from
Python? 

How would the syntax for the parameters in the
QgsAggregateCalculator.calculate() method look like in Python? 

Thanks, 

Andreas___
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] Custom python expression question

2017-05-05 Thread Matthias Kuhn 
On 05/05/2017 02:22 PM, Nyall Dawson wrote:
> On 5 May 2017 at 22:08, Matthias Kuhn   wrote:
>>
>> I think we should also send this to the @qgsfunction in QGIS 3.
>>
> 
> Agreed. Shall I assign a ticket to you or will you file a PR for this?
> 
> Nyall
> 

Is backwards compatibility a requirement?

Matthias
___
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] Custom python expression question

2017-05-05 Thread Nyall Dawson
On 5 May 2017 at 22:08, Matthias Kuhn   wrote:
>
> I think we should also send this to the @qgsfunction in QGIS 3.
>

Agreed. Shall I assign a ticket to you or will you file a PR for this?

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] Custom python expression question

2017-05-05 Thread Matthias Kuhn 
Actually, there would also be the "context" which gives access to the
@layer variable (a QgsVectorLayer object) and other additional things.

It's just slightly more complex to set up because it's not proxied to
the @qgsfunction.

One will need to subclass QgsExpression.Function as done here:

https://github.com/qgis/QGIS/blob/master/python/core/__init__.py#L74-L102

And then register it manually.

I think we should also send this to the @qgsfunction in QGIS 3.

Matthias


On 05/05/2017 12:42 PM, Nathan Woodrow wrote:
> Hey Andreas,
> 
> Parent means the parent expression itself.  So in a function, you can
> know what the whole expression is e.g it points to the instance of. 
> 
> You can't really know what the layer because expressions are not always
> layer bound and QgsFeatures don't hold a reference to the layer they are
> from.  Best you can do at the moment I think is to pass the layer name
> or id into the custom expressions.
> 
> - Nathan
> 
> 
> ___
> 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] Custom python expression question

2017-05-05 Thread Nathan Woodrow
Hey Andreas,

Parent means the parent expression itself.  So in a function, you can know
what the whole expression is e.g it points to the instance of.

You can't really know what the layer because expressions are not always
layer bound and QgsFeatures don't hold a reference to the layer they are
from.  Best you can do at the moment I think is to pass the layer name or
id into the custom expressions.

- Nathan
___
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] Custom python expression question

2017-05-05 Thread Marco Grisolia
Hi Andreas,
I don't know if it is the best way for doing it, but I generally add the
current feature and the current layer as input parameters of the custom
function:

def my_function(layer_name, curr_feat, feature, parent):

They are set as inputs in this way when calling the custom function:

my_function(@layer_name, $currentfeature)

Then, I can simply call the current layer and the current feature inside
the function in this way:

layer = QgsMapLayerRegistry.instance().mapLayersByName(layer_name)[0]

geom = curr_feat.geometry()

For a better understanding, you may also have a look to my recent answer on
this question on GIS Stack Exchange [0]:

[0]
https://gis.stackexchange.com/questions/235014/increasing-marker-size-based-on-number-of-points-at-same-location-in-qgis

I hope that helps.
Best regards,
Marco





2017-05-05 10:45 GMT+02:00 Neumann, Andreas :

> Hi,
>
> If one creates a custom python expression, one gets a reference to the
> "feature" and the "parent".
>
> Question: what is "parent" referring to? What object type is it?
>
> Is it somehow possible in the Python script to get a reference to the
> layer the feature is part of? Would there be some example Python code
> around that shows how one can get access to the layer the feature belongs
> to?
>
> Thank you for any hints,
>
> Andreas
>
>
> ___
> 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] Custom python expression question

2017-05-05 Thread Neumann, Andreas
Hi, 

If one creates a custom python expression, one gets a reference to the
"feature" and the "parent". 

Question: what is "parent" referring to? What object type is it? 

Is it somehow possible in the Python script to get a reference to the
layer the feature is part of? Would there be some example Python code
around that shows how one can get access to the layer the feature
belongs to? 

Thank you for any hints, 

Andreas___
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