Re: [QGIS-Developer] Adding Layer tree embedded widgets programmatically

2019-02-13 Thread Raymond Nijssen

Hi Richard,

Here is some example code. I will try to make it work now.

Groetjes!
Raymond


On 13-02-19 12:37, Richard Duivenvoorde wrote:

Hi Devs,

Thinking about creating a small plugin which would add a 'Layer tree
embedded widget' to a layer in the legend, I hit:

https://github.com/qgis/QGIS/pull/3170

with a nice example on how to create such a widget (with 2 minor tweaks
see below).

But my question is if it is possible (in the python plugin) to attach
such widget to a specific layer? Now it is working but you can only
activate it via the layerproperties dialog.

I could not find a example or hint for it.

Any pointers appreciated.

Regards,

Richard Duivenvoorde

PS

To make Martins example https://github.com/qgis/QGIS/pull/3170) work in
QGIS3:

from PyQt4.QtGui import QComboBox
becomes
from qgis.PyQt.QtWidgets import QComboBox

QgsLayerTreeEmbeddedWidgetRegistry.instance().addProvider(provider)
becomes
QgsGui.layerTreeEmbeddedWidgetRegistry().addProvider(provider)
___
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] free variable 'self' referenced before assignment in enclosing scope

2019-01-31 Thread Raymond Nijssen
Nevermind, that return line should work. The self.Branches and 
self.Nodes are variables containing the strings for your dict.


The problem is in the AlgorithmDialog code. Hope someone else can help 
you with that.


Cheers,
Raymond


On 31-01-19 09:02, Raymond Nijssen wrote:

Hi Bjorn,

What do you expect this

{self.Branches:dest_id,self.Nodes:dest_id2}

would result in? It doesn't look like python to me but I might be 
missing something.



What does the variable self.Branches contain?


"self" Refers to your Branches_Nodes class itself.


(By the way, it is a good habit to start variable names with a lower 
case character.)


Regards,
Raymond



On 30-01-19 17:40, Bjørn Burr Nyberg wrote:

Dear QGIS community,

In the spirit of open-source I am trying to convert a set of scripts 
that ive designed in ArcMap to QGIS 3.x. I hope that this will enable 
a broader community of individuals to use the workflows ive designed. 
The original scripts can be found at 
https://github.com/BjornNyberg/NetworkGT/tree/master/Scripts


My problem is that in my first attempt to convert the scripts, QGIS 
either crashes or gives the following error.


2019-01-30T16:51:27 WARNING    Traceback (most recent call last):
   File 
"C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\processing\gui\AlgorithmDialog.py", 
line 238, in on_complete
   self.feedback.pushInfo(self.tr('Execution completed in 
{0:0.2f} seconds').format(time.time() - start_time))
  NameError: free variable 'self' referenced before 
assignment in enclosing scope


I have established that this error occurs at the very end of the 
script when calling ' return 
{self.Branches:dest_id,self.Nodes:dest_id2}'. I do not believe that I 
have explicitly defined self  anywhere in the processAlgorithm 
function itself. The algorithms themselves work as intended and the 
shapefiles are created before the program crashes.


I am not a programmer by trait so I'm not entirely sure how to problem 
solve this error and any help would be most appreciated. I can also 
provide a test dataset if that is helpful.


Cheers,
Bjorn
-
Postdoctoral Fellow
Department of Earth Science, University of Bergen
PO Box 7803, 5020, Bergen, Norway
+47 485 024 08



___
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

Re: [QGIS-Developer] free variable 'self' referenced before assignment in enclosing scope

2019-01-31 Thread Raymond Nijssen

Hi Bjorn,

What do you expect this

{self.Branches:dest_id,self.Nodes:dest_id2}

would result in? It doesn't look like python to me but I might be 
missing something.



What does the variable self.Branches contain?


"self" Refers to your Branches_Nodes class itself.


(By the way, it is a good habit to start variable names with a lower 
case character.)


Regards,
Raymond



On 30-01-19 17:40, Bjørn Burr Nyberg wrote:

Dear QGIS community,

In the spirit of open-source I am trying to convert a set of scripts that ive 
designed in ArcMap to QGIS 3.x. I hope that this will enable a broader 
community of individuals to use the workflows ive designed. The original 
scripts can be found at 
https://github.com/BjornNyberg/NetworkGT/tree/master/Scripts

My problem is that in my first attempt to convert the scripts, QGIS either 
crashes or gives the following error.

2019-01-30T16:51:27 WARNINGTraceback (most recent call last):
   File 
"C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\processing\gui\AlgorithmDialog.py",
 line 238, in on_complete
   self.feedback.pushInfo(self.tr('Execution completed in {0:0.2f} 
seconds').format(time.time() - start_time))
  NameError: free variable 'self' referenced before assignment in 
enclosing scope

I have established that this error occurs at the very end of the script when 
calling ' return {self.Branches:dest_id,self.Nodes:dest_id2}'. I do not believe 
that I have explicitly defined self  anywhere in the processAlgorithm function 
itself. The algorithms themselves work as intended and the shapefiles are 
created before the program crashes.

I am not a programmer by trait so I'm not entirely sure how to problem solve 
this error and any help would be most appreciated. I can also provide a test 
dataset if that is helpful.

Cheers,
Bjorn
-
Postdoctoral Fellow
Department of Earth Science, University of Bergen
PO Box 7803, 5020, Bergen, Norway
+47 485 024 08

  



___
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] segmentSide and leftOfLine functions

2019-01-17 Thread Raymond Nijssen


Should be fixed -- looks like needless duplication to me. One of the
methods should be deprecated and tagged for removal in QGIS 4.0.

Can't leftOfLine() be removed before the 3.6 release? Hasn't been used 
too much yet, I think. Is it possible to find out who added it?


I tried git blame but I'm not much of a git guru.

___
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] segmentSide and leftOfLine functions

2019-01-15 Thread Raymond Nijssen
Since 2 months there's a new function called leftOfLine() which 
calculates if a point is left or right from a line(segment). While using 
it I wondered why:


It returns
-1 if point is on left side
1 if point is on right side

cause I would expect the opposite result, or call the function 
rightOfLine().




When diving into this, I also found the function segmentSide() which 
calculates the exact same (but having a better name).



Here they are

segmentSide:

https://github.com/qgis/QGIS/blob/63a34455215d25851d648409bef9913bb0906e3f/src/core/geometry/qgsgeometryutils.cpp#L988


leftOfLine:

https://github.com/qgis/QGIS/blob/63a34455215d25851d648409bef9913bb0906e3f/src/core/geometry/qgsgeometryutils.cpp#L583

Am I missing something or should this be fixed?

Regards,
Raymond

___
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] Madeira Hackfest Blog post

2018-12-21 Thread Raymond Nijssen

Seems like you are mixing Madeira HF (2018) and A Coruna HF (2019).


On 21-12-18 12:40, Ismail Sunni wrote:

Hi matteo,

The link:

http://blog.qgis.org/2018/12/03/call-for-presentations-qgis-user-conference-and-developer-meeting-2019/

It's the 2nd last post.

Best regards

On Fri, Dec 21, 2018, 11:01 matteo  wrote:


Hi all,

I cannot find a blog post of the Madeira HF:

https://blog.qgis.org/

somebody knows something about it?

Thanks

Matteo
___
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

Re: [QGIS-Developer] rotating and resizing layout items (bug?)

2018-12-21 Thread Raymond Nijssen

Created this issue:
https://issues.qgis.org/issues/20864

On 16-12-18 21:49, Raymond Nijssen wrote:
Tnx Paolo, but that is another bug. I'm talking about 
QgsLayoutItemLabels here, not the map labels. I mean the pieces of text 
you put on a layout, like a title.




On 16-12-18 18:59, Paolo Cavallini wrote:

https://issues.qgis.org/issues/19263 ?

Cheers

On 12/15/18 10:46 AM, Raymond Nijssen wrote:

Hi!

I'm experiencing some strange behavior while working with rotated
labels in a layout.

Put a label on my layout like this:

x: 100
y: 100
width: 30
height: 12
refPoint: center-left

When I rotate it 270 degrees, it rotates around the center, ending up
at  x: 115, y: 115. I would expect it to rotate around the center-left
reference point.


Now I want to display a longer text string, so I extent the label box
length a bit (in this rotated state, I drag the top of my label a bit
upwards). After releasing my mouse the entire label has been moved
further left and downwards on my layout.

Exact same behaviour for picture items, so I guess it is a general
QgsLayoutItem thing.

Not sure how this is meant to be, but this feels not very logical to me.

Should I file a bug?

Regards,
Raymond
___
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] rotating and resizing layout items (bug?)

2018-12-16 Thread Raymond Nijssen
Tnx Paolo, but that is another bug. I'm talking about 
QgsLayoutItemLabels here, not the map labels. I mean the pieces of text 
you put on a layout, like a title.




On 16-12-18 18:59, Paolo Cavallini wrote:

https://issues.qgis.org/issues/19263 ?

Cheers

On 12/15/18 10:46 AM, Raymond Nijssen wrote:

Hi!

I'm experiencing some strange behavior while working with rotated
labels in a layout.

Put a label on my layout like this:

x: 100
y: 100
width: 30
height: 12
refPoint: center-left

When I rotate it 270 degrees, it rotates around the center, ending up
at  x: 115, y: 115. I would expect it to rotate around the center-left
reference point.


Now I want to display a longer text string, so I extent the label box
length a bit (in this rotated state, I drag the top of my label a bit
upwards). After releasing my mouse the entire label has been moved
further left and downwards on my layout.

Exact same behaviour for picture items, so I guess it is a general
QgsLayoutItem thing.

Not sure how this is meant to be, but this feels not very logical to me.

Should I file a bug?

Regards,
Raymond
___
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




--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
The Netherlands
+31 (0) 6 25 31 49 83
___
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] rotating and resizing layout items (bug?)

2018-12-15 Thread Raymond Nijssen

Hi!

I'm experiencing some strange behavior while working with rotated labels 
in a layout.


Put a label on my layout like this:

x: 100
y: 100
width: 30
height: 12
refPoint: center-left

When I rotate it 270 degrees, it rotates around the center, ending up at 
 x: 115, y: 115. I would expect it to rotate around the center-left 
reference point.



Now I want to display a longer text string, so I extent the label box 
length a bit (in this rotated state, I drag the top of my label a bit 
upwards). After releasing my mouse the entire label has been moved 
further left and downwards on my layout.


Exact same behaviour for picture items, so I guess it is a general 
QgsLayoutItem thing.


Not sure how this is meant to be, but this feels not very logical to me.

Should I file a bug?

Regards,
Raymond
___
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] What is the way to get all items of a QgsLayout?

2018-11-17 Thread Raymond Nijssen

Hi Song,

It is simply: layout.items()

For example, you can do this:


p = QgsProject.instance()
lom = p.layoutManager()
lo = lom.layoutByName(u'a4')
print(lo.items())


And then this to get all the labels:


for item in lo.items():
if isinstance(item, QgsLayoutItemLabel):
print(item)


There was a bug in the item classes recently but it has been fixed in v3.4

Good luck!
Raymond




On 17-11-18 07:56, Song Wendong wrote:
We want to make a function that send all items (mainly labels) to 
browser and let user set the cotent, then send it back to server and 
export as pdf.
I can only find |itemById| 
and 
|itemByUuid| 
, 
but there are all kinds of layouts.

Is there a way to get all items and their ids?


___
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



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
The Netherlands
+31 (0) 6 25 31 49 83
___
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] Import in PostGIS from Processing

2018-11-14 Thread Raymond Nijssen

Hi Paolo,

Not sure, but is this what you mean?


algorithm name:

'Export to PostgreSQL'

description:

Export to PostgreSQL
This algorithm imports a vector layer into a PostGIS database, creating 
a new table.
Prior to this a connection between QGIS and the PostGIS database has to 
be created (for example with the DB Manager).


in the dialog:
"layer to import"


It looks a bit confusing, though it depends on the view point wetter it 
is an import or an export.


Regards,
Raymond



On 14-11-18 19:13, Paolo Cavallini wrote:

Hi all,

the Import alg in Processing is called Export in 3.4, whereas it is
correct in 3.2 and earlier. Could someone confirm?

Thanks.



___
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] get visibility from layout items with python

2018-11-07 Thread Raymond Nijssen



On 08-11-18 08:20, Nyall Dawson wrote:

On Thu, 8 Nov 2018 at 17:18, Raymond Nijssen  wrote:


I'm also using setVisible() now, instead of setVisibility(). But now I
wonder why the latter exists.


Check the API dox -- there's a specific note there that you need to
call setVisibility instead of setVisible, or visiblity won't work
correctly for some items (like groups).


Thanks. I read that but I didn't get it. So I should use setVisibility() 
instead of setVisible(), right? (They both work on QgsLayoutItemLabel btw.)




(Unfortunately QGraphicsItem::setVisible is not virtual, so we can't
override that... hence the ugly api here).


Ok, clear.


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] get visibility from layout items with python

2018-11-07 Thread Raymond Nijssen



On 08-11-18 08:08, Nyall Dawson wrote:

On Thu, 8 Nov 2018 at 17:02, Raymond Nijssen  wrote:


In the python api, QgsLayoutItems have a setter for the visibility, but
i cannot find a way to retrieve the visibility setting.

https://qgis.org/pyqgis/master/core/Layout/QgsLayoutItem.html


I would like to do this:

item = QgsLayoutItemLabel() # I get this from my layout
checkbox.setChecked(item.visibility()) # this fails


item.isVisible()

It's from the base QGraphicsItem class.

Nyall



Thanks Nyall, works!

I'm also using setVisible() now, instead of setVisibility(). But now I 
wonder why the latter exists.


Raymond
___
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] get visibility from layout items with python

2018-11-07 Thread Raymond Nijssen
In the python api, QgsLayoutItems have a setter for the visibility, but 
i cannot find a way to retrieve the visibility setting.


https://qgis.org/pyqgis/master/core/Layout/QgsLayoutItem.html


I would like to do this:

item = QgsLayoutItemLabel() # I get this from my layout
checkbox.setChecked(item.visibility()) # this fails

and later:

item.setVisibility(checkbox.checked()) # this works


Is this possible in another way? Or is it just missing and can it be added?

Thanks,
Raymond
___
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] Unable to export map with PyQGIS 3

2018-10-24 Thread Raymond Nijssen

There is the cookbook, but it is quite outdated since qgis3:

https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/index.html


There is the python api docummentation, I think you already found it:

https://qgis.org/pyqgis/master/index.html


There are many unit tests in python that can act like examples:

https://github.com/qgis/QGIS/tree/master/tests/src/python


Then there are many python plugins you can use as examples. Just find 
one that does something you need and look into the code.





On 24-10-18 10:21, Dimitris Kar wrote:

Hey Raymond,

Thank you very much for your answer. It worked. Are you aware of any 
resources, online trainings, books or anything else which focuses on the 
pyqgis3? What would be your recommendation on this.


Cheers
Dimitris

On Wed, Oct 24, 2018 at 10:09 AM Raymond Nijssen <mailto:r.nijs...@terglobo.nl>> wrote:


Hi Dimitris,

It is indeed hard to learn pyqgis 3 with outdated docs.

The following code worked for me (suggested by Martin Dobias):

settings = QgsMapSettings()
settings.setOutputSize(QSize(512,512))
settings.setExtent(layer.extent())
settings.setLayers([layer])

job = QgsMapRendererSequentialJob(settings)
job.start()
job.waitForFinished()
img = job.renderedImage()
img.save("/tmp/rendered.png")

When you call job.start(), it will start rendering in background and
immediately return. That's why you need to call job.waitForFinished()
to block your code until the final image is ready. This approach has a
downside that it blocks the main thread and therefore the GUI will be
blocked until rendering has finished. If you would like to avoid this
blocking, after job.start() you could have a slot that would listen to
finished() signal coming from "job" - and save the image there. This
approach makes the code a bit more complex, but the GUI does not get
blocked and you can even start multiple jobs at a time in parallel.

Hope it helps you. Good luck learning pyqgis!

Raymond



On 24-10-18 09:47, Dimitris Kar wrote:
 > I am trying to learn and work with PyQGIS 3.
 >
 > It is a very challenging task cause documentation is really
[limited and
 > out of date][1].
 >
 > What I am trying to do is to:
 >
 >   1. create a project
 >   2. add a layer
 >   3. save the project
 >   4. export it as a png
 >
 > I have done the first 3 steps (see code below).
 >
 >      import sys
 >      import qgis
 >      from qgis.core import QgsVectorLayer
 >      from qgis.core import QgsApplication
 >      from qgis.core import QgsProject
 >      from qgis.core import QgsMapRendererJob, QgsMapSettings
 >      from qgis.gui import QgsMapCanvas
 >      from PyQt5.QtGui import QImage, QColor, QPainter
 >      from PyQt5.QtCore import QSize
 >
 >      # PYTHON APPLICATIONS
 >
 >      # prefix path: the location where qgis is installed in the
system
 >      # the easiest way to find the prefix path to run the following
 > commaand from the python console of qgis: QgsApplication.prefixPath()
 >
 >      #1. CREATE THE APPLICATION
 >      QgsApplication.setPrefixPath('/usr', True)
 >      # second parameter into false disables the gui
 >      qgs = QgsApplication([], False)
 >      #load providers
 >      qgs.initQgis()
 >
 >      #2. CREATE THE PROJECT
 >      # create project
 >      project_name =
'/home/dkar/workspaces/qgis/data/test_project_2.qgz'
 >      project = QgsProject.instance()
 >      new_project = project.write(project_name)
 >
 >      #3. READ/OPEN THE PROJECT
 >      # modify the project e.g. adding more layers and save it.
 >      new_project = project.read(project.fileName())
 >
 >
 >      #4. ADD A VECTORLAYER
 >      # add a layer in the QgsProviderRegistry
 >
 >
layer=QgsVectorLayer("/home/dkar/workspaces/qgis/data/pakistan_1.shp",
 > "pakistan", "ogr")
 >
 >      if not layer.isValid():
 >      print("Layer failed")
 >
 >      #5. ADD LAYER TO THE REGISTRY
 >      project.addMapLayer(layer, True)
 > 
project.write('/home/dkar/workspaces/qgis/data/test_project_2.qgz')

 >
 >      #6. SAVE THE PROJECT
 >      all_layers = QgsProject.instance().mapLayers()
 >
 >
 >      img = QImage(QSize (800, 600),
QImage.Format_ARGB32_Premultiplied)
 >      # set image's backgroud color
 >      color = QColor(255, 255, 255)
 >      img.fill(color.rgb())
 >
 >      #create painter
 >      p = 

Re: [QGIS-Developer] Unable to export map with PyQGIS 3

2018-10-24 Thread Raymond Nijssen

Hi Dimitris,

It is indeed hard to learn pyqgis 3 with outdated docs.

The following code worked for me (suggested by Martin Dobias):

settings = QgsMapSettings()
settings.setOutputSize(QSize(512,512))
settings.setExtent(layer.extent())
settings.setLayers([layer])

job = QgsMapRendererSequentialJob(settings)
job.start()
job.waitForFinished()
img = job.renderedImage()
img.save("/tmp/rendered.png")

When you call job.start(), it will start rendering in background and
immediately return. That's why you need to call job.waitForFinished()
to block your code until the final image is ready. This approach has a
downside that it blocks the main thread and therefore the GUI will be
blocked until rendering has finished. If you would like to avoid this
blocking, after job.start() you could have a slot that would listen to
finished() signal coming from "job" - and save the image there. This
approach makes the code a bit more complex, but the GUI does not get
blocked and you can even start multiple jobs at a time in parallel.

Hope it helps you. Good luck learning pyqgis!

Raymond



On 24-10-18 09:47, Dimitris Kar wrote:

I am trying to learn and work with PyQGIS 3.

It is a very challenging task cause documentation is really [limited and 
out of date][1].


What I am trying to do is to:

  1. create a project
  2. add a layer
  3. save the project
  4. export it as a png

I have done the first 3 steps (see code below).

     import sys
     import qgis
     from qgis.core import QgsVectorLayer
     from qgis.core import QgsApplication
     from qgis.core import QgsProject
     from qgis.core import QgsMapRendererJob, QgsMapSettings
     from qgis.gui import QgsMapCanvas
     from PyQt5.QtGui import QImage, QColor, QPainter
     from PyQt5.QtCore import QSize

     # PYTHON APPLICATIONS

     # prefix path: the location where qgis is installed in the system
     # the easiest way to find the prefix path to run the following 
commaand from the python console of qgis: QgsApplication.prefixPath()


     #1. CREATE THE APPLICATION
     QgsApplication.setPrefixPath('/usr', True)
     # second parameter into false disables the gui
     qgs = QgsApplication([], False)
     #load providers
     qgs.initQgis()

     #2. CREATE THE PROJECT
     # create project
     project_name = '/home/dkar/workspaces/qgis/data/test_project_2.qgz'
     project = QgsProject.instance()
     new_project = project.write(project_name)

     #3. READ/OPEN THE PROJECT
     # modify the project e.g. adding more layers and save it.
     new_project = project.read(project.fileName())


     #4. ADD A VECTORLAYER
     # add a layer in the QgsProviderRegistry
 
layer=QgsVectorLayer("/home/dkar/workspaces/qgis/data/pakistan_1.shp", 
"pakistan", "ogr")


     if not layer.isValid():
     print("Layer failed")

     #5. ADD LAYER TO THE REGISTRY
     project.addMapLayer(layer, True)
     project.write('/home/dkar/workspaces/qgis/data/test_project_2.qgz')

     #6. SAVE THE PROJECT
     all_layers = QgsProject.instance().mapLayers()


     img = QImage(QSize (800, 600), QImage.Format_ARGB32_Premultiplied)
     # set image's backgroud color
     color = QColor(255, 255, 255)
     img.fill(color.rgb())

     #create painter
     p = QPainter()
     p.begin(img)
     p.setRenderHint(QPainter.Antialiasing)

     # THIS IS WHERE THE ISSUE APPEARS
     # THIS IS WHERE THE ISSUE APPEARS
     render = QgsMapRendererJob() # THIS IS WHERE THE ISSUE APPEARS

     # set layer set (am I using here the prohect?)
     lst = [layer.id ()] # cause "layer" is the name of 
the variable

     render.setLayerSet(lst)

     # to remove the provider and layer registries from memory
     qgs.exitQgis()



But when I try to do the last part, following the instructions from the 
existing documentation. I get issues because the specific function 
(`QgsMapRenderer`) doesn't exist anymore in QGIS 3.


I am not sure how to solve the issue.

I see in the documentation that this function:

     QgsMapRenderer

was replaced by

     QgsMapRendererJob

But then when I try to import and use it in the code as:

     from qgis.core import QgsMapRendererJob, QgsMapSettings
     render = QgsMapRendererJob()

I get an error message:

     TypeError: qgis._core.QgsMapRendererJob represents a C++ abstract 
class and cannot be instantiated


Any idea how to proceed with this?

   [1]: 
https://docs.qgis.org/testing/pdf/en/QGIS-testing-PyQGISDeveloperCookbook-en.pdf


___
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



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
The Netherlands
+31 (0) 6 25 31 49 83
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] URL/Request logging of QGIS?

2018-10-18 Thread Raymond Nijssen

Hi Richard,

I would love this as well, when trying to debug WMS/WFS problems.

In the past I've been using Wireshark for this, which you can try for now.

Raymond


On 18-10-18 13:31, Tom Chadwin wrote:

I'd find this incredibly useful, as I've had to attach an HTTP debugger in
the past, which is overkill when all you want is to see the full requests.

Thanks

Tom



-
Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon
--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html
___
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



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
The Netherlands
+31 (0) 6 25 31 49 83
___
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] set data defined override expression with python?

2018-10-18 Thread Raymond Nijssen

On 16-10-18 04:19, Nyall Dawson wrote:

The API uses ints instead of the direct DataDefinedProperty enums, as
the enums vary by part of code (there's separate enums for symbology,
labelling, layouts, etc)

For symbology:

layer = QgsSvgMarkerSymbolLayer(...)
...
layer.setDataDefinedProperty( QgsSymbolLayer.PropertyName,
QgsProperty.fromExpression( " some expression ") )

Nyall




Thanks Nyall, that works!

And now I know the property name, I could also find the other 
properties. And then I started searching the code for more and found the 
ones listed below. Possibly there are more.


It was apparently too hard for me finding these property names and I 
wonder if others are struggling as well. Where could we put this in a 
way where people can find it and where it will be easily to maintain? 
The cookbook?


Regards,
Raymond



QgsAbstract3DSymbol
  PropertyHeight = 0,   //!< Height (altitude)
  PropertyExtrusionHeight,  //!< Extrusion height (zero means no 
extrusion)


QgsLayoutObject
  NoProperty = 0, //!< No property
  AllProperties, //!< All properties for item
  TestProperty, //!< Dummy property with no effect on item
  //composer page properties
  PresetPaperSize, //!< Preset paper size for composition
  PaperWidth, //!< Paper width (deprecated)
  PaperHeight, //!< Paper height (deprecated)
  NumPages, //!< Number of pages in composition (deprecated)
  PaperOrientation, //!< Paper orientation
  //general composer item properties
  PageNumber, //!< Page number for item placement
  PositionX, //!< X position on page
  PositionY, //!< Y position on page
  ItemWidth, //!< Width of item
  ItemHeight, //!< Height of item
  ItemRotation, //!< Rotation of item
  Transparency, //!< Item transparency (deprecated)
  Opacity, //!< Item opacity
  BlendMode, //!< Item blend mode
  ExcludeFromExports, //!< Exclude item from exports
  FrameColor, //!< Item frame color
  BackgroundColor, //!< Item background color
  //composer map
  MapRotation, //!< Map rotation
  MapScale, //!< Map scale
  MapXMin, //!< Map extent x minimum
  MapYMin, //!< Map extent y minimum
  MapXMax, //!< Map extent x maximum
  MapYMax, //!< Map extent y maximum
  MapAtlasMargin, //!< Map atlas margin
  MapLayers, //!< Map layer set
  MapStylePreset, //!< Layer and style map theme
  //composer picture
  PictureSource, //!< Picture source url
  PictureSvgBackgroundColor, //!< SVG background color
  PictureSvgStrokeColor, //!< SVG stroke color
  PictureSvgStrokeWidth, //!< SVG stroke width
  //html item
  SourceUrl, //!< Html source url
  //legend item
  LegendTitle, //!< Legend title
  LegendColumnCount, //!< Legend column count
  //scalebar item
  ScalebarFillColor, //!< Scalebar fill color
  ScalebarFillColor2, //!< Scalebar secondary fill color
  ScalebarLineColor, //!< Scalebar line color
  ScalebarLineWidth, //!< Scalebar line width,
  //table item
  AttributeTableSourceLayer, //!< Attribute table source layer

QgsDiagramLayerSettings
  BackgroundColor, //!< Diagram background color
  StrokeColor, //!< Stroke color
  StrokeWidth, //!< Stroke width
  PositionX, //! x-coordinate data defined diagram position
  PositionY, //! y-coordinate data defined diagram position
  Distance, //! Distance to diagram from feature
  Priority, //! Diagram priority (between 0 and 10)
  ZIndex, //! Z-index for diagram ordering
  IsObstacle, //! Whether diagram features act as obstacles for 
other diagrams/labels

  Show, //! Whether to show the diagram
  AlwaysShow, //! Whether the diagram should always be shown, even 
if it overlaps other diagrams/labels

  StartAngle, //! Angle offset for pie diagram

QgsPalLayerSettings
  Size = 0, //!< Label size
  Bold = 1, //!< Use bold style
  Italic = 2, //!< Use italic style
  Underline = 3, //!< Use underline
  Color = 4, //!< Text color
  Strikeout = 5, //!< Use strikeout
  Family = 6, //!< Font family
  FontStyle = 21, //!< Font style name
  FontSizeUnit = 22, //!< Font size units
  FontTransp = 18, //!< Text transparency (deprecated)
  FontOpacity = 92, //!< Text opacity
  FontCase = 27, //!< Label text case
  FontLetterSpacing = 28, //!< Letter spacing
  FontWordSpacing = 29, //!< Word spacing
  FontBlendMode = 30, //! Text blend mode

  // text formatting
  MultiLineWrapChar = 31,
  AutoWrapLength = 101,
  MultiLineHeight = 32,
  MultiLineAlignment = 33,
  DirSymbDraw = 34,
  DirSymbLeft = 35,
  DirSymbRight = 36,
  DirSymbPlacement = 37,
  DirSymbReverse = 38,
  NumFormat = 39,
  NumDecimals = 40,
  NumPlusSign = 41,

  // text buffer
  BufferDraw = 42,
  BufferSize = 7,
  BufferUnit = 43,
  BufferColor = 8,
  BufferTransp 

Re: [QGIS-Developer] set data defined override expression with python?

2018-10-15 Thread Raymond Nijssen
So now I'd like to set another expression, quite similar, but this time 
the svg-path to a QgsSvgMarkerSymbolLayer.


Where can I find the name of that property? I found the 
QgsLayoutObject.PictureSource here:


https://github.com/qgis/QGIS/blob/c89a542365eb46317468135cb33236ecc0c3768c/src/core/layout/qgslayoutobject.h#L47

But I don't know what class should hold the data defined property 
enumeration for an svgMarkerSymbolLayer. Searching for "enum 
DataDefinedProperty" in the qgis code doesn't get me any other result.


Hope anyone can help me out here!

Kind regards,
Raymond



On 22-08-18 08:39, Raymond Nijssen wrote:
Thank you Nyall! Does exactly what I need. Will add it to the python 
cookbook.


Raymond



On 22-08-18 00:10, Nyall Dawson wrote:
On Wed, 22 Aug 2018 at 01:41, Raymond Nijssen  
wrote:


Hi devs!

I'd like my python plugin to set an expression for overriding a property
and I have no clue how to do so. I expect there must be some generic way
to set expressions.

Specifically, I want to set the expression for the "Image source" of a
QgsLayoutItemPicture to:

'/path/to/pictures/' || attribute(@atlas_feature, 'ID') || '.svg'



Try

 property = QgsProperty.fromExpression( "'/path/to/pictures/' ||
attribute(@atlas_feature, 'ID') || '.svg'")
 
item.dataDefinedProperties().setProperty(QgsLayoutObject.PictureSource,

property)

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


___
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] open atlas layout, using python

2018-10-12 Thread Raymond Nijssen

Hi Nyall,

The setAtlasPreviewEnabled(True) still does not work correctly. It works 
exactly like the python workaround you mentioned: It toggles the atlas 
button but does not activate the atlas. I mean, the prev and next 
buttons stay disabled and the map does not display page number 1.


If I then, turn off and on the atlas preview, it works as expected.

Does it need to get some kind of gui redraw/update call?

Regards,
Raymond


On 12-10-18 01:39, Nyall Dawson wrote:

On Fri, 12 Oct 2018 at 02:22, Raymond Nijssen  wrote:


By the way, the fragile code solution does not work for me. It does
toggle the button but it does not activate the atlas preview.


Ok - I've done the proper approach in
https://github.com/qgis/QGIS/pull/8170/files

(I've also exposed an API call to show the item properties for a
particular item)

Let me know if there's anything else you think should be exposed from
the designer to the designer API.


Nyall



# open layout
designer = iface.openLayoutDesigner(layout)

# turn on atlas preview mode
lo_view = designer.view()
lo_window = lo_view.window()
action = lo_window.findChild(QAction, 'mActionAtlasPreview')
action.toggle()


On 11-10-18 16:51, Raymond Nijssen wrote:

Hi Nyall,

It sounded great and I spent some hours on that better approach, but I
didn't succeed. So maybe 3.6 will have it...

Tnx!
Raymond


On 25-09-18 23:57, Nyall Dawson wrote:

On Tue, 25 Sep 2018 at 22:36, Raymond Nijssen 
wrote:


1. Can I open a layout window with a python command?


designer = iface.openLayoutDesigner( layout )


2. Can I turn on "atlas preview" with a python command?


You'd have to do some fragile code to do this. Basically:

- get designer window from designer.view()'s parent window
- find the mActionAtlasPreview child action in the window
- manually toggle it on

This should work, but isn't stable API - so is likely to break ;)

A better approach is to (quickly, before 3.4 final!) file a PR
exposing the toggle atlas preview behavior to
QgsLayoutDesignerInterface. Then you'll be able to just do:

designer = iface.openLayoutDesigner( layout )
designer.toggleAtlasPreview( True )

Nyall


Hope anyone knows!


Kind regards,
Raymond

___
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

Re: [QGIS-Developer] open atlas layout, using python

2018-10-12 Thread Raymond Nijssen

Thank you Nyall, compiling now.

Yesterday I was asked to create a plugin that works on layouts, so it 
will need a button in the layout composer. I think I could do this the 
same fragile/hacky way, but is there a proper way?


I also find it hard to create reports from python, but maybe that is 
still too young and not all finished?


Regards,
Raymond



On 12-10-18 01:39, Nyall Dawson wrote:

On Fri, 12 Oct 2018 at 02:22, Raymond Nijssen  wrote:


By the way, the fragile code solution does not work for me. It does
toggle the button but it does not activate the atlas preview.


Ok - I've done the proper approach in
https://github.com/qgis/QGIS/pull/8170/files

(I've also exposed an API call to show the item properties for a
particular item)

Let me know if there's anything else you think should be exposed from
the designer to the designer API.


Nyall



# open layout
designer = iface.openLayoutDesigner(layout)

# turn on atlas preview mode
lo_view = designer.view()
lo_window = lo_view.window()
action = lo_window.findChild(QAction, 'mActionAtlasPreview')
action.toggle()


On 11-10-18 16:51, Raymond Nijssen wrote:

Hi Nyall,

It sounded great and I spent some hours on that better approach, but I
didn't succeed. So maybe 3.6 will have it...

Tnx!
Raymond


On 25-09-18 23:57, Nyall Dawson wrote:

On Tue, 25 Sep 2018 at 22:36, Raymond Nijssen 
wrote:


1. Can I open a layout window with a python command?


designer = iface.openLayoutDesigner( layout )


2. Can I turn on "atlas preview" with a python command?


You'd have to do some fragile code to do this. Basically:

- get designer window from designer.view()'s parent window
- find the mActionAtlasPreview child action in the window
- manually toggle it on

This should work, but isn't stable API - so is likely to break ;)

A better approach is to (quickly, before 3.4 final!) file a PR
exposing the toggle atlas preview behavior to
QgsLayoutDesignerInterface. Then you'll be able to just do:

designer = iface.openLayoutDesigner( layout )
designer.toggleAtlasPreview( True )

Nyall


Hope anyone knows!


Kind regards,
Raymond

___
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

Re: [QGIS-Developer] open atlas layout, using python

2018-10-11 Thread Raymond Nijssen
By the way, the fragile code solution does not work for me. It does 
toggle the button but it does not activate the atlas preview.


# open layout
designer = iface.openLayoutDesigner(layout)

# turn on atlas preview mode
lo_view = designer.view()
lo_window = lo_view.window()
action = lo_window.findChild(QAction, 'mActionAtlasPreview')
action.toggle()


On 11-10-18 16:51, Raymond Nijssen wrote:

Hi Nyall,

It sounded great and I spent some hours on that better approach, but I 
didn't succeed. So maybe 3.6 will have it...


Tnx!
Raymond


On 25-09-18 23:57, Nyall Dawson wrote:
On Tue, 25 Sep 2018 at 22:36, Raymond Nijssen  
wrote:


1. Can I open a layout window with a python command?


designer = iface.openLayoutDesigner( layout )


2. Can I turn on "atlas preview" with a python command?


You'd have to do some fragile code to do this. Basically:

- get designer window from designer.view()'s parent window
- find the mActionAtlasPreview child action in the window
- manually toggle it on

This should work, but isn't stable API - so is likely to break ;)

A better approach is to (quickly, before 3.4 final!) file a PR
exposing the toggle atlas preview behavior to
QgsLayoutDesignerInterface. Then you'll be able to just do:

designer = iface.openLayoutDesigner( layout )
designer.toggleAtlasPreview( True )

Nyall


Hope anyone knows!


Kind regards,
Raymond

___
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] open atlas layout, using python

2018-10-11 Thread Raymond Nijssen

Hi Nyall,

It sounded great and I spent some hours on that better approach, but I 
didn't succeed. So maybe 3.6 will have it...


Tnx!
Raymond


On 25-09-18 23:57, Nyall Dawson wrote:

On Tue, 25 Sep 2018 at 22:36, Raymond Nijssen  wrote:


1. Can I open a layout window with a python command?


designer = iface.openLayoutDesigner( layout )


2. Can I turn on "atlas preview" with a python command?


You'd have to do some fragile code to do this. Basically:

- get designer window from designer.view()'s parent window
- find the mActionAtlasPreview child action in the window
- manually toggle it on

This should work, but isn't stable API - so is likely to break ;)

A better approach is to (quickly, before 3.4 final!) file a PR
exposing the toggle atlas preview behavior to
QgsLayoutDesignerInterface. Then you'll be able to just do:

designer = iface.openLayoutDesigner( layout )
designer.toggleAtlasPreview( True )

Nyall


Hope anyone knows!


Kind regards,
Raymond

___
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




--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
The Netherlands
+31 (0) 6 25 31 49 83
___
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] open atlas layout, using python

2018-09-25 Thread Raymond Nijssen

1. Can I open a layout window with a python command?

2. Can I turn on "atlas preview" with a python command?

Hope anyone knows!

Kind regards,
Raymond

___
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] Has QgsLayout.itemById() changed?

2018-09-23 Thread Raymond Nijssen

Thank you Nyall and Allesandro.

So I don't need to file the bus anymore. But who could/would dive into 
this and fix it? And how much would it cost? I might be able to find 
some funding.


For now I will use the workaround.

Raymond



On 23-09-18 11:48, Nyall Dawson wrote:

On Sun, 23 Sep 2018 at 19:37, Alessandro Pasotti  wrote:


Do you have any clue about why this issue is not always reproducible?


I suspect it's something to do with whether the item was created in
Python or c++.

Nyall




On Sun, Sep 23, 2018, 11:27 Nyall Dawson  wrote:


On Fri, 21 Sep 2018 at 23:20, Raymond Nijssen  wrote:


which doesn't work anymore, because there is no setText() function on a
QgsLayoutItem. Has anything changed recently? Does any one know a solution?


Nothing has changed recently -- this has always been fragile, and the
bug lies deep within the library used to create the Python bindings.

See e.g.

http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-QgsLayout-itemById-returns-wrong-object-td5350947.html

for a workaround

Nyall

Nyall



Regards,
Raymond
___
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




--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
The Netherlands
+31 (0) 6 25 31 49 83
___
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] Has QgsLayout.itemById() changed?

2018-09-21 Thread Raymond Nijssen
Not working for me. I just built todays master (e85c09254c) and get the 
same result. What version did you build?




On 21-09-18 16:29, Alessandro Pasotti wrote:


Hi Raymond,

You know what? I've just rebased and rebuilt current master and I cannot 
reproduce it anymore :(

I checked the bindings code and it looks fine, can you check latest master?


On Fri, Sep 21, 2018 at 3:47 PM Raymond Nijssen <mailto:r.nijs...@terglobo.nl>> wrote:


Will do so. Thank you Alessandro!



On 21-09-18 15:32, Alessandro Pasotti wrote:
 > Hi Raymond,
 >
 > confirmed, there is probably something broken in the bindings,
please
 > file a ticket.
 >
 > On Fri, Sep 21, 2018 at 3:20 PM Raymond Nijssen
mailto:r.nijs...@terglobo.nl>
 > <mailto:r.nijs...@terglobo.nl <mailto:r.nijs...@terglobo.nl>>> wrote:
 >
 >     Running this python script (in qgis 3.3):
 >
 >     p = QgsProject.instance()
 >     lom = p.layoutManager()
 >     lo = lom.layoutByName('a4')
 >     item = lo.itemById('label_title')
 >     print(item)
 >
 >
 >     a few weeks ago, it outputed this:
 >     
 >
 >
 >     but today it outputs:
 >     
 >
 >
 >
 >     My next line is:
 >
 >     item.setText('hello')
 >
 >     which doesn't work anymore, because there is no setText()
function on a
 >     QgsLayoutItem. Has anything changed recently? Does any one know a
 >     solution?
 >
 >     Regards,
 >     Raymond
 >     ___
 >     QGIS-Developer mailing list
 > QGIS-Developer@lists.osgeo.org
<mailto:QGIS-Developer@lists.osgeo.org>
<mailto:QGIS-Developer@lists.osgeo.org
<mailto: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 <http://www.itopen.it> <http://www.itopen.it>

-- 
Terglobo

Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
The Netherlands
+31 (0) 6 25 31 49 83
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org <mailto: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 <http://www.itopen.it>


--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
The Netherlands
+31 (0) 6 25 31 49 83
___
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] Has QgsLayout.itemById() changed?

2018-09-21 Thread Raymond Nijssen

Will do so. Thank you Alessandro!



On 21-09-18 15:32, Alessandro Pasotti wrote:

Hi Raymond,

confirmed, there is probably something broken in the bindings, please 
file a ticket.


On Fri, Sep 21, 2018 at 3:20 PM Raymond Nijssen <mailto:r.nijs...@terglobo.nl>> wrote:


Running this python script (in qgis 3.3):

p = QgsProject.instance()
lom = p.layoutManager()
lo = lom.layoutByName('a4')
item = lo.itemById('label_title')
print(item)


a few weeks ago, it outputed this:



but today it outputs:




My next line is:

item.setText('hello')

which doesn't work anymore, because there is no setText() function on a
QgsLayoutItem. Has anything changed recently? Does any one know a
solution?

Regards,
Raymond
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org <mailto: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 <http://www.itopen.it>


--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
The Netherlands
+31 (0) 6 25 31 49 83
___
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] Has QgsLayout.itemById() changed?

2018-09-21 Thread Raymond Nijssen

Running this python script (in qgis 3.3):

p = QgsProject.instance()
lom = p.layoutManager()
lo = lom.layoutByName('a4')
item = lo.itemById('label_title')
print(item)


a few weeks ago, it outputed this:



but today it outputs:




My next line is:

item.setText('hello')

which doesn't work anymore, because there is no setText() function on a 
QgsLayoutItem. Has anything changed recently? Does any one know a solution?


Regards,
Raymond
___
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] round function not working

2018-09-03 Thread Raymond Nijssen

On 03-09-18 02:00, Nyall Dawson wrote:

On Sun, 2 Sep 2018 at 20:47, Raymond Nijssen  wrote:


Just discovered similar unexpected rounding behavior, but a bit
different I think:


My expression is this one, to show lengths of tracks on my map, in km:

"etappe" || '\n (' ||
round((length(transform($geometry,'epsg:4326','epsg:31466'))/1000), 1)
|| ' km)'


The rounding does actually work fine, but it seems the conversion from
my rounded value to a string is the problem.

Here some examples (qgis 3.3):

round(0.99, 1) --> 1
round(1.00, 1) --> 1
round(1.01, 1) --> 1
round(1.02, 1) --> 1
round(1.03, 1) --> 1
round(1.04, 1) --> 1
round(1.05, 1) --> 1.1001
round(1.06, 1) --> 1.1001
round(1.07, 1) --> 1.1001
round(1.08, 1) --> 1.1001
round(1.09, 1) --> 1.1001
round(1.10, 1) --> 1.1001
round(1.11, 1) --> 1.1001
round(1.12, 1) --> 1.1001
round(1.13, 1) --> 1.1001
round(1.14, 1) --> 1.1001


Which Qt version is this with? Looks like bugs which we experienced with 5.6...

Nyall



Yes, 5.5.1

Will it be solved with a newer version? I'm going to test it this week.

Raymond

___
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] round function not working

2018-09-02 Thread Raymond Nijssen
Just discovered similar unexpected rounding behavior, but a bit 
different I think:



My expression is this one, to show lengths of tracks on my map, in km:

"etappe" || '\n (' || 
round((length(transform($geometry,'epsg:4326','epsg:31466'))/1000), 1) 
|| ' km)'



The rounding does actually work fine, but it seems the conversion from 
my rounded value to a string is the problem.


Here some examples (qgis 3.3):

round(0.99, 1) --> 1
round(1.00, 1) --> 1
round(1.01, 1) --> 1
round(1.02, 1) --> 1
round(1.03, 1) --> 1
round(1.04, 1) --> 1
round(1.05, 1) --> 1.1001
round(1.06, 1) --> 1.1001
round(1.07, 1) --> 1.1001
round(1.08, 1) --> 1.1001
round(1.09, 1) --> 1.1001
round(1.10, 1) --> 1.1001
round(1.11, 1) --> 1.1001
round(1.12, 1) --> 1.1001
round(1.13, 1) --> 1.1001
round(1.14, 1) --> 1.1001
round(1.15, 1) --> 1.2
round(1.16, 1) --> 1.2
round(1.17, 1) --> 1.2
round(1.18, 1) --> 1.2
round(1.19, 1) --> 1.2
round(1.20, 1) --> 1.2
round(1.19, 1) --> 1.2


The same works fine in 2.18.16.

Should I file a bug?

Kind regards,
Raymond



On 22-12-17 13:13, matteo wrote:

Hi Andreas,

thanks for the testing. I'm suspecting that something is weird with my
data

thanks and sorry for the noise!

Cheers

Matteo
___
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] Geometry data model logic?

2018-08-22 Thread Raymond Nijssen



On 22-08-18 14:51, Denis Rouzaud wrote:

Hi Raymond,

Le mer. 22 août 2018 à 15:30, Raymond Nijssen <mailto:r.nijs...@terglobo.nl>> a écrit :


Hopefully it is just a misconception on my side, but I really don't get
the logic in the qgis geometry data model.

I tried the following script (sorry, some lines are wrapped by my email
client):

---

#points

p1 = QgsGeometry().fromWkt('point(0 0)')
print(p1) # 
print(p1.asPoint()) # 
print(p1.centroid()) # 
print(p1.buffer(1, 1)) # 

p2 = QgsPoint(1,2)
print(p2) # 
p2g = QgsGeometry(p2)
print(p2g) # 
print(p2) # 
print(p2.centroid()) # 
print(QgsPointXY(p2.x(), p2.y())) # 
# The next line makes qgis crash after running it 2x !!
#print(QgsGeometry(p2)) # 

p3 = QgsPointXY(2, 0)
print(p3) # 
print(QgsGeometry.fromPointXY(p3)) # 
print(QgsPoint(p3.x(), p3.y())) # 

# lines

l1 = QgsGeometry().fromWkt('linestring((0 0, 1 1, 1 2))')
print(l1) # 
print(l1.buffer(1, 1).asPolygon())
print(l1.asPolyline()) # [, , ]
print(QgsLineString(l1.asPolyline())) # TypeError: index 0 has type
'QgsPointXY' but 'QgsPoint' is expected


---

My questions are:

- How is the relation between QgsGeometry, QgsPoint, QgsPoitXY, etc
meant to be? Is there documentation? Maybe even a schema?


QgsGeometry contains a QgsAbstractGeometry which is the base class of 
all geometry classes.

You can get the abstract geometry using get and constGet methods.

The documentation partially mentions this
https://qgis.org/pyqgis/master/core/Geometry/QgsGeometry.html


- Having QgsPoint and QgsPointXY etc is not handy, but I understand
they
are necessary for efficiency reasons. However, shouldn't they all have
easy typecasting functions? For example:
QgsGeometry.asPoint()
QgsGeometry.asPointXY()
QgsGeometry.asLineString()
QgsGeometry.asLineStringXY()
QgsGeometry.asPolygon()
QgsGeometry.asPolygonXY()
QgsGeometry.asMultiLineString()
QgsGeometry.asMultiLineStringXY()
etc..

QgsPoint.asGeometry()
QgsPoint.asPointXY()

QgsLineString.asGeometry()
QgsLineString.asPointXY()

etc..


I was also asking my self the same thing.
I am not really sure if there is a reason or not that they were not 
implemented.
The main issue to me is the difficulty to get the geometries as points 
with their Z/M values.

The workaround I am using is looping along vertices using

geometry.get()->nextVertex( vertexId, pt );

You will the list of QgsPoint with Z/M values.


- Why don't all geometry types inherit from QgsGeometry, making all the
geometry operators work? For example:
QgsPoint(1,2).buffer(3,5)


as said before, all geometry classes inherit from QgsAbstractGeometry. 
You can use set method (setGeometry in 2.x) on QgsGeometry to create the 
geometry from the any subclass of abstract geometry.






Some, IMHO, really odd things are:

- QgsGeometry.asPoint() returns a QgsPointXY


I guess that's historical (QgsPoint in 2.x became QgsPointXY in 3, while 
QgsPointZ became QgsPoint).



- QgsGeometry.asLineString() does not exist

- QgsGeometry.asPolyLine() returns an array of QgsPointXY's (besides,
polyline is a strange geometry type in this model)

- QgsLineString([qgsPointXY, qgsPointXY, qgsPointXY, ...]) results
in an
error, while the documentation states:
     QgsLineString(points: Iterable[QgsPointXY]) Construct a linestring
     from list of points. This constructor is more efficient then
calling
     setPoints() or repeatedly calling addVertex()


ls = QgsLineString([QgsPoint(10, 2), QgsPoint(10, 1), QgsPoint(5, 1)])

this does work for me (and for Travis ;) )


True, but the docs say these should be QgsPointXY's, not QgsPoint's. So 
maybe the docs are wrong here, but still this is annoying because 
asPolyLine() returns a list of QgsPointXY's. Only writing your own loop 
can convert those.





- QgsGeometry(QgsPoint) does work, but destroys my QgsPoint (and makes
qgis instable)


look at QgsGeometry::set method


Thanks, I got this working:


pg1 = QgsGeometry().fromWkt('polygon((0 0, 0 1, 1 1, 1 0, 0 0))')
print(pg1) # 

pg2 = pg1.get()
print(pg2) # 

g = QgsGeometry()
g.set(pg2)
print(g) # 


So, now I can convert both ways between QgsGeometry and 
QgsPoint/QgsLineString/QgsPolygon. But this script makes qgis crash 
after running it 2 times. It has to do with the set() method. This could 
also be a bug of course. Should I file it?







Hopefully somebody can explain, making this more sense to me. And I'd
like to contribute to improving this, though I'm not a cpp programmer.


This is indeed a bit obscure at first and it took me a bit of time to 
see the logic here.


The gurus might arrive with a more precise explanation but I hope it's a 
good start!


Still waiting for the guru's! :)


Best wishes,
Denis
--

Deni

Re: [QGIS-Developer] [Plugin] Add help html documentation

2018-08-22 Thread Raymond Nijssen

Hi Joao,

I used it in a qgis2 plugin:


# import it:

from qgis.utils import showPluginHelp



# create help function

def showHelp(self):
"""Reacts on help button"""
showPluginHelp(filename = 'help/index')


# connect it to some button (here in the old way):

QObject.connect(self.dlg.help_pushButton, SIGNAL("clicked()"), 
self.showHelp)




It is here:
https://github.com/opengeogroep/AERIUS-QGIS-plugins/blob/master/ImaerReader/imaer_reader.py

Regards,
Raymond



On 22-08-18 14:51, João Gaspar wrote:

Hi devs,
I'm using the sphinx to help documentation to a plugin. I saw in QGIS 
documentation that we can add documentation using the function 
showPluginHelp().


Where i can put the function showPluginHelp() in the plugin.py file?

Regards


___
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



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
The Netherlands
+31 (0) 6 25 31 49 83
___
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] Geometry data model logic?

2018-08-22 Thread Raymond Nijssen
Hopefully it is just a misconception on my side, but I really don't get 
the logic in the qgis geometry data model.


I tried the following script (sorry, some lines are wrapped by my email 
client):


---

#points

p1 = QgsGeometry().fromWkt('point(0 0)')
print(p1) # 
print(p1.asPoint()) # 
print(p1.centroid()) # 
print(p1.buffer(1, 1)) # 0))>


p2 = QgsPoint(1,2)
print(p2) # 
p2g = QgsGeometry(p2)
print(p2g) # 
print(p2) # 
print(p2.centroid()) # 
print(QgsPointXY(p2.x(), p2.y())) # 
# The next line makes qgis crash after running it 2x !!
#print(QgsGeometry(p2)) # 

p3 = QgsPointXY(2, 0)
print(p3) # 
print(QgsGeometry.fromPointXY(p3)) # 
print(QgsPoint(p3.x(), p3.y())) # 

# lines

l1 = QgsGeometry().fromWkt('linestring((0 0, 1 1, 1 2))')
print(l1) # 
print(l1.buffer(1, 1).asPolygon())
print(l1.asPolyline()) # [, 1)>, ]
print(QgsLineString(l1.asPolyline())) # TypeError: index 0 has type 
'QgsPointXY' but 'QgsPoint' is expected



---

My questions are:

- How is the relation between QgsGeometry, QgsPoint, QgsPoitXY, etc 
meant to be? Is there documentation? Maybe even a schema?


- Having QgsPoint and QgsPointXY etc is not handy, but I understand they 
are necessary for efficiency reasons. However, shouldn't they all have 
easy typecasting functions? For example:

QgsGeometry.asPoint()
QgsGeometry.asPointXY()
QgsGeometry.asLineString()
QgsGeometry.asLineStringXY()
QgsGeometry.asPolygon()
QgsGeometry.asPolygonXY()
QgsGeometry.asMultiLineString()
QgsGeometry.asMultiLineStringXY()
etc..

QgsPoint.asGeometry()
QgsPoint.asPointXY()

QgsLineString.asGeometry()
QgsLineString.asPointXY()

etc..

- Why don't all geometry types inherit from QgsGeometry, making all the 
geometry operators work? For example:

QgsPoint(1,2).buffer(3,5)




Some, IMHO, really odd things are:

- QgsGeometry.asPoint() returns a QgsPointXY

- QgsGeometry.asLineString() does not exist

- QgsGeometry.asPolyLine() returns an array of QgsPointXY's (besides, 
polyline is a strange geometry type in this model)


- QgsLineString([qgsPointXY, qgsPointXY, qgsPointXY, ...]) results in an 
error, while the documentation states:

   QgsLineString(points: Iterable[QgsPointXY]) Construct a linestring
   from list of points. This constructor is more efficient then calling
   setPoints() or repeatedly calling addVertex()

- QgsGeometry(QgsPoint) does work, but destroys my QgsPoint (and makes 
qgis instable)




Hopefully somebody can explain, making this more sense to me. And I'd 
like to contribute to improving this, though I'm not a cpp programmer.


Regards,
Raymond
___
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] set data defined override expression with python?

2018-08-22 Thread Raymond Nijssen
Thank you Nyall! Does exactly what I need. Will add it to the python 
cookbook.


Raymond



On 22-08-18 00:10, Nyall Dawson wrote:

On Wed, 22 Aug 2018 at 01:41, Raymond Nijssen  wrote:


Hi devs!

I'd like my python plugin to set an expression for overriding a property
and I have no clue how to do so. I expect there must be some generic way
to set expressions.

Specifically, I want to set the expression for the "Image source" of a
QgsLayoutItemPicture to:

'/path/to/pictures/' || attribute(@atlas_feature, 'ID') || '.svg'



Try

 property = QgsProperty.fromExpression( "'/path/to/pictures/' ||
attribute(@atlas_feature, 'ID') || '.svg'")
 item.dataDefinedProperties().setProperty(QgsLayoutObject.PictureSource,
property)

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

[QGIS-Developer] set data defined override expression with python?

2018-08-21 Thread Raymond Nijssen

Hi devs!

I'd like my python plugin to set an expression for overriding a property 
and I have no clue how to do so. I expect there must be some generic way 
to set expressions.


Specifically, I want to set the expression for the "Image source" of a 
QgsLayoutItemPicture to:


'/path/to/pictures/' || attribute(@atlas_feature, 'ID') || '.svg'

Hope anyone can explain.

Thanks!
Raymond

___
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] outdated cookbook

2018-07-09 Thread Raymond Nijssen

Thanks Jurgen!

That kind of works for my current problem (though it seems hard to loop 
this function and export different maps after updating the mapcanvas).


Still I would like to fix this in the cookbook using the 
QgsMapRenderer(Sequential)Job in the right way. So if anyone could post 
a working example??


Thanks!
Raymond



On 05-07-18 18:17, Jürgen E. Fischer wrote:

Hi Raymond,

On Thu, 05. Jul 2018 at 16:53:21 +0200, Raymond Nijssen wrote:

Can anyone provide a working example for exporting maps to png files?


Probably not a nice example for the cookbook, but this does the job and even
works alike on 2 and 3 (essentially what QgisApp::saveAsImage does):

c = iface.mapCanvas()
pm = QPixmap(c.width(), c.height())
c.saveAsImage("/tmp/foo.png", pm)


Jürgen



___
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] outdated cookbook

2018-07-05 Thread Raymond Nijssen

Hi all,

I'm working on a qgis3 plugin, and want it to export my map as a png 
image. According to the cookbook it should go like this:


https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/composer.html#simple-rendering

But QgsMapRenderer has been removed in v3, so I will need other code for 
this. I have been trying all kinds of stuff, using QgsMapRendererJob and 
QgsMapRendererSequentialJob but I cannot get it to work.

Even worse, qgis crashes all the time while I'm trial-and-erroring this.

Can anyone provide a working example for exporting maps to png files?

I'd be happy to work on updating the cookbook, for example during the 
Foss4g Europe code sprint in 2 weeks. But I will need some input from 
the people knowing the new object model.


Kind regards,
Raymond
___
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] issues with 1:n relations

2018-04-17 Thread Raymond Nijssen

Hi Giovanni,

Not sure what you exactly did, I wasn't even aware of QGIS being able 
doing any 1:n relations.


But a few months ago I had to do a more complex 1:n relation, including 
adding some fields. I solved it by using a virtual layer. The 
description is here:


http://www.qgis.nl/2018/02/16/english-diagrams-for-features/?lang=en

Maybe it could help you. Or maybe you know an easier way for doing this? 
Btw, I would normally do this using PostGIS but this was a question from 
a customer.


Ciao,
Raymond


On 17-04-18 18:23, Giovanni Manghi wrote:

Hi all,

I have recently had to test some scenario with 1:n relations in QGIS and 
I have found a few issues and would like to know if someone has them in 
its pipeline/todo list, eventually to share the effort for the fixes.


Anyway I'm also interested on your feedback on the matter.

1) 1:n relations in QGIS3. They seems unusable at the moment. When 
opening a parent layer feature form, the area/space where the child 
records should show does not show/cannot be expanded.



2) 1:n relations in QGIS 2.18.

I have tried a scenario (that to me seems not unusual at all) where both 
the parent and the child are layers/tables with a geometry.


The case where the child has its own geometries does not seems well 
implemented (if implemented at all) in the context of the relation 
feature form and this causes the following:


a) from within the parent feature form, if I edit the child and try add 
a new record there is no tool to allow also add/digitize the proper 
geometry. The user can still enter only the attributes and when saving I 
have seen two things happen *) In a test project using GPKGs this led 
effectively to a record orphaned of its geometry *) In a test project 
using PostGIS layers the edits are *silently* discarded, no warning, no 
error, not even in QGIS logs.


b) from within the parent feature form, when toggling editing for the 
child, this is effectively put it in edit state also in the layers 
panel. So a user can "move away" the parent feature form (that it is on 
first plane) and use the standard editing tools to add a geometry to the 
child layer. When finished the attributes form pop-up and can be used to 
fill the data, with the important issue/limitation that the "referencing 
field" is *not* automatically filled as it is done when working within 
the relation form. Once saved the new record will also show in the 
relation form. This seems a partial workaround because as said the 
referencing field is not automatically filled.


Am I missing something?

thanks in advance for your feedback.

cheers

-- Giovanni --




___
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



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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 Annual General Meeting - 2018

2018-04-11 Thread Raymond Nijssen
Thank you so much for all your efforts Tim! And Paolo and Marco, 
congratulations with your new PSC jobs, and good luck of course! And to 
all PSC members, nice having you around for another 2 years!


Regards,
Raymond


On 11-04-18 01:09, Tim Sutton wrote:

Dear QGIS Community

We recently held our 2018 QGIS Annual General Meeting. The minutes of 
this meeting are available [1] for all to view.


As I have previously announced, I have decided  to step down as chair of 
the PSC this year, so this email is my last official act as QGIS Chair. 
Thank you all for the kind words and deeds of support you gave me during 
my time as project chair. I would like to welcome our new QGIS Board 
Chair: Paolo Cavallini, and our new QGIS Board Vice-Chair and QGIS PSC 
Member, Marco Bernasocchi. In case you are not familiar with Paolo and 
Marco, you can find short introductions to them below. I am pleased also 
to say that the project governance is in good hands with Richard 
Duivenvoorde, Jürgen Fischer, Andreas Neumann and Anita Graser kindly 
making themselves available to serve on the PSC for another two years. 
It is also great to know that our project founder, Gary Sherman, 
continues to serve on the PSC as honorary PSC member. Gary set the 
standard for our great project culture and it is great to have his 
continued presence. QGIS has been growing from strength to strength, 
backed by a really amazing community of kind and collaborative users, 
developers, contributors and funders. I am looking forward to seeing how 
it continues to grow and flourish and I am excited and confident it will 
do so with Paolo acting as the project chair and representative. Rock on 
QGIS!


—

Paolo Cavallini:

I got involved in QGIS long ago, first as an user, then more and more 
deeply in various activities, initiating and supporting various plugins 
and core functions (e.g. GDAL Tools, DB Manager), opening and managing 
bugs, taking care of GRASS modules, handling the trademark registration, 
etc . I acted as Finance and Marketing Advisor for several years. 
Currently I manage the plugin approval process.


Motivation: It's such a pleasure building up, in a truly cooperative and 
democratic way, together with truly intelligent people, a tool that 
enables people to freely do their job or pursue their interests, that I 
cannot resist helping as much as I can.


—


Marco Bernasocchi (http://berna.io @mbernasocchi)

I am an open source advocate, consultant, teacher and developer. My 
background is in geography with a specialization in geographic 
information science. I live in Switzerland in a small Romansh speaking 
mountain village where I love scrambling around the mountains to enjoy 
the feeling of freedom it gives me. I’m a very communicative person, I 
fluently speak Italian, German, French English and Spanish and love 
travelling.


I work as director of OPENGIS.ch  which I founded in 
2011. Since 2015 I share the company ownership with Matthias Kuhn. At 
OPENGIS.ch  LLC we (4 superstar devs and myself) 
develop, train and consult our client on any aspect related to QGIS.


My first QGIS (to be correct for that time QuantumGIS) ever was “Simon 
(0.6)” during my BSc when the University of Zurich was teaching us 
propriertary products and I started looking around for Open 
Source alternatives. In 2008, when starting my MSc, I made the 
definitive switch to ubuntu and I started working more and more with 
QGIS Metis (0.11) and ended developing some plugins and part of Globe as 
my Masters thesis. Since three years the University of Zurich invites me 
to hold two seminars on Entrepreneurship and Open Source. In 
November 2011 I attended my first Hackfest in Zürich where I started 
porting all QGIS dependencies and developing QGIS for Android under a 
Google Summer of Code. A couple of years and a lot of work later QField 
was born. Since then I’ve always tried to attend at least to one 
Hackfest per year to be able to feel first hand the strong bonds within 
our very welcoming community.


In 2013 i was lucky enough to have a release named after a suggestion I 
saved you all from having QGIS 2.0 - Hönggerberg and giving you instead 
QGIS 2.0 - Dufour


Beside my long story with QGIS as user and passionate advocate I have a 
long story as QGIS service provider where we are fully committed to its 
stability, feature richness and sustainable development. Furthermore, as 
WorldBank consultant I am lucky enough to be sent now and then to spread 
the QGIS goodness in less fortunate countries.


Motivation:

One of my main motivation to be part of the PSC is to help QGIS keep 
this incredible growth rate by being even more attractive to new 
community members, sponsors and large/corporate users. To achieve 
this, key is maintaining the right balance between sustainable 
processes (that guarantee the great quality QGIS has been known for) and 
an interesting and motivating grassroot 

Re: [QGIS-Developer] Split parts tool creates invalid polygons

2018-02-13 Thread Raymond Nijssen

Hi Anita,

Tried what you said but cannot reproduce it. This might depend a lot on 
what shape you draw and how/where you cut it. What does your validation 
error say?


I got this:


Processing algorithm...
Algorithm 'Check validity' starting...
Input parameters:
{ 'INVALID_OUTPUT' : 'memory:', 'VALID_OUTPUT' : 'memory:', 
'INPUT_LAYER' : 
'MultiPolygon?crs=EPSG:4326={03c00bda-6d88-43b9-99cd-504f439fcfb5}', 
'ERROR_OUTPUT' : 'memory:', 'METHOD' : 2 }


Execution completed in 0.12 seconds
Results:
{'ERROR_COUNT': 0, 'ERROR_OUTPUT': 
'output_d1f8c9fc_61da_455a_afe3_a5e4692bef9d', 'INVALID_COUNT': 0, 
'INVALID_OUTPUT': 'output_67acdd34_cf81_4515_8088_ba5b03820c57', 
'VALID_COUNT': 1, 'VALID_OUTPUT': 
'output_a11e2f0a_cfa8_46a2_9336_b206765f1890'}


Loading resulting layers
Algorithm 'Check validity' finished



Regards,
Raymond



On 13-02-18 21:50, Nyall Dawson wrote:

On 14 February 2018 at 06:44, Anita Graser  wrote:

Hi,

The split parts tool creates invalid polygons according to GEOS check
validity. This issue seems to have been discussed two years ago
https://issues.qgis.org/issues/12799 but it still persists today in master.

To reproduce:
1. Create a memory layer with multipolygon type
2. Add a polygon
3. Split the polygon using split parts
4. Use the vertex tool to move the parts apart, in order to avoid issues
with polygon parts sharing an edge or vertex
5. Run check validity



Can you please share before/after WKT for the geometries?

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



___
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] Broken 'randomness' for new layer styles?

2018-02-03 Thread Raymond Nijssen

Hi Nyall,

Great idea to improve those random colors! This could also be a function 
instead of a palette in my opinion. I even guess it already is, since I 
think qgis stopped using very dark random colors a while ago.


I think those colors should be:
- not too dark (too close to black)
- not too close to grey
- not bright yellow, since this is the selection color

Another thought here, for polygons I find myself changing the standard 
black outline to a darker and opaque version of the fill color. And 
often I prefer using a transparent fill color cause it makes it much 
easier to viewing results on the background map. Could this be the 
default or an option?


Or should I just wait for qgis 3.2 and add create a palette for this? :)

Regards,
Raymond


On 03-02-18 05:17, Nyall Dawson wrote:

On 2 February 2018 at 21:52, Richard Duivenvoorde  wrote:

Somebody (Raymond ;-) ) 'complained' to me that running a processing
algorithm everytime comes up with an (ugly) brown style.


I've noticed this too - but had assumed it was just some setting I'd
changed locally. It's fixed by https://github.com/qgis/QGIS/pull/6254

BUT

Coincidentally, Mathieu and I have been speaking this week about
approaches to improve the random colors picked for layers. We came up
with a similar approach:

- find a palette of ~100 colors which we think look good for layers,
and remove gross colors from this
- include this palette as an additional pre-installed color palette
within the standard QGIS install
- on startup, pick a random starting color from this list and a random
direction (forward or backward). When adding layers, grab this color
for the layer and then jump to the next/previous color in the preset
palette for the next layer added.
- (for 3.2 : allow users to pick which palette to use for new layer colors)

How's this sound? I'd love to address this for 3.0 - our default
random color selection often picks yuck colors, and I think it'd be
great if 3.0 "magically" produced nicer looking maps for users without
any work required by them!

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



___
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] postgis connection to server instead of individual databases?

2018-01-27 Thread Raymond Nijssen

Dear developers,

Today I suddenly wondered: Why can pgAdmin have a connection to a 
database *server* and automatically list all databases that are present 
while in QGIS I need to create a new connection for every individual 
postgresql/postgis database?


It would be very handy if QGIS could remember, for example, my 
localhost-postgres:postgres connection and update the available 
databases for me.


Would that be possible? (Or is it but am I doing something wrong here?)

Kind regards,
Raymond
___
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] Thanks!

2017-12-28 Thread Raymond Nijssen

+1 <3

Totally agree!!

Raymond


On 27-12-17 14:00, Denis Rouzaud wrote:

Hi Guys,

Yeah, let's throw flowers to ourselves :)
This is indeed awesome to be part of this community and to meet 
regularly at the hackfests!


Thank you all!

Denis

Le mer. 27 déc. 2017 à 08:40, Luiz Motta > a écrit :


Hi Guys,

Recently, I received the issue about Catalog Planet Labs Plugin, and
I after fixed, the message of user[1] had the phrase:
"It makes my life much easier"

YES, the QGIS is making the life os people around the world "easier".

This year is ending, then, I desire for you a new year "easier" for you.

Cheers,
Luiz


[1] https://github.com/lmotta/catalogpl_plugin/issues/1


2017-12-27 7:56 GMT-02:00 Paolo Cavallini >:

Il 27/12/2017 10:41, Andreas Neumann ha scritto:
> Hi,
>
> I can only second Matthias' statements! It is a pleasure to work with
> the QGIS community!

true - in my experience, the best (most productive and pleasant)
community I've met.
All the best, and long life QGIS!

--
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 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 Meeting #20 : 20-25 February 2018, Madeira

2017-12-10 Thread Raymond Nijssen
Last month I did an osgeo.nl presentation "QGIS behind the scenes" to 
show people how the organisation is set up and how they can (and 
should!) help.


I would not mind giving it at Madeira as an introduction to our new 
attendants.


It is here (in dutch):

https://github.com/osgeonl/osgeonl.github.io/blob/master/sitecontent/osgeonl_dag/presentaties/2017/01-Nijssen_QGIS_community.pdf

Regards,
Raymond



On 29-10-17 23:08, Tim Sutton wrote:

Hi All

We have a confirmed venue for the next QGIS get together - it is in 
Madeira from the 20-25 February 2018. If you plan on attending please 
head over to the wiki page and register your intention to be there:


https://github.com/qgis/QGIS/wiki/DeveloperMeetingMadeira2018

Please also note that this time we are going to try to be a little more 
organised for helping newcomers, so I have added sections to the wiki 
page for ‘Mentor streams’ - I have nominally added 4 streams but if you 
would like to host more please add a new section to the wiki page. If 
you are interested in attending one of the streams, please add your name 
to the appropriate section.


Lene will no doubt provide you with more details (via the wiki)  as we 
get closer to the event as will Duarte and Sara (our local organisers in 
Madeira).


Another important thing to note is that the cost of attending will be 
higher than usual given the more removed location and that we do not 
have very cheap accommodation available. If you intend on requesting 
travel assistance for the event, please fill out our new form 
 as soon as possible. Also be 
aware that funds are limited so we may not be able to cover everyone’s 
costs or all costs completely - applications will be taken on merit with 
priority given to active contributors to the QGIS project.


Looking forward to seeing you all in Madeira!

Regards






---

*Tim Sutton*
QGIS Project Steering Committee Chair
t...@qgis.org 






___
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



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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] Clear log messages panel?

2017-12-06 Thread Raymond Nijssen

Ah, thanks Jurgen! I thought I found the opposite yesterday..

Still a clear button would be cooler, but I can live with workaround. :)

Thank you all,
Raymond



On 06-12-17 12:08, Etienne Trimaille wrote:
I can confirm. If I close one tab, it will come back empty when new 
messages are coming.


2017-12-06 11:50 GMT+01:00 Jürgen E. Fischer >:


Hi,

On Wed, 06. Dec 2017 at 03:38:50 -0700, Tom Chadwin wrote:
> Another big +1 from me. The log is hard to read as it is, so clearing 
before
> an expected message would help a great deal.

You can close any tab - except for the last left - and it'll
reappear clean
once another message arrives.

Closing the last would leave the widget in an unusable state - maybe
instead of
preventing to close the last, we should make close clean it.


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-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] Clear log messages panel?

2017-12-05 Thread Raymond Nijssen
Is there a way to erase all messages from a Log Messages Panel? I tried 
closing it, but when it reopens with a new message, all old ones are 
still visible.


Also, a little 'clear' button would be nice, maybe in a right click on 
the panel?


Thanks!
Raymond
___
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 Meeting #20 : 20-25 February 2018, Madeira

2017-11-01 Thread Raymond Nijssen
Just found out that booking a one week tourist holiday to Madeira is 
cheaper than booking rooms and flights seperately. And for me it also 
resulted in having a direct charter flight.


Hope to see you soon,
Raymond



On 29-10-17 23:08, Tim Sutton wrote:

Hi All

We have a confirmed venue for the next QGIS get together - it is in 
Madeira from the 20-25 February 2018. If you plan on attending please 
head over to the wiki page and register your intention to be there:


https://github.com/qgis/QGIS/wiki/DeveloperMeetingMadeira2018

Please also note that this time we are going to try to be a little more 
organised for helping newcomers, so I have added sections to the wiki 
page for ‘Mentor streams’ - I have nominally added 4 streams but if you 
would like to host more please add a new section to the wiki page. If 
you are interested in attending one of the streams, please add your name 
to the appropriate section.


Lene will no doubt provide you with more details (via the wiki)  as we 
get closer to the event as will Duarte and Sara (our local organisers in 
Madeira).


Another important thing to note is that the cost of attending will be 
higher than usual given the more removed location and that we do not 
have very cheap accommodation available. If you intend on requesting 
travel assistance for the event, please fill out our new form 
 as soon as possible. Also be 
aware that funds are limited so we may not be able to cover everyone’s 
costs or all costs completely - applications will be taken on merit with 
priority given to active contributors to the QGIS project.


Looking forward to seeing you all in Madeira!

Regards






---

*Tim Sutton*
QGIS Project Steering Committee Chair
t...@qgis.org 






___
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] Possible discussion during hackfest?

2017-08-02 Thread Raymond Nijssen



On 01-08-17 12:45, Paolo Cavallini wrote:
Il 1 agosto 2017 11:56:24 CEST, Nyall Dawson  ha 
scritto:


Hey all,

I'm wondering if it's possible for us to block aside some time during
the upcoming hackfest for a group discussion about the future of QGIS.

In the previous hackfests I've attended there's been excellent
presentations showing off what individual organisations (and
individuals themselves) are working on for future inclusion in the
QGIS ecosystem, and I'm very much looking forward to seeing these
again this weekend. But apart from some targeted discussions (such as
making plans for qt5/python 3/qgis 3/issue tracker) I haven't been
aware of any larger discussion amongst all these interested parties
about the general "future direction" of the project.

Specifically - I'd LOVE for us to set aside some time for all these
invested parties to be able to discuss what we see as weaknesses in
QGIS and possible threats to its future success as a project. And
obviously, make some collaborative plans together about what we can do
to address these weakness (and smash down any threats to our world
dominance with lava powered mega super lasers ;) ).

Would anyone else find this valuable? For me, setting aside 30-60 mins
for SWOT Analysis on QGIS' future amongst all these organisations and
individuals who are financially/emotionally invested in the project
would alone make my trip to the hackfest worthwhile :)

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


+1!
--
Sent from mobile. Sorry for being short


___
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



+1

Raymond
___
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] PyQGIS: Convert 25 meters to layer crs?

2017-05-28 Thread Raymond Nijssen

Hi Magnus,

As I understand you are writing a script that should perform a 25m 
buffer on any user layer?


I think you should never buffer unprojected layers. So blocking the 
process and telling the user to transform the data to an appropriate 
projection would be best in my opinion.


If you really want your script to be user friendly, you could find the 
most suitable utm zone for the dataset, project, buffer and reproject.


Good luck,
Raymond

BTW, at the equator 25m is about 0.000225 degrees, because 360 degrees / 
40.000.000 meters * 25.

But I did not tell you this. ;)



On 28-05-17 14:07, Magnus Homann wrote:
What's a good way to convert 25 meters (for example) to layer 
coordinates? I want to create a buffer of 25 meters on my geometries, 
and handle the case when they layer is in wgs84.


/Magnus
___
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-developer] [resolved] Qt4 asked when compiling current master

2017-05-15 Thread Raymond Nijssen

Thanks Pierre, I just ran into the same.

Should qt4-linguist-tools be added to the dependency list?

https://htmlpreview.github.io/?https://github.com/qgis/QGIS/blob/master/doc/INSTALL.html#toc6

Raymond



On 21-03-17 21:48, Pierre_Loicq wrote:

Pierre_Loicq wrote

Hello,

I am trying to compile current master on ubuntu 16.04. I have this error:

[ 99%] Generating ../output/i18n/qgis_bg.qm
lrelease: could not exec '/usr/lib/i386-linux-gnu/qt4/bin/lrelease': No
such file or directory
lrelease: could not exec '/usr/lib/i386-linux-gnu/qt4/bin/lrelease': No
such file or directory
i18n/CMakeFiles/translations.dir/build.make:97 : la recette pour la cible
« output/i18n/qgis_ar.qm » a échouée
make[2]: *** [output/i18n/qgis_ar.qm] Erreur 1
make[2]: *** Attente des tâches non terminées
i18n/CMakeFiles/translations.dir/build.make:101 : la recette pour la cible
« output/i18n/qgis_bg.qm » a échouée
make[2]: *** [output/i18n/qgis_bg.qm] Erreur 1
CMakeFiles/Makefile2:3686 : la recette pour la cible
« i18n/CMakeFiles/translations.dir/all » a échouée
make[1]: *** [i18n/CMakeFiles/translations.dir/all] Erreur 2
make[1]: *** Attente des tâches non terminées
[ 99%] Built target zzz-db_manager-5-depend
Makefile:160 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2

I don't know why Qt4 is asked here. ccmake configuration only talks about
Qt5

Thank you
Pierre


Resolved ! I used apt-file to know which package I had to install:
qt4-linguist-tools





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Qt4-asked-when-compiling-current-master-tp5310808p5313502.html
Sent from the QGIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



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

Re: [QGIS-Developer] Converting plugins to QGIS 3

2017-05-10 Thread Raymond Nijssen

Hi Calvin,

Here are some thoughts on python imports:

https://www.python.org/dev/peps/pep-0008/#imports

The last paragraph is about using wildcards.

Raymond

On 10-05-17 20:03, C Hamilton wrote:

I am wondering how important it is to import the modules separately.
Such as:

from qgis.core import QGis, QgsCoordinateTransform, QgsRectangle,
QgsPoint, QgsGeometry

Does it really make a difference? I am finding that you have to make
sure every part of your code is exercised so that nothing was missed. By
doing the above there is more of a chance to have a bug. Perhaps for
PyQt4.QtGui it makes sense, but there is less chance to have a python
error if you keep.

from qgis.core import *
from PyQt4.QtGui import *
from qgis.gui import *

Thoughts?

Thanks,

Calvin



On Wed, May 10, 2017 at 12:00 PM, Luigi Pirelli > wrote:

this is a slide about plugin porting I'll be presenting to the next
spanish foss4g:
http://slides.com/luigipirelli/desdarrolloplugindeqgis-xi-girona#/17

sorry it's in spanish

about

from PyQt4 import QtGui

or

from PyQt4.QtGui import QDialog

I would prefer the second so to avoid to postpone lib version errors
at pyc time and not at runtime.
it make it simpler to mock or alias a class globally if you need

regards
Luigi Pirelli


**
* Boundless QGIS Support/Development: lpirelli AT boundlessgeo DOT com
* LinkedIn: https://www.linkedin.com/in/luigipirelli

* Stackexchange:
http://gis.stackexchange.com/users/19667/luigi-pirelli

* GitHub: https://github.com/luipir
* Mastering QGIS 2nd Edition:
*

https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition



**



___
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] Plugin with custom QGIS-Qt Widget for master

2017-03-05 Thread Raymond Nijssen

Hi Matteo,

I ran into this last week. The solution, or workaround, is here:

https://lists.osgeo.org/pipermail/qgis-developer/2016-August/044138.html

You need to manually change the output of QtDesigner.

Good luck!
Raymond



On 06-03-17 07:07, Denis Rouzaud wrote:


Hi Matteo,

Are you using a compiled UI file or the UI directly?
Can you point to the source online?

Denis


Le dim. 5 mars 2017 à 22:35, matteo > a écrit :

sorry, the error related to the widget is:

  File
"/home/matteo/lavori/QGIS/build-qgis33/output/python/qgis/utils.py",
line 647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named 'qgsmaplayercombobox'

Matteo
___
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



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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] Processing params always n meters?

2017-03-05 Thread Raymond Nijssen

Hi Paolo,

I've been thinking of this as well and I would love it! I hate ending up 
with a huge circle on my screen after performing a quick "look how easy 
qgis processing is!" 500 degrees buffer on my data. :)


The problem is that you cannot convert degrees to meters so easily since 
they depend on the location on earth. I'm sure you know.


So even for smaller areas, for example my house in the Netherlands, 
there would already be a 1 : 1.5  difference between lat:lon. Pretty 
hard to tell the buffer function.


On smaller scales, for example a country map of Chile, there would also 
be big differences in the distances on the north and south sides of the 
country.


So I would say, don't do it! I'm afraid this is the reason for being 
stuck with all these map projections in geography.


Still, qgis could improve on this I think:

1. Automatically reproject the data to the appropriate CRS (?), perform 
the analysis, and reproject back. UTM could be used for it, hoping all 
data is in a single zone.


2. Showing the CRS units in the analysis dialog, maybe even in 
red/italic/bold when these are degrees.


I'd vote for option 2 here, since I like to know what happened to my 
data. Buffers performed in different (overlapping) CRS's won't be exact 
the same.


Regards,
Raymond

Btw, here is a nice example story about this:
https://miamigeographic.com/2014/07/22/into-perspective-miami-world-city-distances/




On 05-03-17 08:15, Paolo Cavallini wrote:

Hi all,
when analyses are done on degrees CRS, often parameters are difficult to
use (e.g. buffer width in degrees is not easy to calculate). The usual
strategy is to convert layers first to a metric CRS.
Would it make sense to always input params as meters, and reproject the
parameters as appropriate? This would be far easier for the user.
All the best.




___
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] map scale as a variable in map composer? (html label)

2017-03-04 Thread Raymond Nijssen

Thanks Harrissou, that is good news!

Regards,
Raymond


On 03-03-17 16:38, DelazJ wrote:

Hi Raymond,

It'll be possible with 3.0 (see
https://github.com/qgis/QGIS/commit/f2032ea2688715163a631cc0860b9e5f97257cfc)

Regards,
Harrissou

2017-03-03 9:22 GMT+01:00 Raymond Nijssen <r.nijs...@terglobo.nl
<mailto:r.nijs...@terglobo.nl>>:

Is it possible to get the map scale as a variabele in the map
composer? I guess not, according to no replies on this:


http://gis.stackexchange.com/questions/133045/integrating-numeric-scales-into-a-text-or-html-box-in-qgis-print-composer

<http://gis.stackexchange.com/questions/133045/integrating-numeric-scales-into-a-text-or-html-box-in-qgis-print-composer>

Could it be added if it is not there yet? I'm afraid it is not too
easy because there can be multiple maps in a composer.

Tnx!
Raymond

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org <mailto:Qgis-developer@lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>




--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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] map scale as a variable in map composer? (html label)

2017-03-03 Thread Raymond Nijssen
Is it possible to get the map scale as a variabele in the map composer? 
I guess not, according to no replies on this:


http://gis.stackexchange.com/questions/133045/integrating-numeric-scales-into-a-text-or-html-box-in-qgis-print-composer

Could it be added if it is not there yet? I'm afraid it is not too easy 
because there can be multiple maps in a composer.


Tnx!
Raymond

___
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] color widget not updated after changing item color by python

2017-02-28 Thread Raymond Nijssen

Thanks Nyall! I would have never come up with a workaround like this.

Should this be fixed? Or is this "by design"? :)

Btw, the QgsComposerMap does not like this workaround, BUT also does not 
need it because the color widgets seem to get updated anyway.


Raymond


On 28-02-17 06:27, Nyall Dawson wrote:

On 27 February 2017 at 01:17, Raymond Nijssen <r.nijs...@terglobo.nl> wrote:

When changing the color of a composer item using python, the corresponding
color widget does not update to my new color.

For example, changing the label font color:

composerLabel.setFontColor(QColor(50,50,50,255))


After a redraw, the label's color in the map does change to my new value.
But after selecting it, the widget still shows a black (#00) value. How
can I tell the gui to change as well? And shouldn't setFontColor function
tell the gui to change?

Hoping anyone can help.


Hmm... seems only possible with a silly workaround:

old_id = item.id()
item.setId('a')
item.setId(old_id)

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

[Qgis-developer] color widget not updated after changing item color by python

2017-02-26 Thread Raymond Nijssen
When changing the color of a composer item using python, the 
corresponding color widget does not update to my new color.


For example, changing the label font color:

composerLabel.setFontColor(QColor(50,50,50,255))


After a redraw, the label's color in the map does change to my new 
value. But after selecting it, the widget still shows a black (#00) 
value. How can I tell the gui to change as well? And shouldn't 
setFontColor function tell the gui to change?


Hoping anyone can help.

Regards,
Raymond


___
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] Outline/border -> stroke?

2017-02-23 Thread Raymond Nijssen

Hi Yves,

Sounds good! I tried but couldn't find a way to make this work. Can I 
find a description somewhere?


Regards,
Raymond


On 19-02-17 09:04, yjacolin wrote:

Raymond,

You can use variable to change color at once everywhere you set up the
parameter to use it!

Y.



Envoyé depuis mon appareil Samsung


 Message d'origine 
De : Raymond Nijssen <r.nijs...@terglobo.nl>
Date : 18/02/2017 11:15 (GMT+01:00)
À : qgis-developer@lists.osgeo.org
Objet : Re: [Qgis-developer] Outline/border -> stroke?

+1 for stroke

+0 for opacity/transparency, but let's pick one of them for QGIS overall.

+1 for not using  black, but please make it a really dark gray because I
think maps look crappy when the outline color gets lighter than the fill
color. (As I notice sometimes in another desktop GIS...)

Besides, talking about this subject, I would love a tool for changing
all the black stuff in map composers to another color. Texts, scale
bars, frames, everything at once. Or does this already exist?

Regards,
Raymond



On 18-02-17 08:26, Tim Sutton wrote:

Hi

+1 from me too to switch to "stroke" and charcoal instead of black.

Regards

Tim Sutton
Co-founder of Kartoza
QGIS project chairman

On 07 Feb 2017, at 12:42 PM, Tom Chadwin <tom.chad...@nnpa.org.uk
<mailto:tom.chad...@nnpa.org.uk>> wrote:


Definitely "stroke", both because it is the standard term in graphics
software, and also because neither "border" nor "outline" make any
sense in
a line.

I agree that a dark grey would be a better choice of default stroke than
black:



https://www.google.co.uk/webhp?sourceid=chrome-instant=1=2=UTF-8#q=never+use+black+in+design


Tom



-
Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon
--
View this message in context:


http://osgeo-org.1560.x6.nabble.com/Outline-border-stroke-tp5306671p5306709.html

Sent from the QGIS - Developer mailing list archive at Nabble.com
<http://Nabble.com>.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org <mailto: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



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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


--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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] Outline/border -> stroke?

2017-02-18 Thread Raymond Nijssen

+1 for stroke

+0 for opacity/transparency, but let's pick one of them for QGIS overall.

+1 for not using  black, but please make it a really dark gray because I 
think maps look crappy when the outline color gets lighter than the fill 
color. (As I notice sometimes in another desktop GIS...)


Besides, talking about this subject, I would love a tool for changing 
all the black stuff in map composers to another color. Texts, scale 
bars, frames, everything at once. Or does this already exist?


Regards,
Raymond



On 18-02-17 08:26, Tim Sutton wrote:

Hi

+1 from me too to switch to "stroke" and charcoal instead of black.

Regards

Tim Sutton
Co-founder of Kartoza
QGIS project chairman

On 07 Feb 2017, at 12:42 PM, Tom Chadwin > wrote:


Definitely "stroke", both because it is the standard term in graphics
software, and also because neither "border" nor "outline" make any
sense in
a line.

I agree that a dark grey would be a better choice of default stroke than
black:

https://www.google.co.uk/webhp?sourceid=chrome-instant=1=2=UTF-8#q=never+use+black+in+design

Tom



-
Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon
--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/Outline-border-stroke-tp5306671p5306709.html
Sent from the QGIS - Developer mailing list archive at Nabble.com
.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org 
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



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



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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] loading multiple wfs layers causes unexpected behaviour

2016-12-14 Thread Raymond Nijssen

Thanks!

Seems like this WFS service is not very stable at certain moments. 
Trying to figure out what is going on. But it doesn't seem to be a QGIS 
problem.


phew :)

Raymond

On 12-12-16 16:13, Even Rouault wrote:




So I think 2.14 is not patched? You need to have latest 2.18 or 2.16 ...







maybe Even can comment on this? Is it possible to bring this fix in 2.14



(LTR?)








Richard,



https://github.com/qgis/QGIS/commit/4bcbc1e4e7ce89237e48067e352d50079fdfa4a6
was to fix a regression of 2.16.0 that didn't exist in 2.14

If I try the Bouwvlak layer in 2.14.8 (manually), that works, so I'm not
sure what the issue you got with 2.14 is.



Even



--

Spatialys - Geospatial professional services

http://www.spatialys.com



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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] loading multiple wfs layers causes unexpected behaviour

2016-12-10 Thread Raymond Nijssen
In a loop, my python script adds 4 WFS layers to a new layer group in my 
map. Before adding them I test for vlayer.isValid() and for some reason 
they randomly seem invalid. Adding 0, 1, 2, 3 or 4 layers to my new 
group. Check attached screenshot.


I guess this might have to do with the remote WFS-service behind the 
layer's data. Could I use some kind of onReady() or isReady() functionality?

I hope someone can explain this behaviour?

Another, possibly related, thing I ran into; When I load a qgs-file 
containing some WFS layers, QGIS reports most of the WFS layers in the 
'Handle bad layers' dialog. When I press OK (without changing anything) 
some layers are "fixed" while others are still bad.



This is my script, sorry for the terrible dutch layer names etc:




import urllib
#from qgis.core import import
import time

plangebied = 'NL.IMRO.0796.0002120-1301'

'''
params = {
'service': 'WFS',
'version': '1.0.0',
'request': 'GetFeature',
'typename': 'union',
'srsname': "EPSG:23030"
}
'''


def getWfsLayer(service, typename, filter):
params = {
'typename': typename,
'filter': filter,
'srsname': 'EPSG:28992',
#'restrictToRequestBBOX': '1',
#'version': '2.0.0',
#'table': '',
#'sql': ''
}
if not service[-1] == '?':
service += '?'
uri = service + urllib.unquote(urllib.urlencode(params))
#print uri
layername = typename
vlayer = QgsVectorLayer(uri, layername, "WFS")
return vlayer


def addBestemmingsplan(plangebied):
service = 'http://afnemers.ruimtelijkeplannen.nl/afnemers2012/services'
filter = '"plangebied"=\'' + plangebied + '\''
#print(filter)
layers = [ \
'app:Bouwaanduiding', \
'app:Bouwvlak', \
'app:Enkelbestemming', \
'app:Bestemmingsplangebied', \
]

root = QgsProject.instance().layerTreeRoot()
bpName = plangebied
bpGroup = root.insertGroup(0, bpName)
#print bpGroup

for layer in layers:
#time.sleep(1)
print layer
vlayer = getWfsLayer(service, layer, filter)
print vlayer
#vlayer.updateExtents()
if vlayer.isValid():
QgsMapLayerRegistry.instance().addMapLayer(vlayer, False)
#time.sleep(1)
node_vlayer = bpGroup.addLayer(vlayer)
#time.sleep(1)
else:
print 'invalid layer'

canvas = iface.mapCanvas()
canvas.refresh()


addBestemmingsplan(plangebied)


___
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] Reporting an issue at http://hub.qgis.org/

2016-11-28 Thread Raymond Nijssen

This is very recognizable, Nyall!

What are the options? Do other open source software projects have more 
user friendly systems for this? We could ask osgeo to implement it.


Raymond


On 28-11-16 01:31, Nyall Dawson wrote:

On 27 November 2016 at 21:33, Bernd Vogelgesang
 wrote:


As long as the developers are happy with the tools, I don't care, but
assistance from ordinary users in some form is not so likely as well.



Actually, truth is a lot of developers are not happy with the osgeo
auth integration. Eg me.

I was recently in a discussion about qgis with a co-worker who had a
small suggestion about how we could improve the software. I thought
this was the perfect time to show him how to file a feature request in
the hope that doing so would help him understand better about how open
source works and how he can get involved.

So I show him hub, then watch in total embarrassment as he struggles
to find out how to register for the site. And then when he finds out
how to get to the registration page, he's asked for a "mantra".
Obviously, he has no idea what this is, and turns to ask me about it.
And I have no clue what the actual mantra is. And I know that trying
to explain to him something like "ok, now you go to irc and find
someone on this channel who knows that magic phrase..." is totally
pointless and he'll never do that.

End result - no report filed, I can't remember what his suggestion
was, he's left thinking open-source is complex and not beginner
friendly, and I'm left embarrassed because I can't even help him file
a ticket (let alone get it fixed!).

I realise that the current setup was done by hard working volunteers,
and I applaud their efforts, but the sad truth is that it's just not
working anymore and we need a better solution. :(

Nyall








 > Let me know if you have a problem resetting your password (though I


cannot reset it for you either...), then we figure out another way to
issue your problem.

Regards,

Richard Duivenvoorde




Cheers
Bernd




___
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




--
Bernd Vogelgesang
Siedlerstraße 2
91083 Baiersdorf/Igelsdorf
Tel: 09133-825374

___
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] broken link to CODING.md

2016-11-14 Thread Raymond Nijssen

Thank you! Done:

https://github.com/qgis/QGIS-Website/pull/396

Raymond

On 14-11-16 12:53, Matthias Kuhn wrote:

Hi Raymond,

It has been moved to the website, have a look here:

https://github.com/qgis/QGIS/commit/7b0837f490018d938695ccf601ba9595cee7bdbd

Can you update the link to
http://qgis.org/en/site/getinvolved/development/qgisdevelopersguide.html

Thanks
Matthias

On 11/14/2016 12:43 PM, Raymond Nijssen wrote:

The qtcreator setup page:

https://www.qgis.org/en/site/getinvolved/development/qgisdevelopersguide/qtcreator.html


contains a broken link to:

https://github.com/qgis/QGIS/blob/master/CODING.md


Indeed there is no directory 'blob' in the project (anymore) and I
cannot find any file called 'CODING.md' neither.

Does anyone know where it should point to?

Regards,
Raymond
___
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



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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] broken link to CODING.md

2016-11-14 Thread Raymond Nijssen

The qtcreator setup page:

https://www.qgis.org/en/site/getinvolved/development/qgisdevelopersguide/qtcreator.html

contains a broken link to:

https://github.com/qgis/QGIS/blob/master/CODING.md


Indeed there is no directory 'blob' in the project (anymore) and I 
cannot find any file called 'CODING.md' neither.


Does anyone know where it should point to?

Regards,
Raymond
___
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] run only one unit test?

2016-10-14 Thread Raymond Nijssen
It was already there. But there is *a lot* more on that page, making it 
hard to find.


It is in the very last bash block:

$ ctest -R appl -V



On 10/14/2016 11:11 AM, Richard Duivenvoorde wrote:

On 14-10-16 10:58, Raymond Nijssen wrote:

Thank you Sandro!

I was looking for it over here but could not find it:

https://www.qgis.org/en/site/getinvolved/development/qgisdevelopersguide/unittesting.html


Please, please add it :-)

Regards,

Richard

___
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



--
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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] run only one unit test?

2016-10-14 Thread Raymond Nijssen

Thank you Sandro!

I was looking for it over here but could not find it:

https://www.qgis.org/en/site/getinvolved/development/qgisdevelopersguide/unittesting.html

Tnx,
Raymond




On 10/13/2016 08:33 PM, Sandro Santilli wrote:

On Thu, Oct 13, 2016 at 07:52:50PM +0200, Even Rouault wrote:

Le jeudi 13 octobre 2016 19:31:08, Sandro Santilli a écrit :

On Thu, Oct 13, 2016 at 07:07:01PM +0200, Raymond Nijssen wrote:

Can I run only one unit test, instead of all 244?

Something like:

make test QgsSymbolLayerCreateSld


Something like this should work:

  ctest -R QgsSymbolLayerCreateSld

See tests/README.md, and please help improving it
(for example: can I run just a *single* test inside a test unit?)


I usually do something like this shortcircuiting ctest:

QGIS_PREFIX_PATH=output PYTHONPATH=output/python:$PYTHONPATH \
  python ../tests/src/python/test_qgsvectorfilewriter.py 
TestQgsVectorLayer.testOverwriteLayer


Thanks, I've added it to the README file

--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] Magnifier causes crash

2016-09-14 Thread Raymond Nijssen

Confirmed, on debian 8, qgis-master.

QGIS crashes when i "unmagnify" (?) twice.

First time, no problem (100% -> 50%)

Second time, it shows 10% for a split second, and then QGIS crashes.


Here is the debug output:

src/core/qgsmapsettings.cpp: 75: (setMagnificationFactor) [10626ms] 
Magnification factor: 0.1  dpi: 9.6  ratio: 5
src/core/qgsscalecalculator.cpp: 86: (calculate) [1ms] scale = 
1.91195e+06 conversionFactor = 39.3701
src/core/qgsmapsettings.cpp: 219: (updateDerived) [0ms] Map units per 
pixel (x,y) : 5058.70428272919616575, 5058.70428272919707524
src/core/qgsmapsettings.cpp: 220: (updateDerived) [0ms] Pixmap 
dimensions (x,y) : 1144, 547
src/core/qgsmapsettings.cpp: 221: (updateDerived) [0ms] Extent 
dimensions (x,y) : 5787157.69944220036268234, 2767111.24265287071466446
src/core/qgsmapsettings.cpp: 222: (updateDerived) [0ms] 
-2748536.4141667569056153,-933981.4007317154901102 : 
3038621.2852754434570670,1833129.8419211553409696
src/core/qgsmapsettings.cpp: 223: (updateDerived) [0ms] Adjusted map 
units per pixel (x,y) : 5058.70428272919707524, 5058.70428272919707524
src/core/qgsmapsettings.cpp: 224: (updateDerived) [0ms] Recalced pixmap 
dimensions (x,y) : 1144, 547
src/core/qgsmapsettings.cpp: 225: (updateDerived) [0ms] Scale (assuming 
meters as map units) = 1:1911951.22301832516677678

src/core/qgsmapsettings.cpp: 226: (updateDerived) [0ms] Rotation: 0 degrees
src/gui/qgsmapcanvas.cpp: 694: (refresh) [0ms] CANVAS refresh scheduling
src/gui/qgsmapcanvas.cpp: 704: (refreshMap) [2ms] CANVAS refresh!
src/core/qgsmaprenderersequentialjob.cpp: 29: 
(QgsMapRendererSequentialJob) [1ms] SEQUENTIAL construct

src/core/qgsmaprenderersequentialjob.cpp: 63: (start) [1ms] SEQUENTIAL START
src/core/qgsmaprenderercustompainterjob.cpp: 36: 
(QgsMapRendererCustomPainterJob) [0ms] QPAINTER construct

src/core/qgsmaprenderercustompainterjob.cpp: 63: (start) [0ms] QPAINTER run!
src/core/qgsmaprenderercustompainterjob.cpp: 65: (start) [0ms] Preparing 
list of layer jobs for rendering
Fatal: ASSERT failure in Job::startRender(): "pre-set DPI not equal to 
painter's DPI (10 vs 9.6)", file 
/tmp/buildd/qgis-2.17.0+git20160806+cb02b9f+13jessie/src/core/qgsmaprenderercustompainterjob.cpp, 
line 77

Stacktrace (piped through c++filt):
/usr/bin/qgis.bin(+0x9514)[0x7f0e02ced514]
/usr/bin/qgis.bin(myMessageOutput(QtMsgType, char 
const*)+0x1e4)[0x7f0e02ced821]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(qt_message_output(QtMsgType, 
char const*)+0x31)[0x7f0dff5439a1]

/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x71e09)[0x7f0dff543e09]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(qFatal(char const*, 
...)+0xa1)[0x7f0dff5446f1]

/usr/lib/libqgis_core.so.2.17.0(QgsMapRendererCustomPainterJob::start()+0x3a5)[0x7f0e000d4b8d]
/usr/lib/libqgis_core.so.2.17.0(QgsMapRendererSequentialJob::start()+0x1cf)[0x7f0e000e0b2b]
/usr/lib/libqgis_gui.so.2.17.0(QgsMapCanvas::refreshMap()+0x410)[0x7f0e018b9c36]
/usr/lib/libqgis_gui.so.2.17.0(+0x5f6036)[0x7f0e01994036]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QMetaObject::activate(QObject*, 
QMetaObject const*, int, void**)+0x32c)[0x7f0dff66d71c]

/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x1a4a4a)[0x7f0dff676a4a]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QObject::event(QEvent*)+0xb3)[0x7f0dff671ce3]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplicationPrivate::notify_helper(QObject*, 
QEvent*)+0x8c)[0x7f0dfe9a948c]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplication::notify(QObject*, 
QEvent*)+0x2b8)[0x7f0dfe9affa8]
/usr/lib/libqgis_core.so.2.17.0(QgsApplication::notify(QObject*, 
QEvent*)+0x9b)[0x7f0dfff856b1]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::notifyInternal(QObject*, 
QEvent*)+0x8d)[0x7f0dff65871d]

/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x1b838b)[0x7f0dff68a38b]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x1b53c1)[0x7f0dff6873c1]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x24d)[0x7f0df788cc5d]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x49f48)[0x7f0df788cf48]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7f0df788cffc]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventDispatcherGlib::processEvents(QFlags)+0x5d)[0x7f0dff687d1d]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x26bf96)[0x7f0dfea4df96]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventLoop::processEvents(QFlags)+0x41)[0x7f0dff657271]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventLoop::exec(QFlags)+0x1a5)[0x7f0dff6575d5]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::exec()+0x99)[0x7f0dff65d059]
/usr/bin/qgis.bin(main+0x42f5)[0x7f0e02cf1b8c]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f0df8ca9b45]
/usr/bin/qgis.bin(+0x8e49)[0x7f0e02cece49]
Aborted


Regards,
Raymond




On 09/14/2016 06:48 PM, Paolo Cavallini wrote:

Il 14/09/2016 13:39, Paolo Cavallini ha scritto:

Hi Denis,

Il 14/09/2016 13:12, Denis Rouzaud ha scritto:

The combobox in the status bar?


Yes


Any chance to have a trace?


Of course. I'm on a course now, I'd like to have 

Re: [Qgis-developer] SVG as attribute?

2016-07-15 Thread Raymond Nijssen
Hi Matthias,

A few weeks ago I asked a similar question here (titled: "custom
charts?"). You can store the filename and use a data defined svg image
in the styling tab:

---
with an SVG-marker the filename can be "data-defined", so you can for
instance use an expression like '/xxx/mymarker_' || id || '.svg'
---

QGIS cannot (yet) draw symbols using a piece of svg text in your table.
It would be great if it could though!

Good luck,

Raymond



On 15-07-16 10:38, Matthias Ludwig wrote:
> Hi, 
>  
> is it possible to store an plain svg in the attribute table for styling
> or is it just possible to save the path to the svg?
>  
> Greetings
> 
> 
> ___
> 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
> 

-- 
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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] morph delimited-text-provider to generic table-provider?

2016-07-11 Thread Raymond Nijssen
Hi Andreas,

I'd just like to see a way to create a new layer from any (attribute)
table in QGIS. So, even a point shapefile containing a wkt column with
polygons or a database table containing x and y field or an opened xls
sheet containing json somewhere.

My suggestion:

- To strip the geometry stuff from the CSV importer.
- Have a new tool to create a geometry layer from any QGIS table.

I think this would be easy to understand for users, although some would
need both tools to import a csv with geometry.

Regards,
Raymond

> Hi,
>
> I would welcome an "easier" way to open Point or WKT data from formats
> that do not store geometries natively, as you propose. Thanks for
> bringing it to the table, Raymond and Richard!
>
> My suggestion would be to enhance the existing OGR "Add vector layer"
> dialog with an option to choose columns to be used for geometry
> creation. This way we don't have to "misuse" the delimited text layer
> loader for other formats and the user could open the data all in one
> step, without the need for postprocessing. OGR VRT provides all we need
> to create geometries from columns - see http://www.gdal.org/drv_vrt.html
>
>
> The drawback is that it would work only for OGR formats, not for all the
> other databases. But I would assume that people using databases are
> skilled enough to be able to use QGIS virtual layers, views, etc. to
> build geometries from their databases.
>
> Greetings,
> Andreas
>
> On 2016-07-09 11:00, Richard Duivenvoorde wrote:
>
>> Hi Devs,
>>
>> Raymond Nijssen had an (I think) intriguing idea:
>>
>> QGIS can open different types of table-data: dbf, excel etc etc
>>
>> But if the excel contains an x,y,wkt column, you have to save it to
>> csv/tsv first, to be able to use the delimited-text-provider to open it
>> as a layer.
>>
>> His idea: can't we use the delimited-text-provider for all tables that
>> are open in QGIS immediately?
>>
>> Had a look into the code
>>
>> https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.cpp#L583
>>
>> which 'just' looks like a QTextStream:
>>
>> https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.h#L352
>>
>> And according to this:
>> https://forum.qt.io/topic/63310/how-to-save-a-treeview-as-csv-file-in-qt
>>
>> It is easy to create a textstream from QModel (in which we have the data
>> I think???)...
>>
>> So Question:
>> - (to devs): would this indeed be doable/easy?
>> - (to UI's): should the Delimited Text File dialog be updated then (or
>> only with a 'open excisting table button'?
>> - should we rename the provider to 'table' provider.
>>
>> Comments/Opinions?
>>
>> Regards,
>>
>> Richard Duivenvoorde
>> ___
>> 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] morph delimited-text-provider to generic table-provider?

2016-07-09 Thread Raymond Nijssen
Great idea! ;)

Question is where to implement it in the GUI. It overlaps the
functionality in the delimited text reader. Like pointing to the x and y
columns or choosing a column containing wkt.

Maybe it could be a 2 steps process? Step 1 is importing any table and
step 2 is creating a spatial layer from it. But we would loose the quick
"Add delimited text layer" functionality.

Any ideas?

@Paolo, which plugin can do this? XyTools?

Regards,
Raymond




On 09-07-16 11:14, Paolo Cavallini wrote:
> Agreed. There is a plugin doing this, but of course having it as a
> standard function is desirable.
> Thanks for raising this.
> 
> Il 9 luglio 2016 12:00:38 EEST, Richard Duivenvoorde
> <rdmaili...@duif.net> ha scritto:
> 
> Hi Devs,
> 
> Raymond Nijssen had an (I think) intriguing idea:
> 
> QGIS can open different types of table-data: dbf, excel etc etc
> 
> But if the excel contains an x,y,wkt column, you have to save it to
> csv/tsv first, to be able to use the delimited-text-provider to open it
> as a layer.
> 
> His idea: can't we use the delimited-text-provider for all tables that
> are open in QGIS immediately?
> 
> Had a look into the code
> 
> 
> https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.cpp#L583
> 
> which 'just' looks like a QTextStream:
> 
> 
> https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.h#L352
> 
> And
> according to this:
> https://forum.qt.io/topic/63310/how-to-save-a-treeview-as-csv-file-in-qt
> 
> It is easy to create a textstream from QModel (in which we have the data
> I think???)...
> 
> So Question:
> - (to devs): would this indeed be doable/easy?
> - (to UI's): should the Delimited Text File dialog be updated then (or
> only with a 'open excisting table button'?
> - should we rename the provider to 'table' provider.
> 
> Comments/Opinions?
> 
> Regards,
> 
> Richard Duivenvoorde
> 
> 
> 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
> 
> 
> -- 
> Paolo Cavallini
> www.faunalia.eu <http://www.faunalia.eu>
> 
> 
> ___
> 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] custom charts?

2016-06-28 Thread Raymond Nijssen
Here is an example of a map with code generated svg images as symbols.
The quick and dirty script does:

- aggregate all features from input point layer with same geometry
- calculate min/max times and values for whole set
- create svg files for every feature with filename based on id
- create a layer in qgis

Manually i added the data defined filename based on the id:

'/tmp/img_measure_' || "imgid" || '.svg'

Et voila!

http://terglobo.nl/downloads/voorbeeld_kaart_01.png

Thank you all for your suggestions!

Raymond



On 26-06-16 11:58, Raymond Nijssen wrote:
> There is this library to make it easier:
> 
> https://pypi.python.org/pypi/svgwrite/
> 
> And since it is python, you can use the standard code editor in QGIS (or
> an external one if you prefer).
> 
> Raymond
> 
> On 25-06-16 21:33, Lauri Kajan wrote:
>> This would be great also for nautical charts to render light sectors
>> from S57 data.
>>
>> Could existing code editor be used to construct the svg with some python
>> svg library?
>>
>>
>> -Lauri
>>
>>
>> ___
>> 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
> 

-- 
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83
___
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] custom charts?

2016-06-26 Thread Raymond Nijssen
There is this library to make it easier:

https://pypi.python.org/pypi/svgwrite/

And since it is python, you can use the standard code editor in QGIS (or
an external one if you prefer).

Raymond

On 25-06-16 21:33, Lauri Kajan wrote:
> This would be great also for nautical charts to render light sectors
> from S57 data.
> 
> Could existing code editor be used to construct the svg with some python
> svg library?
> 
> 
> -Lauri
> 
> 
> ___
> 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] custom charts?

2016-06-24 Thread Raymond Nijssen
Hugo,

That would be way cooler!

For now, I just write generated svg files to a temp directory and add
links to them to every feature.

Strings might get long though. Here is for example the code from my
dummy image (1.4kb):




http://purl.org/dc/elements/1.1/;
   xmlns:cc="http://creativecommons.org/ns#;
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#;
   xmlns:svg="http://www.w3.org/2000/svg;
   xmlns="http://www.w3.org/2000/svg;
   version="1.1"
   width="32"
   height="32"
   id="svg2985">
  
  

  
image/svg+xml
http://purl.org/dc/dcmitype/StillImage; />

  

  
  


  







On 24-06-16 14:34, Hugo Mercier wrote:
> It would be also cool to be able to directly use a string as image
> content for a marker (rather than just for the filename).
> That should be quite easy to do.
> 
> On 24/06/2016 14:28, Nathan Woodrow wrote:
>> Raymond,
>>
>> Code generated SVGs is a pretty cool idea.  Would be super keen to see
>> that once you have something!
>>
>> On Fri, Jun 24, 2016 at 10:25 PM, Neumann, Andreas <a.neum...@carto.net
>> <mailto:a.neum...@carto.net>> wrote:
>>
>> Pretty cool - so we can deliver script-generated SVG code instead of
>> a filename? Nice!
>>
>> Care to do a blog post with some example? This sounds quite exciting
>> to me.
>>
>> Andreas
>>
>> On 2016-06-24 14:12, Raymond Nijssen wrote:
>>
>>> Hi Hugo,
>>>
>>> It works! Thanks a lot!!
>>>
>>> This is exactly what i was looking for, but somehow could not find.
>>>
>>> Here is a little example with some fake svg's:
>>>
>>> http://terglobo.nl/downloads/example.png
>>>
>>> Now I will script generating svg based on real data.
>>>
>>> Regards,
>>> Raymond
>>>
>>>
>>> On 23-06-16 09:02, Hugo Mercier wrote:
>>>> On 22/06/2016 19:06, Richard Duivenvoorde wrote:
>>>>> On 22-06-16 14:39, Hugo Mercier wrote:
>>>>>> Hi Raymond,
>>>>>>> - Add a text field to my feature layer containig svg, and
>>>>>>> somehow make
>>>>>>> qgis display that on my map;
>>>>>>
>>>>>> This should work, no ?
>>>>>
>>>>> Are you sure? This would mean that the value(!) of an attribute
>>>>> would
>>>>> contain the actual svg (code, not filename).
>>>>> Any example on how to use that with styling then?
>>>>
>>>> Hmmm exact, I don't think you can include the content (I tried to
>>>> include a data url but it does not work).
>>>>
>>>>>
>>>>>>> - Add a text field to my feature layer containig a path to a
>>>>>>> png (or
>>>>>>> svg), and somehow make qgis display that on my map.
>>>>>>
>>>>>> An SVG marker with the file name defined as an expression ?
>>>>>
>>>>> Same here, while we managed to get for example colors dynamic,
>>>>> we could
>>>>> not find a way (yet) to set the marker-svg once filename is
>>>>> retrieved
>>>>> from an attribute...
>>>>>
>>>>> Happy to get an example or pointers :-)
>>>>
>>>> with an SVG-marker the filename can be "data-defined", so you can for
>>>> instance use an expression like '/xxx/mymarker_' || id || '.svg'
>>>>
>>>>
>>>> ___
>>>> Qgis-developer mailing list
>>>> Qgis-developer@lists.osgeo.org
>>>> <mailto: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 <mailto: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] custom charts?

2016-06-24 Thread Raymond Nijssen
Hi Hugo,

It works! Thanks a lot!!

This is exactly what i was looking for, but somehow could not find.

Here is a little example with some fake svg's:

http://terglobo.nl/downloads/example.png

Now I will script generating svg based on real data.

Regards,
Raymond


On 23-06-16 09:02, Hugo Mercier wrote:
> On 22/06/2016 19:06, Richard Duivenvoorde wrote:
>> On 22-06-16 14:39, Hugo Mercier wrote:
>>> Hi Raymond,
 - Add a text field to my feature layer containig svg, and somehow make
 qgis display that on my map;
>>>
>>> This should work, no ?
>>
>> Are you sure? This would mean that the value(!) of an attribute would
>> contain the actual svg (code, not filename).
>> Any example on how to use that with styling then?
> 
> Hmmm exact, I don't think you can include the content (I tried to
> include a data url but it does not work).
> 
>>
 - Add a text field to my feature layer containig a path to a png (or
 svg), and somehow make qgis display that on my map.
>>>
>>> An SVG marker with the file name defined as an expression ?
>>
>> Same here, while we managed to get for example colors dynamic, we could
>> not find a way (yet) to set the marker-svg once filename is retrieved
>> from an attribute...
>>
>> Happy to get an example or pointers :-)
> 
> with an SVG-marker the filename can be "data-defined", so you can for
> instance use an expression like '/xxx/mymarker_' || id || '.svg'
> 
> 
> ___
> 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] custom charts?

2016-06-23 Thread Raymond Nijssen
Thanks Hugo, I will try to get this to work.

On 23-06-16 09:02, Hugo Mercier wrote:
> On 22/06/2016 19:06, Richard Duivenvoorde wrote:
>> On 22-06-16 14:39, Hugo Mercier wrote:
>>> Hi Raymond,
 - Add a text field to my feature layer containig svg, and somehow make
 qgis display that on my map;
>>>
>>> This should work, no ?
>>
>> Are you sure? This would mean that the value(!) of an attribute would
>> contain the actual svg (code, not filename).
>> Any example on how to use that with styling then?
> 
> Hmmm exact, I don't think you can include the content (I tried to
> include a data url but it does not work).
> 
>>
 - Add a text field to my feature layer containig a path to a png (or
 svg), and somehow make qgis display that on my map.
>>>
>>> An SVG marker with the file name defined as an expression ?
>>
>> Same here, while we managed to get for example colors dynamic, we could
>> not find a way (yet) to set the marker-svg once filename is retrieved
>> from an attribute...
>>
>> Happy to get an example or pointers :-)
> 
> with an SVG-marker the filename can be "data-defined", so you can for
> instance use an expression like '/xxx/mymarker_' || id || '.svg'
> 
> 
> ___
> 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] custom charts?

2016-06-22 Thread Raymond Nijssen
Dear developers,

Can I somehow show custom images for each point feature on a map,
similar to the layer diagrams?

Having locations with a few sensor values, I'd like to generate a custom
image for every feature (for example svg or png) and have it displayed
on my feature.

I've come up with some ideas:

- Create many custom svg files in a directory linked to qgis, and
afterwards create a long rule-based style for every unique feature;

- Add a text field to my feature layer containig svg, and somehow make
qgis display that on my map;

- Add a text field to my feature layer containig a path to a png (or
svg), and somehow make qgis display that on my map.

None of those options seems to be possible. Does anybody know a solution?

Thanks!

Raymond

___
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] LayerTree group checkbox behavior

2016-05-27 Thread Raymond Nijssen
Totally agree it should work as requested.

Raymond

On 27-05-16 17:03, Arnaud Morvan wrote:
> 
> Hello,
> 
> One of our customer want this ticket to be done :
> https://hub.qgis.org/issues/14547
> For myself, I agree that the actual behavior of layer tree groups is a
> little disappointing.
> 
> When I uncheck a layer group, I expect children to be hidden but not
> unchecked.
> On the same way, when I check a layer group, I expect checked children
> to be shown, but not those who are'nt checked to be checked.
> 
> Does anyone have an opinion on this ?
> 
> Regard
> 
> Arnaud Morvan
> Camptocamp
> ___
> 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

-- 
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
06 25 31 49 83



signature.asc
Description: OpenPGP digital 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] debian testing/Linux: yellow non-readable tooltips except for gtk+

2016-04-14 Thread Raymond Nijssen
I've seen this before, and i've never used Gnome3. Probably i used Unity
at that time, but i'm not sure.

Unfortunately I never found the reason, so I cannot tell you how to
solve it. It worked again after a fresh install.

Regards,
Raymond

On 14-04-16 21:40, Richard Duivenvoorde wrote:
> Hi,
> 
> since some days I have these yellow background/white character
> (unreadable) tooltips in my self compiled QGIS:
> 
> http://pix.toile-libre.org/upload/original/1460662225.png
> 
> Tried to change the 5 availabl style options, and actually ALL but GTK+
> had this strange colors. GTK+ is white on black: which is actually nice.
> 
> Is this a gnome3 thingie?
> 
> Regards,
> 
> Richard
> ___
> 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
> 

-- 
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983



signature.asc
Description: OpenPGP digital 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] Plugin migratin -> mailing list?

2015-11-08 Thread Raymond Nijssen

If you open this plugin info page:

https://plugins.qgis.org/plugins/FieldEvaluator/

you will find my email-address in the details tab. Same for all other 
plugins.


Indeed it is not shown in the Plugin Manager, I wasn't aware of that. 
But it is in the metadata.txt file which is downloaded by all users 
together with the plugin. Quite publicly.


Problem with asking plugin developers to subscribe on a plugin ML is 
that a part of them will not read/do it and therefore won't know the 
impact of near future QGIS changes, which is bad for QGIS and many users.


For now, let's ask Paolo in what way he is intended to use this.


On 08-11-15 12:15, DelazJ wrote:

Hi all,
Raymond, I'm not sure plugins authors mail are **publicly** available,
neither on plugins.qgis.org nor in the Plugins Manager. User do not need my
email to reach me about an issue; just report it to a bug tracker (which
everybody should provide). The only persons who have access to name and
mails are QGIS Plugins team admins.
That said, most of us write in this ML with clear emails :)

What might be unclear in Paolo's mail is about a creation of a list. You
already have the mails, what is needed to be created then? Do you need our
acceptance to compile in a database the list of plugins authors and
adresses if this list is only available for the team and not for the
public? I assume this is just to join people easily about their plugins
(evolution).
I'm for a plugin ML and as already stated by some of us, no automatic
adhesion. People should be invited to voluntarily join it thus a list of
mails (at least for the first invitation)


2015-11-08 12:25 GMT+01:00 Raymond Nijssen <r.nijs...@terglobo.nl>:


Let us not exaggerate this please.

All plugin developers provide an email address to be contacted in case of
problems/questions. These are publicly available on our website and in our
Plugin Manager application.

Now, because of large changes in our system that will affect all plugins,
the QGIS team wants to send some messages to all plugin developers. This
could be done by hand (adding up all addresses as BCC in an email program)
but it would take up a lot of time. Luckily there is automation, and we can
do this automatically by sending a (bcc!) message to all plugin developers.

What is wrong about saving time this way? I just do not get it.



On 08-11-15 10:49, Tom Chadwin wrote:


I think we should all respect a view held by someone who has voluntarily
created a plugin. My opinion, as a UK data protection officer, is that
this
view is in line with data protection legislation. When I submitted a
plugin,
I was not told that my email address would be used for bulk mailing.

We can change the terms and conditions to make this the case in the
future,
though I would not recommend it. But we cannot use that data for a purpose
for which we did not seek permission.



--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/Plugin-migratin-mailing-list-tp5235017p5235078.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer





--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Plugin migratin -> mailing list?

2015-11-08 Thread Raymond Nijssen

Let us not exaggerate this please.

All plugin developers provide an email address to be contacted in case 
of problems/questions. These are publicly available on our website and 
in our Plugin Manager application.


Now, because of large changes in our system that will affect all 
plugins, the QGIS team wants to send some messages to all plugin 
developers. This could be done by hand (adding up all addresses as BCC 
in an email program) but it would take up a lot of time. Luckily there 
is automation, and we can do this automatically by sending a (bcc!) 
message to all plugin developers.


What is wrong about saving time this way? I just do not get it.


On 08-11-15 10:49, Tom Chadwin wrote:

I think we should all respect a view held by someone who has voluntarily
created a plugin. My opinion, as a UK data protection officer, is that this
view is in line with data protection legislation. When I submitted a plugin,
I was not told that my email address would be used for bulk mailing.

We can change the terms and conditions to make this the case in the future,
though I would not recommend it. But we cannot use that data for a purpose
for which we did not seek permission.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Plugin-migratin-mailing-list-tp5235017p5235078.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Plugin migratin -> mailing list?

2015-11-08 Thread Raymond Nijssen

I will do the script if someone provides the data.

Raymond


On 07-11-15 19:57, Alessandro Pasotti wrote:

Forgot the instructions:

from xmlrpclib import ServerProxy
ServerProxy('
http://osgeo_user:osgeo_passw...@plugins.qgis.org/plugins/RPC2/').plugin.maintainers(
)

only administrators can access.



2015-11-07 19:44 GMT+01:00 Paolo Cavallini :


Il 07/11/2015 18:16, Alessandro Pasotti ha scritto:


Just added an XML-RPC method to export the maintainers emails

Available at:

http://plugins.qgis.org/plugins/RPC2/


Thanks Alessandro.
Just for the record: we have now 299 plugin maintainer emails, an
average of 1.8 plugins each.
All the best.
--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html







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



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] broken WFS client commit

2015-10-27 Thread Raymond Nijssen
Yes, could someone please revert or solve this? I've been meeting this 
issue since last summer (http://hub.qgis.org/issues/13117) and it 
prevents some of my customers to upgrade from 2.8, missing all kinds of 
nice new features.


Regards,
Raymond


On 25-10-15 22:19, Jeremy Palmer wrote:

Should we maybe 'rename' the 'caching' option to be an option which
makes QGIS resend a feature request every zoom/pan?


I agree we should revert to the old behaviour and rename the label.

This change has now broken a major use case for users of large WFS datasets.

Cheers
Jeremy



This message contains information, which may be in confidence and may be 
subject to legal privilege. If you are not the intended recipient, you must not 
peruse, use, disseminate, distribute or copy this message. If you have received 
this message in error, please notify us immediately (Phone 0800 665 463 or 
i...@linz.govt.nz) and destroy the original message. LINZ accepts no 
responsibility for changes to this email, or for any attachments, after its 
transmission from LINZ. Thank You.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] broken WFS client commit

2015-10-27 Thread Raymond Nijssen

Hi Andreas,

That would be great, but for now I'd like to have the change that broke 
this reverted.


Raymond

On 27-10-15 10:50, Andreas Neumann wrote:

The WFS client should really get some love by a developer (and our
funds). Currently, it is broken and does not support the newer WFS version.

Hopefully, we can fund something from our donations/sponsorships.

Andreas

On 27.10.2015 09:24, Raymond Nijssen wrote:

Yes, could someone please revert or solve this? I've been meeting this
issue since last summer (http://hub.qgis.org/issues/13117) and it
prevents some of my customers to upgrade from 2.8, missing all kinds
of nice new features.

Regards,
Raymond


On 25-10-15 22:19, Jeremy Palmer wrote:

Should we maybe 'rename' the 'caching' option to be an option which
makes QGIS resend a feature request every zoom/pan?


I agree we should revert to the old behaviour and rename the label.

This change has now broken a major use case for users of large WFS
datasets.

Cheers
Jeremy



This message contains information, which may be in confidence and may
be subject to legal privilege. If you are not the intended recipient,
you must not peruse, use, disseminate, distribute or copy this
message. If you have received this message in error, please notify us
immediately (Phone 0800 665 463 or i...@linz.govt.nz) and destroy the
original message. LINZ accepts no responsibility for changes to this
email, or for any attachments, after its transmission from LINZ.
Thank You.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer





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


--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Processing test suite

2015-09-30 Thread Raymond Nijssen

Hi Victor, Paolo,

This seems important to me too and I'd love to help on it during next 
hackfest.


Regards,
Raymond


On 30-09-15 08:00, Victor Olaya wrote:

Thanks for the proposal Paolo. This is clearly an important need for Processing

I, however, don't think that the test suite should have test for all
algorithms. The most important part, IMHO, is to test the framework
itself (which will be quite complex itself). It is very uncommon that
a change in the Processing code breaks a single algorithm. Usually it
breaks several of them that shares a point in common, or all of them.
Testing a representative set of algorithms (using all types of
parameters, outputs, etc) and different situations (used in  the
modeler, used with this or that type of data...) should be a good
start.

I wrote some tests some time ago, but I guess most of them wont pass
now, I haven't mantained them during this time. I can take a look at
them and we might be able to reuse them. They were, however, not setup
to be run on a testing  QGIS, but simply run from the QGIS console.
That won't work for automating it and linking it to our CI system, so
we should work on preparing the testing infrastructure.

My time is limited, but i will try to help as much as possible if
other people are willing to collaborate.

Cheers



2015-09-30 7:35 GMT+02:00 Paolo Cavallini :

Hi all,
Processing has become a crucial piece in our infrastructure, and I am
convinced it deserves the best of our attentions.
IMHO a full and proper test suite is a necessity. From the QGIS side
this should be straightforward; the tricky part is to invoke the various
backends, in their several versions for the various OSs.
So my question is: is there anybody willing to take this? I think we can
ask power user to support us, and we probably have QGIS funds to cover it.
All the best.
--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

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



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] memory layer performance while adding many features?

2015-08-05 Thread Raymond Nijssen

Hi Denis,

Adding all features at once, or 1000 by 1000, speeds up enormously. It 
only takes a few minutes, at a steady speed of 480 fpm. Where adding the 
same dataset 1 by 1 took about 5 hours.


Thanks for pointing this out!

Raymond

On 30-07-15 09:34, Denis Rouzaud wrote:

 From your code [0] , I would see 2 options:

* add features all at once on the provider using
QgsVectorDataProvider::addFeatures (the method you currently use)

* work on the layer level rather than the provider, which I believe is
the recommended way for plugins. Make the layer editable, and add
features to the edit buffer and commit at once. Or maybe commit 1000 by
1000.

I hope this helps.




[0]
https://github.com/opengeogroep/AERIUS-QGIS-plugins/blob/master/ImaerReader/imaer_reader.py#L228


On 07/30/2015 09:20 AM, Raymond Nijssen wrote:

Hi Denis,

The code is in the ImaerReader plugin in the qgis repo and in github:

https://github.com/opengeogroep/AERIUS-QGIS-plugins

I'm adding the features one by one.

Regards,
Raymond

On 30-07-15 08:46, Denis Rouzaud wrote:

Hi Raymond,

Can you show us the code doing this?
Do you commit features one by one ar all at once?

Best wishes,
Denis

On 07/29/2015 09:04 AM, Raymond Nijssen wrote:

Dear developers, ;)

A plugin of mine imports data from a gml file into a memory layer.
Works fine for tiny gml files, but takes forever on huge ones. Sounds
plausible maybe, but the relation is not linear.

So I did did some tests and found out that reading and parsing the gml
and creating the features always goes at the same speed of about 400
features a second (fps). But when adding these to my memory layer, the
process slows down tremendously.

I output the fps for every 1000 features and it gave me this graph:

http://terglobo.nl/downloads/memory-layer-performance.png

At the end of the importing process I'm processing just 3 features per
second.

Is this expected behaviour? Is a memory layer not meant for something
like this? Or is this a bug?

In the source code I found that for every feature I add to a memory
layer the index is updated. Could that be inefficient?

Hoping anyone can explain!

Regards,
Raymond












--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] memory layer performance while adding many features?

2015-07-30 Thread Raymond Nijssen

Merci Denis,

I will try both options later today.

Raymond


On 30-07-15 09:34, Denis Rouzaud wrote:

 From your code [0] , I would see 2 options:

* add features all at once on the provider using
QgsVectorDataProvider::addFeatures (the method you currently use)

* work on the layer level rather than the provider, which I believe is
the recommended way for plugins. Make the layer editable, and add
features to the edit buffer and commit at once. Or maybe commit 1000 by
1000.

I hope this helps.




[0]
https://github.com/opengeogroep/AERIUS-QGIS-plugins/blob/master/ImaerReader/imaer_reader.py#L228


On 07/30/2015 09:20 AM, Raymond Nijssen wrote:

Hi Denis,

The code is in the ImaerReader plugin in the qgis repo and in github:

https://github.com/opengeogroep/AERIUS-QGIS-plugins

I'm adding the features one by one.

Regards,
Raymond

On 30-07-15 08:46, Denis Rouzaud wrote:

Hi Raymond,

Can you show us the code doing this?
Do you commit features one by one ar all at once?

Best wishes,
Denis

On 07/29/2015 09:04 AM, Raymond Nijssen wrote:

Dear developers, ;)

A plugin of mine imports data from a gml file into a memory layer.
Works fine for tiny gml files, but takes forever on huge ones. Sounds
plausible maybe, but the relation is not linear.

So I did did some tests and found out that reading and parsing the gml
and creating the features always goes at the same speed of about 400
features a second (fps). But when adding these to my memory layer, the
process slows down tremendously.

I output the fps for every 1000 features and it gave me this graph:

http://terglobo.nl/downloads/memory-layer-performance.png

At the end of the importing process I'm processing just 3 features per
second.

Is this expected behaviour? Is a memory layer not meant for something
like this? Or is this a bug?

In the source code I found that for every feature I add to a memory
layer the index is updated. Could that be inefficient?

Hoping anyone can explain!

Regards,
Raymond












--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] memory layer performance while adding many features?

2015-07-30 Thread Raymond Nijssen

Hi Hugo,

I'm not specifically adding an index. So if you are right, I'm not using 
that.


Regards,
Raymond


On 30-07-15 09:10, Hugo Mercier wrote:

Hi Raymond,

On 29/07/2015 09:04, Raymond Nijssen wrote:

Dear developers, ;)

A plugin of mine imports data from a gml file into a memory layer. Works
fine for tiny gml files, but takes forever on huge ones. Sounds
plausible maybe, but the relation is not linear.

So I did did some tests and found out that reading and parsing the gml
and creating the features always goes at the same speed of about 400
features a second (fps). But when adding these to my memory layer, the
process slows down tremendously.

I output the fps for every 1000 features and it gave me this graph:

http://terglobo.nl/downloads/memory-layer-performance.png

At the end of the importing process I'm processing just 3 features per
second.

Is this expected behaviour? Is a memory layer not meant for something
like this? Or is this a bug?

In the source code I found that for every feature I add to a memory
layer the index is updated. Could that be inefficient?


If I am correct the spatial index is created only if you ask so (by
passing index=yes). Do you have the same results without spatial index ?

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



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Voronoi bug?

2015-07-08 Thread Raymond Nijssen

Hi Paolo,

I met bugs in the voronoi function several times before. There is 
already a bug:


https://hub.qgis.org/issues/8002

but it seems hard to reproduce.

Is it the same?


On 08-07-15 14:41, Paolo Cavallini wrote:

Hi all.
Running the John Snow Processing training exercise, I noticed that
Voronoi polygons are wrong when buffer = 1 is chosen.
See attached. It seems a bug, anyone confirms?
All the best.



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



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] custom page size disabled

2015-05-09 Thread Raymond Nijssen
In the print composer's Page Setup dialog, when i choose Page Size: 
Custom, the width and height fields stay disabled. So I cannot create 
a A1 size map. Can anyone confirm?


Regards,
Raymond


--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] shp cannot be styled

2015-05-07 Thread Raymond Nijssen

Hi Paolo,

Exact same problem here (QGIS testing on linux) and also solved after a 
save as shapefile.


Regards,
Raymond

On 07-05-15 18:52, Paolo Cavallini wrote:

Hi all.
This file:
http://www.faunalia.eu/~paolo/qgis/result.zip
resulting from
processing.runalg(saga:gridstatisticsforpolygons,/tmp/RESULT.tif,/path/municipalities.shp,False,False,True,False,True,False,False,False,0,None)
seems impossible to thematize on the basis of the ``Calculated`` column.
If saved as a new shapefile, it is OK. Possibly SAGA produces a wrong
dbf? Anyone confirms?
Thanks.



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Raymond Nijssen
When I use the Feature info tool with the Auto open form option 
selected, the form shows different values compared to the identify 
results. The Identify results are correct.


Here's a screenshot:
http://terglobo.nl/downloads/qgis_attribute_form_bug.png

I am using QGIS Testing (just updated) on Ubuntu using a PostGIS layer.

Is anyone familiar with this? Or should I file a new bug?

Regards,
Raymond
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Raymond Nijssen
Thanks Regis, that was exactly the issue. The (boolean!) field 
'inonderzoek' was used as a key. When I change that to 'gid' in the Add 
PostGIS Table dialog, everything works correctly.


Can anyone tell me why QGIS picks that boolean field for most of my 
tables? Can I change that behaviour by changing my database structure?


http://terglobo.nl/downloads/qgis_add_postgis_table_wrong_key.png

And how can the identify results be correct anyway?

Tnx,
Raymond


dbname='bag' host=localhost port=5432 user='postgres' sslmode=disable 
key='inonderzoek' estimatedmetadata=true srid=28992 type=POLYGON 
table=bagactueel.pandactueelbestaand (geovlak) sql=




On 26-03-15 10:34, Régis Haubourg wrote:

Hi, I have seen such troubles when the choosen primary key from qgis side is
not unique .

Symptoms: selecting one feature select severals unrelated features of the
same layer. relation with attributes is broken also.

Can you check in your layer's definition (general tab of layer properties)
if you choose gid field as key, and check if it is really unique in postgis?

Cheers
Régis



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/wrong-attribute-values-for-postgis-data-in-Feature-attribute-form-tp5195518p5195523.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Raymond Nijssen

Thanks all for pointing things out!

My view did have a unique id, it is just a sub set of another table. So 
by selecting it everything is solved.



On 26-03-15 11:45, Matthias Kuhn wrote:

Hi Raymond,

The feature shown in the identify result is the one queried with the
geographic location.

For some reason the feature shown in the feature form is not a copy of
the identified data (feature) but queried again with its feature id.

For the views on pg databases I have here, the primary key of the main
source table is shown (which is the first field of the query that
defines the view), so it is fine by default. Not sure about the
heuristics used to get the default PK field.

Matthias

On 03/26/2015 10:57 AM, Raymond Nijssen wrote:

Thanks Regis, that was exactly the issue. The (boolean!) field
'inonderzoek' was used as a key. When I change that to 'gid' in the
Add PostGIS Table dialog, everything works correctly.

Can anyone tell me why QGIS picks that boolean field for most of my
tables? Can I change that behaviour by changing my database structure?

http://terglobo.nl/downloads/qgis_add_postgis_table_wrong_key.png

And how can the identify results be correct anyway?

Tnx,
Raymond


dbname='bag' host=localhost port=5432 user='postgres' sslmode=disable
key='inonderzoek' estimatedmetadata=true srid=28992 type=POLYGON
table=bagactueel.pandactueelbestaand (geovlak) sql=



On 26-03-15 10:34, Régis Haubourg wrote:

Hi, I have seen such troubles when the choosen primary key from qgis
side is
not unique .

Symptoms: selecting one feature select severals unrelated features of
the
same layer. relation with attributes is broken also.

Can you check in your layer's definition (general tab of layer
properties)
if you choose gid field as key, and check if it is really unique in
postgis?

Cheers
Régis



--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/wrong-attribute-values-for-postgis-data-in-Feature-attribute-form-tp5195518p5195523.html
Sent from the Quantum GIS - Developer mailing list archive at
Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer








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



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Is it possible to: Print canvas without Composer and draw polygon in Composer?

2015-03-13 Thread Raymond Nijssen



On 13-03-15 10:32, Lene Fischer wrote:

Hi

I have got questions from users - which I can´t answer :-O



Hopefully some of you can...



·Is it possible to: Print/copy the canvas without Composer. Users need 
to insert the canvas in a mail or a document.


Project  Save as image...



·In the PrintComposer you can draw square, ellipse, ect - but can I 
draw a polygon?


I don't know but I would just  draw it on a memory layer.



Regards

Lene Fischer


Regards, Raymond

PS Shouldn't you ask this on the user list?



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



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] opening same table twice

2014-10-07 Thread Raymond Nijssen

Not sure if I met a feature or a bug...

I can open the same attribute table multiple times. I would expect, when 
I open it the second time, QGIS would just show/focus on the window 
containing the already opened table.


Is this meant to be this way?

Regards,
Raymond

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


Re: [Qgis-developer] opening same table twice

2014-10-07 Thread Raymond Nijssen

Hi Matthias,

What is the point of comparing two identical tables? If they have the 
same source, the contents must be the same. Or do you mean comparing 
different parts of the same table? In that case a split view would 
indeed solve the problem.


A disadvantage of opening the same table multiple times is that updating 
edits in all windows/tables will even be more complicate than it is now. 
(Already meeting bugs/inconsistencies sometimes.)


Raymond



On 07-10-14 14:35, Matthias Kuhn wrote:

Hi Raymond,

Just discussed this last week with Denis who thought that sometimes this
is intentional (comparing two tables).

We thought about having the possibility to have a split view on the
table. Once this is possible we could prevent the attribute table from
being opened several times for the same layer.

Opinions?
Matthias

On 07.10.2014 13:57, Raymond Nijssen wrote:

Not sure if I met a feature or a bug...

I can open the same attribute table multiple times. I would expect,
when I open it the second time, QGIS would just show/focus on the
window containing the already opened table.

Is this meant to be this way?

Regards,
Raymond

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





--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] opening same table twice

2014-10-07 Thread Raymond Nijssen




I think for smaller screens we can use tabs in the same window.
All the best.



Actually I expect a table would be split horizontally, dividing is in an 
upper and lower part. Both parts having their own scrollbar. Now you can 
scroll to row 1000 with one part and compare the values to the values on 
the other.


Right?
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Opinions on best implementation of color picker dialog?

2014-07-28 Thread Raymond Nijssen

Hi Nyall,

Good point!
I'd love to see at least the hex/html input so I can copy and paste 
colors instead of writing down the values for r, g, b and a.


Raymond

On 28-07-14 12:08, Nyall Dawson wrote:

Hi all,

I'm increasingly frustrated by QGIS' current color picker dialog - almost
enough to do something about it! So, I'm wondering if anyone has any
opinions on programs which get this right. There's almost as many variants
of color pickers as there are design programs... I see no reason why we
can't build our own custom one which matches the best of them out there.

In my opinion, the best I've seen is GIMP's design. (see
http://doc.opensuse.org/documentation/html/openSUSE_113/opensuse-apps/images/gimp-color.png
and
http://docs.gimp.org/en/gimp-dialogs-content.html ) The only thing I think
GIMP's dialog is missing is an alpha channel option. So, I think the
ultimate dialog would be something like GIMP's but with an Inkscape-style
alpha slider (see
http://lukast.mediablog.sk/i/colorchoosers/inkscape-color-chooser.png ).

Does anyone else have opinions on this?

Nyall



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



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Cannot use data-defined fill color with ellipse marker

2013-11-21 Thread Raymond Nijssen

Hi Anita,

It sounds similar to this issue:

http://hub.qgis.org/issues/6476

Maybe data-defined anything won't work on ellipse markers??

Regards,
Raymond




On 20-11-13 18:24, Anita Graser wrote:

Hi,

Is it a known issue that data-defined fill color does not work with 
ellipse marker? Whatever color I set there, the result is always 
black. I didn't find a ticket. Please let me know and I'll open one.


Best wishes,
Anita
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer



--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983

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


Re: [Qgis-developer] Plugin repo down

2013-09-23 Thread Raymond Nijssen

For me (back in NL) both qgis.org and the plugin repo are not available...

Though my url qgis.org is replaced by www.qgis.org/en/site/ in my 
browser (ff). Could the server just be too busy maybe?


Raymond


On 22-09-13 23:04, Borys Jurgiel wrote:

For me it's working again too.

Dnia niedziela, 22 września 2013 20:39:57 Tim Sutton pisze:

Its working for me - did someone fix it? I am about to get on my plane and
wont be able to look at it in the next 24 hours.

Regards

Tim

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


--
Terglobo
Ampèrestraat 110
5223 CT 's-Hertogenbosch
06-25314983

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

<    1   2   3   >