Re: [QGIS-Developer] Qt6: qgsspatialindex.sip: line 148: column 5: 'QgsSpatialIndex::intersects' has an unsupported return type

2024-05-31 Thread Germán Carrillo via QGIS-Developer
Hi Julien,

Thanks for the explanation!

Regards,

Germán


El mar, 28 may 2024 a las 10:34, Julien Cabieces (<
julien.cabie...@oslandia.com>) escribió:

>
> Hi German,
>
> If I believe the PR [0] I pushed 4 month ago, QList is now
> wrapped so there is no need to add it in conversions.sip
>
> If I remember correctly we can't add it back because we would get some
> type colliding on other system (fedora for instance). I fail to find exact
> reason of why we needed it before
> and we don't need it now, but I just remember it was the right things to
> do.
>
> Anyway, it seems to work on fedora, but there is something wrong on
> Debian that would need further investigation.
>
> Regards,
> Julien
>
>
> [0] https://github.com/qgis/QGIS/pull/55674
>
> > Hi Richard and Julien,
> >
> > Thanks a lot for sharing the steps to compile QGIS with Qt6 on Debian. I
> followed your steps on Ubuntu Noble (24.04) and I've been able to
> > reach this point that you're mentioning in this thread, namely:
> >
> > 'QgsSpatialIndex::intersects' has an unsupported return type - provide
> %MethodCode and a C++ signature
> > 'QgsSpatialIndex::nearestNeighbor' has an unsupported return type -
> provide %MethodCode and a C++ signature
> > 'QgsSpatialIndex::nearestNeighbor' has an unsupported return type -
> provide %MethodCode and a C++ signature
> > 'QgsAttributeTableView::selectedFeaturesIds' has an unsupported return
> type - provide %MethodCode and a C++ signature
> > ninja: build stopped: subcommand failed.
> >
> > For me, it has worked by bringing back the MethodCode removed at [1]
> (which dealt with QList). Namely, I copied these lines [2] to
> > python/PyQt6/core/conversions.sip and built QGIS again.
> >
> > After doing that, and after installing a couple of missing libs
> (pytho3-pyqt6.qtpositioning and pytho3-pyqt6.qtserialport), QGIS runs with
> Python
> > bindings enabled on Qt6.
> >
> > Julien, could this MethodCode be still needed for particular SIP
> versions? Could we bring back this MethodCode to
> > python/PyQt6/core/conversions.sip or what could be the recommended
> approach?
> >
> > Regards,
> >
> > Germán
> > 
> > [1]
> https://github.com/qgis/QGIS/pull/55674/commits/5711a69d26e980395529b56e8e3fa757fbfb5550
> > [2]
> https://github.com/qgis/QGIS/blob/895193f2dddb616cfd21c8cdde037b971f15aa32/python/core/conversions.sip#L1566-L1613
> >
> >
> > El mié, 31 ene 2024 a las 9:11, Richard Duivenvoorde via QGIS-Developer
> () escribió:
> >
> >  Hi,
> >
> >  My Qt6 (test) build stops with the following:
> >
> >  Generating the gui bindings...
> >  sip-build:
> /home/richard/git/qgisqt6/build/python/core/auto_generated/qgsspatialindex.sip:
> line 148: column 5:
> >  'QgsSpatialIndex::intersects' has an unsupported return type - provide
> %MethodCode and a C++ signature
> >
> /home/richard/git/qgisqt6/build/python/core/auto_generated/qgsspatialindex.sip:
> line 159: column 5: 'QgsSpatialIndex::nearestNeighbor'
> >  has an unsupported return type - provide %MethodCode and a C++ signature
> >
> /home/richard/git/qgisqt6/build/python/core/auto_generated/qgsspatialindex.sip:
> line 179: column 5: 'QgsSpatialIndex::nearestNeighbor'
> >  has an unsupported return type - provide %MethodCode and a C++ signature
> >
> /home/richard/git/qgisqt6/build/python/gui/auto_generated/attributetable/qgsattributetableview.sip:
> line 63: column 5:
> >  'QgsAttributeTableView::selectedFeaturesIds' has an unsupported return
> type - provide %MethodCode and a C++ signature
> >  ninja: build stopped: subcommand failed.
> >
> >  Is this my setup?
> >  Do others succeed in creating the python bindings?
> >
> >  python3-sip/testing,now 4.19.25+dfsg-5+b2 amd64 [installed]
> >  python3-pyqt6.sip/testing,now 13.6.0-1+b1 amd64 [installed,automatic]
> >  python3-sipbuild/testing,now 6.8.1+dfsg-1 all [installed,automatic]
> >
> >  Regards,
> >
> >  Richard Duivenvoorde
> >  ___
> >  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
>
>
> --
>
> Julien Cabieces
> Senior Developer at Oslandia
> julien.cabie...@oslandia.com
>


-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
https://twitter.com/GeoTux2 
___
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] Qt6: qgsspatialindex.sip: line 148: column 5: 'QgsSpatialIndex::intersects' has an unsupported return type

2024-05-27 Thread Germán Carrillo via QGIS-Developer
Hi Richard and Julien,


Thanks a lot for sharing the steps to compile QGIS with Qt6 on Debian. I
followed your steps on Ubuntu Noble (24.04) and I've been able to reach
this point that you're mentioning in this thread, namely:

'QgsSpatialIndex::intersects' has an unsupported return type - provide
%MethodCode and a C++ signature
'QgsSpatialIndex::nearestNeighbor' has an unsupported return type - provide
%MethodCode and a C++ signature
'QgsSpatialIndex::nearestNeighbor' has an unsupported return type - provide
%MethodCode and a C++ signature
'QgsAttributeTableView::selectedFeaturesIds' has an unsupported return type
- provide %MethodCode and a C++ signature
ninja: build stopped: subcommand failed.

For me, it has worked by bringing back the MethodCode removed at [1] (which
dealt with QList). Namely, I copied these lines [2] to
python/PyQt6/core/conversions.sip and built QGIS again.

After doing that, and after installing a couple of missing libs
(pytho3-pyqt6.qtpositioning
and pytho3-pyqt6.qtserialport), QGIS runs with Python bindings enabled on
Qt6.


Julien, could this MethodCode be still needed for particular SIP versions?
Could we bring back this MethodCode to python/PyQt6/core/conversions.sip or
what could be the recommended approach?


Regards,

Germán

[1]
https://github.com/qgis/QGIS/pull/55674/commits/5711a69d26e980395529b56e8e3fa757fbfb5550
[2]
https://github.com/qgis/QGIS/blob/895193f2dddb616cfd21c8cdde037b971f15aa32/python/core/conversions.sip#L1566-L1613


El mié, 31 ene 2024 a las 9:11, Richard Duivenvoorde via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> Hi,
>
> My Qt6 (test) build stops with the following:
>
> Generating the gui bindings...
> sip-build:
> /home/richard/git/qgisqt6/build/python/core/auto_generated/qgsspatialindex.sip:
> line 148: column 5: 'QgsSpatialIndex::intersects' has an unsupported return
> type - provide %MethodCode and a C++ signature
> /home/richard/git/qgisqt6/build/python/core/auto_generated/qgsspatialindex.sip:
> line 159: column 5: 'QgsSpatialIndex::nearestNeighbor' has an unsupported
> return type - provide %MethodCode and a C++ signature
> /home/richard/git/qgisqt6/build/python/core/auto_generated/qgsspatialindex.sip:
> line 179: column 5: 'QgsSpatialIndex::nearestNeighbor' has an unsupported
> return type - provide %MethodCode and a C++ signature
> /home/richard/git/qgisqt6/build/python/gui/auto_generated/attributetable/qgsattributetableview.sip:
> line 63: column 5: 'QgsAttributeTableView::selectedFeaturesIds' has an
> unsupported return type - provide %MethodCode and a C++ signature
> ninja: build stopped: subcommand failed.
>
> Is this my setup?
> Do others succeed in creating the python bindings?
>
> python3-sip/testing,now 4.19.25+dfsg-5+b2 amd64 [installed]
> python3-pyqt6.sip/testing,now 13.6.0-1+b1 amd64 [installed,automatic]
> python3-sipbuild/testing,now 6.8.1+dfsg-1 all [installed,automatic]
>
> Regards,
>
> Richard Duivenvoorde
> ___
> 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
>


-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
https://twitter.com/GeoTux2 
___
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] Regular paid positions for PR reviews

2023-12-08 Thread Germán Carrillo via QGIS-Developer
Hi All,

Thanks Alessandro for raising this.

First of all, thanks a lot to all PR reviewers for their outstanding work.

As an occasional QGIS contributor (for a long time), I've definitely
noticed a lack of PR reviewers lately. It'd be great if the QGIS
association could pay more core devs to participate in the review process.

Hopefully, that will reduce the number of PRs that go to 'Stale' status,
which might be a bit discouraging sometimes.
This is a topic we discussed with other QGIS contributors in the latest *QGIS
contributor meeting* in Vienna, and they had the same feeling.


Regards,

Germán


El vie, 8 dic 2023 a las 3:35, Alessandro Pasotti via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> On Fri, Dec 8, 2023 at 9:22 AM Andreas Neumann  wrote:
> >
> > Dear Alex,
> >
> > I support this idea. Code reviews are important.
> >
> > But I think we already do that - don't we? In 2023 there was this 14k €
> budget that is currently being distributed between the core devs who are
> actively reviewing on Github. Next year, we plan to increase this budget to
> 20k.
> >
> > Are we missing anything?
>
> I think the idea was to go from voluntary random PR review
> contributions to a regular commitment we can count upon.
>
> >
> > I am not sure if it is useful to dedicate an "exact" number of hours and
> a fixed rate. I'd rather have a fixed annual budget (like we already have)
> and distribute this among the core devs who actively participate in the
> reviews and discussions.
>
> That's exactly the point, some of us think it would be better the other
> way.
>
> >
> > We can formalize this a bit better if you want. I am open for
> suggestions how to improve the situation.
> >
> > Another idea is to merge the budgets for bug fixing and code reviewing -
> then the "approved" core devs can spend their hours on both bug fixing and
> reviewing and invoice everything together.
>
> No, I would say we keep it separate, I agree that during the
> bug-fixing time the participants can spend their time doing both
> bugfixing and PR reviews provided that the reviews are oriented to bug
> fixing/chores and not to new features.
>
> >
> > It is a really good timing to discuss this now - because we want to
> bring the 2024 budget to vote next week.
>
> I look forward to other developers' opinions.
>
> Kind regards.
>
> >
> > Greetings,
> > Andreas
> >
> > On Fri, 8 Dec 2023 at 08:57, Alessandro Pasotti via QGIS-Developer <
> qgis-developer@lists.osgeo.org> wrote:
> >>
> >> Hi,
> >>
> >> Recently I have had the opportunity to discuss with some core QGIS
> >> developers and we agreed that it would be a good idea if the QGIS
> >> organization could fund a few weekly or monthly hours for PR reviews.
> >>
> >> Here is my quick and initial proposal of requisites for the candidates:
> >>
> >> - must be an active well known and long time QGIS C++ core developer
> >> (for example from the top last 5 years committers [1])
> >> - ideally we'd need more than a single developer: there is not a
> >> single developer who is able to review all different areas of the code
> >> base
> >> - available for regular work (fixed number of weekly or monthly hours,
> >> to be determined)
> >>
> >> Note: the above list is just my quick ideas, feel free to suggest
> >> anything you think best.
> >>
> >>  I would like this topic to be added to the next PSC meeting agenda.
> >>
> >> Kind regards.
> >>
> >>
> >> [1]
> https://github.com/qgis/QGIS/graphs/contributors?from=2018-12-08=2023-12-08=c
> >>
> >> --
> >> Alessandro Pasotti
> >> QCooperative:  www.qcooperative.net
> >> ItOpen:   www.itopen.it
> >> ___
> >> QGIS-Developer mailing list
> >> QGIS-Developer@lists.osgeo.org
> >> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >
> >
> >
> > --
> >
> > --
> > Andreas Neumann
> > QGIS.ORG board member (treasurer)
>
>
>
> --
> Alessandro Pasotti
> QCooperative:  www.qcooperative.net
> ItOpen:   www.itopen.it
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>


-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
https://twitter.com/GeoTux2 
___
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] Paste geometry functionality

2023-11-29 Thread Germán Carrillo via QGIS-Developer
Hi Tomas,

  Let's say we have a layer L (PostgreSQL/PostGIS) with features A, B
>
> and C with corresponding attribute values set.
>   Now some external party sends us a shapefile S with an updated
> geometry G which we want to apply to feature B.
>   We want to:
>   1. Select G in layer S and press Ctrl+C
>   2. Select feature B in layer L (layer is in edit mode).
>   3. Do "Paste geometry" which should change geometry of feature B but
> leave all attribute values intact. This must be an update (not
> delete/insert) operation for record B in database table, as database
> would usually have different sequences, triggers with business logic
> etc.
>
>
Do you happen to have a common field in your layers L and S, which
allows you to know that geometry G goes to feature B?
If that's the case, you could apply all geometry updates at once, based on
this common field.

In its current version (v1.5.0), the plugin "Append Features To Layer" can
update features based on common field values (e.g., an ID or a code).
It'd be simple to add a "Only update geometries" option. I've just created
a feature request [1], feel free to join if you'd like to help testing a
dev version.


*Disclaimer: I wrote the plugin :)*

Regards,

Germán
---
[1] https://github.com/gacarrillor/AppendFeaturesToLayer/issues/22


El mié, 29 nov 2023 a las 13:52, Keith Jenkins via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> > I am aware of a python plugin for that but it does not work for
> > large geometries as clipboard size limit is reached pretty fast on
> > windows.
>
> Hi, Tomas.
>
> I just tested the "Geometry Paster" plugin and also ran into this
> clipboard size limit.  It looks like the code for the plugin tries to
> avoid this problem:
>
> csv.field_size_limit(sys.maxsize)
>
> But this doesn't seem to have the intended effect.  On my machine,
> sys.maxsize is 9223372036854775807, which appears to be too large for
> setting the csv.field_size_limit.  One workaround would be to open the
> QGIS Python console and set it manually to the maximum longint value:
>
> csv.field_size_limit(2147483647)
>
> It looks like there is already a pull request to fix this in the
> plugin, from just 3 days ago:
> https://github.com/nextgis/qgis_geometry_paster/pull/12/files
>
> Cheers,
> Keith
>
> On Tue, Nov 28, 2023 at 3:37 PM Tomas Straupis via QGIS-Developer
>  wrote:
> >
> > Hello
> >
> >   I was wondering, is there any reason why "paste geometry" (for
> > vector features) is not implemented in QGIS? Or is it simply because
> > nobody implemented it (I'm thinking of trying to do that)?
> >
> >   The use case is different government cadastres where geometry is
> > provided by external institutions and institution responsible for
> > maintaining the cadastre is adding the attribute values. While they
> > can use full feature paste (with attributes) for initial record
> > creation, updating requires the possibility to paste geometry only
> > without changing any attribute values.
> >
> >   Thank you
> >
> > P.S. I am aware of a python plugin for that but it does not work for
> > large geometries as clipboard size limit is reached pretty fast on
> > windows.
> >
> > --
> > Tomas
> > ___
> > 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
>


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


___
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 QgsGeometrySnapper does not snap to a source created inside a function

2023-10-20 Thread Germán Carrillo via QGIS-Developer
*> The underlying C++ code expects a pointer to the reference layer. If the
python wrapper just passes the pointer of the object that was created in
the call, the object will be out of scope after the function call returns
and will be garbage collected. Someone who actually knows the code details
can verify or contradict this.*

This makes sense to me.
In fact, the original code makes QGIS crash (using v3.28.6) with a
Segmentation Fault, indicating that the underlying C++ object has been
deleted.
That's why you should first create a Python variable to make it clear that
the layer object should persist in the outer scope.

Regards,

Germán


El vie, 20 oct 2023 a las 5:30, David Strip ()
escribió:

> On 10/19/2023 10:32 AM, Gabriel De Luca via QGIS-Developer wrote:
>
> Hi German,
>
>   Thanks. Yes, it works that way. Do you know why?
>
>
> Regards,
> Gabriel
>
>
> Since nobody who really knows the code has responded yet, I'll conjecture
> it's a scoping issue. The underlying C++ code expects a pointer to the
> reference layer. If the python wrapper just passes the pointer of the
> object that was created in the call, the object will be out of scope after
> the function call returns and will be garbage collected. Someone who
> actually knows the code details can verify or contradict this.
>


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


___
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 QgsGeometrySnapper does not snap to a source created inside a function

2023-10-19 Thread Germán Carrillo via QGIS-Developer
Hi Gabriel,

Does the result change if you first create a Python variable for storing
your new layer?
I mean:


*referenceSource = create_scratch_reference_layer()*
*snapper = QgsGeometrySnapper(referenceSource)*

instead of:

*snapper = QgsGeometrySnapper(*
*referenceSource=create_scratch_reference_layer()*
*)*

Regards,

Germán


El jue, 19 oct 2023 a las 14:46, Gabriel De Luca via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> Hello all,
>
>   I am working with the QgsGeometrySnapper pyqgis class, and have a
> problem to snap to a reference layer which is created inside a function
> (and returned by it).
>
>   The code shared at [1] prints:
>
> result =  10.09964 0, 9.90036 10.09964, 0 10,
> 0.10001 -0.10001))>
>
>   Which means that the geomPolygon was not snapped to the reference layer.
>   But, if uncomment the line 41, which adds the reference layer to the
> project, the code prints:
>
> result = 
>
>   So, for some reason, adding the reference layer to the project makes the
> snapper to work.
>
>   I want to ask you if you know why is this happening. Maybe I need to add
> something to make it work consistently.
>
>
> Regards,
> Gabriel
>
> [1] https://pastebin.com/raw/Y9v51ZMq
> ___
> 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
>


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


___
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] It is possible to protect qgisserver's wms service using authentication?

2023-07-20 Thread Germán Carrillo via QGIS-Developer
Hi Francisco,

I show in detail how to set up basic Apache authentication for QGIS Server
(using a Python plugin) in this post:

https://geotux.tuxfamily.org/2019/05/07/accediendo-a-datos-de-qgis-server-con-base-en-roles-de-usuario/


The post is in Spanish and is based on Windows, you would need to
find analogue configurations for Apache in the operating system you're
using, which should be doable.

I hope it helps.


Regards,

Germán



El mar, 11 jul 2023 a las 6:46, Francisco Danubio Salas Rosette via
QGIS-Developer () escribió:

> Thank you very much, I will take it into account for the qgisserver
> services that I want to give,
>
> Regards,
>
> El lun, 10 jul 2023 a las 11:25, Etienne Trimaille (<
> etienne.trimai...@gmail.com>) escribió:
>
>> Hi,
>>
>> It's something you can do in front of QGIS server. QGIS server is not
>> connected to any ACL system by default.
>>
>> Or you can write a QGIS server plugin to add the authentication :
>>
>> https://docs.qgis.org/3.28/en/docs/pyqgis_developer_cookbook/server.html#access-control-filters
>>
>> Or some open source webgis based on QGIS server are providing this
>> feature out of the box : Lizmap, QWC2,... and others as well
>>
>> Regards,
>>
>>
>>
>> Le ven. 7 juil. 2023 à 22:22, Francisco Danubio Salas Rosette via
>> QGIS-Developer  a écrit :
>>
>>> I have QGIS Server 3.22 running on a server with OS Debian 11, I can
>>> request the wms service from QGIS correctly, but at no time do I establish
>>> authentication credentials. Is it possible to configure QGISSERVER so that
>>> it is mandatory to add the authentication credentials?
>>> thank you so much.
>>>  Francisco
>>> ___
>>> 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
>


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


___
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] Adding a plugin collaborator

2023-06-22 Thread Germán Carrillo via QGIS-Developer
Hi All,


last year in Firenze I contacted Richard by e-mail, and asked Alessandro
personally what was the rationale of the "Owners" field.

I had this use case in mind: add a person as contributor to allow him/her
to upload plugin versions. The "Author" field was already filled with the
organization we worked for. For some reason, I could not add him/her as a
maintainer (perhaps the maintainer is a single person or the field doesn't
appear in the edit form), and the field "Owner" sounded as if I worked for
him/her, which was not the case.

After some discussion with Alessandro, he found a more precise term for
describing what the 'Owner' field is for: and the term is "Collaborator",
which did fit perfectly with my use case.

See the proposed change here: https://github.com/qgis/QGIS-Django/pull/254


Regards,

Germań


El jue, 22 jun 2023 a las 2:13, Richard Duivenvoorde via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> Or maybe... the 'author' string of the metadata.txt is used as is.
> If you leave it, it will probably use the name from your
> credentials/ldap.
> But if you add more names there, it will be shown in the plugin
> dialog(s)
>
> Regards,
>
> Richard
>
> On 2023-06-22 09:08, Richard Duivenvoorde via QGIS-Developer wrote:
> > On 2023-06-22 06:34, Nyall Dawson via QGIS-Developer wrote:
> >> Hi list,
> >>
> >> This is possibly a stupid question -- but how can I add additional
> >> users as collaborators to a plugin via https://plugins.qgis.org/?
> >>
> >> I can see other plugins which have done this, but can't see any
> >> settings exposed in my plugins which permit me to add collaborations
> >> myself.
> >
> > As admin it it possible to change 'owners'. That is if the ownership
> > changes, I (or other admins) can do that in the plugins.qgis.org site.
> >
> > For metadata fields:
> >
> https://docs.qgis.org/3.28/en/docs/pyqgis_developer_cookbook/plugins/plugins.html#metadata-txt
> >
> > Not sure what you mean with collaborator?
> > Can you give an example of such 'collaborator'?
> >
> > Or if you let me know, I dan make a person 'owner' too...
> >
> > Regards,
> >
> > Richard Duivenvoorde
> > ___
> > 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
>


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


___
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 read project from postgresql database

2023-05-12 Thread Germán Carrillo via QGIS-Developer
Hi,

what do you get if you run the following line on your QGIS Python console
in a QGIS session where your project (the one stored in PG) is loaded?

QgsProject.instance().fileName()

Regards,

Germán


El vie, 12 may 2023 a las 19:22, Alexandre Neto via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> Hi,
>
> I am trying to read a project that is stored in a postgreSQL/PostGIS
> database, but I am struggling with getting it correctly. I am using the
> following code
>
> project = QgsProject.instance()
> uri = 'postgresql://my_user:my_pass@localhost
> :5432?sslmode=disable=my_database=my_schema=my_project_name'
> project.read(uri)
>
> The last command always return false, and no project is loaded
>
> The documentation of QgsProject.read() only mentions filenames, not uri,
> but this answer seems to propose this uri format that would work:
>
> https://gis.stackexchange.com/a/354615/6191
>
> Any suggestions on how to solve or debug this? I get no error messages
> from the read method.
>
> Thanks,
>
> Aleandre Neto
> ___
> 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
>


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



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


Re: [QGIS-Developer] [Qgis-user] New community voting member

2023-04-24 Thread Germán Carrillo via QGIS-Developer
Congratulations Adelcides!
Well done!

Regards,

Germán

El lun, 24 abr 2023 a las 8:32, Peter Petrik via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> Hi Adelcides,
>
> welcome and wish you many good and wise decisions as the voting member :)
>
> Peter
>
>
>
>
>
> On Mon, Apr 24, 2023 at 2:44 PM Adelcides Varela via QGIS-User <
> qgis-u...@lists.osgeo.org> wrote:
>
>> It is with a great pleasure and sense of recognition that I receive this
>> special honour, particularly coming from a small african island nation with
>> a population under half a million.
>>
>> I hope with the help of all the community I will be able to do a good job.
>>
>> Best regards,
>> Adelcides Varela.
>>
>> Marco Bernasocchi via QGIS-User  escreveu no
>> dia segunda, 24/04/2023 à(s) 11:22:
>>
>>> Dear community,
>>> I'd like you to join me in welcoming Adelcides Varela as our newest
>>> community voting member.
>>>
>>> Adelcides is one of the admins of the QGIS Community - Official Virtual
>>> Group (which has almost 60K members) and has been key in helping
>>> various African QGIS communities.
>>>
>>> Thanks a lot, Adelcides for all you do and welcome!
>>>
>>> Please note that Adelcides was selected without the need for a ballot
>>> since he was the only candidate proposed by the community.
>>>
>>> Cheers Marco
>>>
>>> --
>>> Marco Bernasocchi
>>>
>>> QGIS.org Chair
>>> OPENGIS.ch CEO
>>> http://berna.io
>>> ___
>>> QGIS-User mailing list
>>> qgis-u...@lists.osgeo.org
>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>
>> ___
>> QGIS-User mailing list
>> qgis-u...@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>


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


___
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 how to append existing gpkg layer

2023-04-19 Thread Germán Carrillo via QGIS-Developer
Bonjour Sylvain,

J'espère que vous allez bien.


If you want to append features from a source layer to another layer that
already exists in a GPKG file, you can do this:

-
options = QgsVectorFileWriter.SaveVectorOptions()
options.driverName = "GPKG"
options.layerName = "my_existing_layer_name"  *# Write here the existing
layer name in the GPKG*
options.actionOnExistingFile = QgsVectorFileWriter.AppendToLayerNoNewFields
options.onlySelectedFeatures = True

path = "/tmp/existing_gpkg_file_path.gpkg"
layer = QgsVectorLayer("/tmp/my_source_layer.shp", "my source layer name",
"ogr")

result = QgsVectorFileWriter.writeAsVectorFormatV3(
layer,
path,  *# Existing GPKG file path*
layer.transformContext(),
options)
-


If on the contrary, you want to append a whole layer (with its own field
structure, crs, etc.) to an existing GPKG database, you can follow this
solution:

https://gis.stackexchange.com/a/417950


As you can see, the key is to define the options.actionOnExistingFile
property, whose possible values are well documented here:

https://api.qgis.org/api/3.28/classQgsVectorFileWriter.html#afda86eff21ac1da7dc42cbdde424acb1


*Note: SInce we're using writeAsVectorFormatV3(), you need at least QGIS
v3.20 for this solution to work.*


Regards,

Germán



El mié, 19 abr 2023 a las 3:55, PIERRE Sylvain via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> Hi dev and users
>
>
>
> I don’t understand how to append an existing gpkg layer with pyqgis.
>
> I’ve tried many QgsVectorFileWriter options
>
>
>
> self.options.actionOnExistingFile =
> QgsVectorFileWriter.CreateOrOverwriteLayer
>
>
>
> reset final layer
>
>
>
> And
>
> self.options.EditionCapability =
> QgsVectorFileWriter.CanAppendToExistingLayer
>
>
>
> does not change anything
>
>
>
> So what’s the good way to do this ?
>
>
>
> This is my code (I’m iterating over several other data sources)
>
> self.options = QgsVectorFileWriter.SaveVectorOptions()
>
> self.options.driverName = 'GPKG'
>
> self.options.onlySelectedFeatures = True
>
> self.options.layerName = 'parcelles'
>
>
>
> for dir in dirs:
>
> print(dir)
>
>
>
> if os.path.isdir(dir):
>
> db_GPKG = os.path.join(dir, 'MAEC2023.gpkg')
>
> if os.path.exists(db_GPKG):
>
> gpkg_layer = db_GPKG + "|layername=parcelles"
>
> RPG_layer = QgsVectorLayer(gpkg_layer, "RPG", "ogr")
>
>
>
> expr = (' "fk_mesure" is not null ')
>
> *#expr = ('"fk_mesure" = \'{}\'').format('MAEC
> Papillons')*
>
>
>
> RPG_layer.selectByExpression(expr)
>
> selected_feature = RPG_layer.selectedFeatures()
>
> print(len(selected_feature))
>
> if os.path.exists(self.db_GPKG): *# if the ouput file
> already exist*
>
> self.options.actionOnExistingFile =
> QgsVectorFileWriter.CreateOrOverwriteLayer
>
> *#self.options.actionOnExistingFile =
> QgsVectorFileWriter.AppendToLayerNoNewFields*
>
> *#self.options.actionOnExistingFile =
> QgsVectorFileWriter.AppendToLayerAddFields *
>
> self.options.EditionCapability =
> QgsVectorFileWriter.CanAppendToExistingLayer
>
> else:
>
> self.options.actionOnExistingFile =
> QgsVectorFileWriter.CreateOrOverwriteFile
>
>
>
> write_result, error_message =
> QgsVectorFileWriter.writeAsVectorFormatV2(RPG_layer, self.db_GPKG , self.
> context, self.options)
>
>
>
>
>
>
>
> Thanks
>
>
>
>
>
> Sylvain PIERRE
>
> Chef de projet système d’information
>
> Direction des Systèmes d’Information et du Développement Numérique
>
> Service Projets et Ingénierie Numérique
>
> *Collectivité européenne d’Alsace*
>
> Tél : 03 88 76 68 88
>
> sylvain.pie...@alsace.eu
>
> www.alsace.eu
>
> [image: facebook]  [image: twitter]
>  [image: insta]
> 
>
>
> ___
> 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
>


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


___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: 

Re: [QGIS-Developer] PyQGIS code: setting filter expression for value relation widget

2023-02-18 Thread Germán Carrillo via QGIS-Developer
Hi Andreas,


you can modify your Value Relation widget's filter expression using the
QgsEditorWidgetSetup class, in this way:

1) Get the editor widget setup and get a copy of its config dictionary:

ews = layer.editorWidgetSetup(3)  # *Let's assume your Value Relation
widget is set for a field with index 3*
new_config = ews.config()  # *We'll use the current config as a basis
to modify only the filter expression*

2) Modify the config dict's filter expression:

new_config['FilterExpression'] = 'your new expression'

3) Apply changes to your layer:

new_ews = QgsEditorWidgetSetup('ValueRelation', new_config)
layer.setEditorWidgetSetup(3, new_ews)  # *Remember that 3 corresponds
to the field index*

And that's it! You should have now a different set of values in the Value
Relation widget.


Regards,

Germán



El lun, 13 feb 2023 a las 5:40, Andreas Neumann via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> Hi,
>
> I am looking for a code snippet in PyQGIS: how can I change the filter
> expression for a value relation widget?
>
> Technically, the widget seems to be a QComboBox. I can get access to the
> combobox, e.g. to get the current value - but how can I access the QGIS
> related functionality, like changing programmatically settings of the value
> relation widget , such as the filter expression? I found the
> QgsValueRelationFieldFormatter object, but it doesn't allow me to change
> the filter expression. Any idea how I would change the filter expression
> using Python?
>
> Thank you for any hints,
>
> Andreas
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>

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


___
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] Skip loading plugin if errors

2022-12-28 Thread Germán Carrillo via QGIS-Developer
Hi Matteo,

I've added a few validations for this plugin to gently inform users of
missing dependencies:

https://github.com/SwissTierrasColombia/Asistente-LADM-COL/blob/master/asistente_ladm_col/__init__.py

Hope that helps.

Regards,

Germán


El mié, 28 dic 2022 a las 9:58, matteo via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> Hi devs,
>
> I'm developing a Processing provider plugin that needs some external
> python packages. If these are not installed on the system, when starting
> QGIS and loading the plugin the error message pops up (of course).
>
> Is there a way to have a "more friendly" message without opening the
> Stacktrace? For example creating a messagebox/bar with the message
> "Install the package.. else you cannot use the plugin"
>
> I've added a simple try/except in the plugin classFactory method but I'm
> still stuck in the loop somewhere.
>
> Thanks for any suggestion
>
> 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
>

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


___
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] createAlgorithmDialog in Processing script (within plugin)

2022-08-11 Thread Germán Carrillo via QGIS-Developer
Hi Matteo,

If you want and if you have the time, we could have a look at this issue at
the QGIS Contributors Meeting in Firenze :)

Regards!

Germán


El lun, 1 ago 2022 a las 17:07, matteo () escribió:

> Hi German,
>
> yes in your way it is working. But what if you try not with the
> algorithm/model id, but with an instance of the algorithm?
>
> In the docs I read "Either an instance of an algorithm, or an
> algorithm's ID", therefore I'm trying to set up an instance of my
> algorithm and then passing it to the method
>
> Cheers and thanks
>
> Matteo
>
> On 8/1/22 16:17, Germán Carrillo wrote:
> > Hi Matteo,
> >
> > I've been successfully using /execAlgorithmDialog()/ instead [0]:
> >
> > /processing.execAlgorithmDialog("my_provider:my_algorithm", params)/
> >
> > where, /params/ is a dict with the pre-filled values you have. You can
> > see an example at [1].
> >
> > Regards,
> >
> > Germán
> > ---
> > [0]
> >
> https://github.com/qgis/QGIS/blob/2d1aa68f0d044f2aced7ebeca8d2fa6b754ac970/python/plugins/processing/tools/general.py#L185
> <
> https://github.com/qgis/QGIS/blob/2d1aa68f0d044f2aced7ebeca8d2fa6b754ac970/python/plugins/processing/tools/general.py#L185
> >
> > [1]
> >
> https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/ladm_col_environment_add_on.py#L140
> <
> https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/ladm_col_environment_add_on.py#L140
> >
> >
> >
> > El lun, 1 ago 2022 a las 15:23, matteo via QGIS-Developer
> > ( > <mailto:qgis-developer@lists.osgeo.org>>) escribió:
> >
> > Hi all,
> >
> > I've a set of custom processing scripts within a plugin (that is both
> > "normal" and processing provider plugin).
> >
> > I'm trying to executing the dialog of these algorithm from one of the
> > main plugin file. I found the processing.createAlgorithmDialog [0],
> but
> > it is constantly crashing when I'm passing the instance of the
> > algorithm:
> >
> > my_alg = MyCustomAlg()
> > my_dialog = my_alg.createAlgorithmDialog(custom_dict)
> >
> > ## crash here
> >
> > Thinking it was a problem of the threads I also tried to overwrite
> the
> > `flag` method in the algorithm by setting also
> > QgsProcessingAlgorithm.FlagNoThreading but with the same results.
> >
> > I know I can run the processing algorithm with processing.run()
> but
> > I need to open the dialog pre-filled with custom parameters and to
> get
> > also some other outputs besides the standard ones (like the
> > QgsFeatureSink path)
> >
> > Thanks for any suggestion
> >
> > Cheers
> >
> > Matteo
> >
> >
> > [0]
> >
> https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/general.py#L155
> <
> https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/general.py#L155
> >
> >
> > ___
> > QGIS-Developer mailing list
> > QGIS-Developer@lists.osgeo.org  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>
> >
> >
> >
> > --
> > ---
> > |\__
> > (:>__)(
> > |/
> > Soluciones Geoinformáticas Libres
> > http://geotux.tuxfamily.org/ <http://geotux.tuxfamily.org/>
> > https://twitter.com/GeoTux2 <http://twitter.com/GeoTux2>
> >
> > <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
>


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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] createAlgorithmDialog in Processing script (within plugin)

2022-08-01 Thread Germán Carrillo via QGIS-Developer
Hi Matteo,

I've been successfully using *execAlgorithmDialog()* instead [0]:

*processing.execAlgorithmDialog("my_provider:my_algorithm", params)*

where, *params* is a dict with the pre-filled values you have. You can see
an example at [1].

Regards,

Germán
---
[0]
https://github.com/qgis/QGIS/blob/2d1aa68f0d044f2aced7ebeca8d2fa6b754ac970/python/plugins/processing/tools/general.py#L185
[1]
https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/ladm_col_environment_add_on.py#L140


El lun, 1 ago 2022 a las 15:23, matteo via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> Hi all,
>
> I've a set of custom processing scripts within a plugin (that is both
> "normal" and processing provider plugin).
>
> I'm trying to executing the dialog of these algorithm from one of the
> main plugin file. I found the processing.createAlgorithmDialog [0], but
> it is constantly crashing when I'm passing the instance of the algorithm:
>
> my_alg = MyCustomAlg()
> my_dialog = my_alg.createAlgorithmDialog(custom_dict)
>
> ## crash here
>
> Thinking it was a problem of the threads I also tried to overwrite the
> `flag` method in the algorithm by setting also
> QgsProcessingAlgorithm.FlagNoThreading but with the same results.
>
> I know I can run the processing algorithm with processing.run() but
> I need to open the dialog pre-filled with custom parameters and to get
> also some other outputs besides the standard ones (like the
> QgsFeatureSink path)
>
> Thanks for any suggestion
>
> Cheers
>
> Matteo
>
>
> [0]
>
> https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/general.py#L155
>
> ___
> 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
>


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


___
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] [Plugins]: is 'plugin_dependencies' being enforced somewhere?

2022-03-29 Thread Germán Carrillo via QGIS-Developer
Hi Richard,


see the first part of the answer to "Using QGIS plugin from another plugin"
at GIS.SE [1]

In short, you need to use the independent plugin's name from metadata.txt
(i.e., "name" field) in your dependent plugin's "plugin_dependencies" field.


For instance, the plugin "LADM-COL add-on Ambiente" depends on "Asistente
LADM-COL" (see name field of the latter in [2]). So I need to use
"Asistete LADM-COL" in the plugin_dependecies field of "LADM-COL add-on
Ambiente", like this [3].


Note you may declare a specific version in plugin_dependencies, but keep in
mind that so far this only works if the specified version is the latest
stable or the latest experimental one. Older versions won't be installed by
plugin installer.


Let me know if it's still unclear.


Regards,

Germán

[1]
https://gis.stackexchange.com/questions/403501/using-qgis-plugin-from-another-plugin
[2]
https://github.com/SwissTierrasColombia/Asistente-LADM-COL/blob/master/asistente_ladm_col/metadata.txt#L2
[3]
https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/metadata.txt#L11


El mar, 29 mar 2022 a las 2:19, Alessandro Pasotti via QGIS-Developer (<
qgis-developer@lists.osgeo.org>) escribió:

> Hi Richard,
>
> it is (was?) enforced by the installer, AFAIK there are no checks on the
> plugins website.
>
> See:
> https://github.com/qgis/QGIS/blob/master/python/pyplugin_installer/plugindependencies.py
>
> Cheers
>
>
> On Tue, Mar 29, 2022 at 9:02 AM Richard Duivenvoorde via QGIS-Developer <
> qgis-developer@lists.osgeo.org> wrote:
>
>> Hi Devs,
>>
>> Reading
>>
>> https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/plugins/plugins.html#plugin-metadata
>>
>> about 'plugin_dependencies' and trying it out in a plugin locally, it
>> does not seem to be enforced or so? I added another plugin in metadata
>> (it's not clear from docs what name you need to use: plugin name or
>> module name) thinking I would see some message somewhere.
>>
>> Is there some message on plugins.qgis.org?
>>
>> Or is it just a 'memo' for users who happen to see it in the metadata of
>> a plugin, then a dev should notify the user theirselves?
>>
>> Thanks for any info,
>>
>> Regards,
>>
>> Richard Duivenvoorde
>> ___
>> QGIS-Developer mailing list
>> QGIS-Developer@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
>
> --
> Alessandro Pasotti
> QCooperative:  www.qcooperative.net
> ItOpen:   www.itopen.it
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>

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



___
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] Specifying minimum Qt version for plugin?

2022-01-12 Thread Germán Carrillo
Hallo Johannes,

here you have an example of version checks in the *classFactory()* itself
(file *__init__.py* of your plugin).

https://github.com/SwissTierrasColombia/Asistente-LADM-COL/blob/master/asistente_ladm_col/__init__.py

Regards,

Germán ( *mit Akzent :) *)


El mié, 12 ene 2022 a las 10:52, Johannes Kröger (WhereGroup) (<
johannes.kroe...@wheregroup.com>) escribió:

> Hey Matthias,
>
> that is an interesting idea. Is there an overview of the official builds'
> versions and Qt versions somewhere? For now I decided to check the Qt
> version in the plugin's run method. It's not the best as the user will only
> find out when they want to run it, but it is only meant as a temporary fix
> anyways.
>
> Thanks, Hannes
> Am 11.01.22 um 17:31 schrieb Matthias Kuhn:
>
> Hi Hannes,
>
> There is no such thing available currently.
> If you know which OS your users run on you can use the QGIS version as an
> indicator.
>
> Matthias
>
> On Tue, Jan 11, 2022 at 5:18 PM Johannes Kröger (WhereGroup) <
> johannes.kroe...@wheregroup.com> wrote:
>
>> Hi list,
>>
>> is there a way to specify the minimum Qt version for a plugin? I saw
>> nothing in metadata.txt which would be the preferrable way because
>> otherwise I'd need to throw a dialog into the user's face after
>> installing. :\
>>
>> Thanks, Hannes
>>
>> --
>> Johannes Kröger / GIS-Entwickler/-Berater
>> WhereGroup GmbH
>> Grevenweg 89
>> 20537 Hamburg
>> Germany
>>
>> Tel: +49 (0)228 / 90 90 38 - 36
>> Fax: +49 (0)228 / 90 90 38 - 11
>>
>> johannes.kroe...@wheregroup.com
>> www.wheregroup.com
>> Geschäftsführer:
>> Olaf Knopp, Peter Stamm
>> Amtsgericht Bonn, HRB 9885
>> ---
>>
>> -
>> Schon gewusst?
>> In unserem Blog geben wir Tipps & Tricks zu Open-Source-GIS-Software
>> und berichten aus unserem Experten-Alltag:
>> https://wheregroup.com/blog/
>> -
>>
>> ___
>> 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
>>
> --
> Johannes Kröger / GIS-Entwickler/-Berater
> WhereGroup GmbH
> Grevenweg 89
> 20537 Hamburg
> Germany
>
> Tel: +49 (0)228 / 90 90 38 - 36
> Fax: +49 (0)228 / 90 90 38 - 11
> johannes.kroe...@wheregroup.comwww.wheregroup.com
> Geschäftsführer:
> Olaf Knopp, Peter Stamm
> Amtsgericht Bonn, HRB 9885
> ---
>
> -
> Schon gewusst?
> In unserem Blog geben wir Tipps & Tricks zu
 Open-Source-GIS-Software
> und berichten aus unserem Experten-Alltag:https://wheregroup.com/blog/
> -
>
> ___
> 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
>


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


___
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] Run python script whit QProcess and show into textEdit the result in realtime

2021-09-26 Thread Germán Carrillo
Hi,

it might be useful for you to have a look at how QgisModelBaker does it:

https://github.com/opengisch/QgisModelBaker/blob/master/QgisModelBaker/libili2db/iliexecutable.py#L139-L185

Regards,

Germán


El dom, 26 sept 2021 a las 5:28, Enzo Cocca () escribió:

> I wolud print the result during my script run via Qprocess but nothing
> happen. I thinking I wrote wrong the args into process start but im not
> sure. Some one has an idea? Below my code
>
> class TotalopenstationDialog(QtWidgets.QDialog, FORM_CLASS):
>
> def __init__(self, parent=None):
> """Constructor."""
> super(TotalopenstationDialog, self).__init__(parent)
> self.setupUi(self)
>
> def dataReady(self):
> cursor = self.textEdit.textCursor()
> cursor.movePosition(cursor.End)
> cursor.insertText(str(self.process.readAll()))
> self.textEdit.ensureCursorVisible()
>
> def callProgram(self):
> # run the process
> # `start` takes the exec and a list of arguments
> python_path = sys.exec_prefix
> python_version = sys.version[:3]
> p = '{}\python'.format(python_path)
> b=QgsApplication.qgisSettingsDirPath().replace("/","\\")#this one 
> works for windows path
> cmd = os.path.join(os.sep, b, 'python', 'plugins', 
> 'totalopenstationToQgis',
> 'scripts', 'totalopenstation-cli-parser.py')
> self.process = QProcess(self)
> # QProcess emits `readyRead` when there is data to be read
> self.process.readyRead.connect(self.dataReady)
> self.process.start(p, [cmd, 
> '-i',str(self.lineEdit_input.text()),'-o',str(self.lineEdit_output.text()),'-f',self.comboBox_format.currentText(),'-t',self.comboBox_format2.currentText(),'--overwrite'])
>
> def on_pushButton_connect_pressed(self):
> self.callProgram()
>
>
> --
> Enzo Cocca PhD
> in "Science and Technology for Archaeology and Cultural Heritage"
>
> ISMEO
> International Association of Mediterranean and Oriental Studies
>
>
> mail: enzo@gmail.com
> cell: +393495087014
>
> ___
> 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
>


-- 
---
  |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
https://twitter.com/GeoTux2 
___
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] process bar in processing algs

2021-07-20 Thread Germán Carrillo
Hi Pierluigi,


you need to create your own *feedback* object and connect its
*progressChanged* SIGNAL to your progressbar's *setValue* SLOT, in this way:


feedback = QgsProcessingFeedback()
feedback.progressChanged.connect(progressBarGrid.setValue)

params_creategrid = {
# Set key-value parameters
}
result_grid = processing.run("native:creategrid", params_creategrid,
feedback=feedback)


Source: https://gis.stackexchange.com/a/348588/4972


Regards,

Germán

El mar, 20 jul 2021 a las 4:52, matteo () escribió:

> Hi Pierluigi,
>
>
> > can you please explain me better?
> > I have self plugin that in particular part use this code
> >
> > result_grid = processing.run("native:creategrid", params_creategrid)
>
> as explained by Prem, if you want to add the progress when you call a
> "native" algorithm of QGIS within your algorithm, then you can pass to
> the algorithm parameters:
>
> result_grid = processing.run("native:creategrid", params_creategrid,
> context=context, feedback=feedback)
>
> be aware also at the `is_child` parameter. Have a look at the example:
>
>
> https://docs.qgis.org/3.4/en/docs/user_manual/processing/scripts.html#extending-qgsprocessingalgorithm
>
> if you want to add steps to the progressBar with your logic then you can
> use feedback.setProgress(number) to fill the progress bar. Have a look
> at the template script and you will find a fine usage
>
> Hope this helps
>
> 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
>


-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
https://twitter.com/GeoTux2 
___
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] Appending Features to a layer

2020-05-13 Thread Germán Carrillo
Hi Luis,

if you are fine with a plugin solution, then there is one called "Append
Features to Layer" [1] that adds a new algorithm to QGIS Processing.

If you run it once via Processing Toolbox, then in the Processing History
you'll get the Python command, which you could use in your code to append
features to layers.


BTW, QGIS Processing will come with an append features to existing layer
out-of-the-box. It's planned for QGIS 3.14. See it in action [2].


Regards,

Germán
---
[1] https://github.com/gacarrillor/AppendFeaturesToLayer/
[2] https://github.com/qgis/QGIS/pull/35641

El mié., 13 may. 2020 a las 6:25, Jorge Gustavo Rocha ()
escribió:

> Hola Luís,
>
> The options are quite simple. You can see them in this SO question:
>
> https://gis.stackexchange.com/questions/87404/how-to-write-a-new-layer-to-postgresql-from-qgis-plugin/360270#360270
>
> You should create a temporary layer with the original one, plus the
> features you want to append. Then you write it to the database.
>
> Does it help?
>
> Regards,
>
> Jorge Gustavo
>
> On 13/05/20 11:57, Luís Miguel Royo Pérez wrote:
> > Hi all,
> > I'm seeking a way to append features to a layer when exporting into a
> > PostGIS layer.
> >
> > For now I'm using the tool QgsVectorLayerExporter.
> >
> > I'm doing something like this
> >
> > QgsVectorLayerExporter(uri, "postgres", fields, layer.wkbType(),
> > utils().crs, overwrite,{}).addFeatures([feat for feat in
> > layer.getFeatures()])
> >
> > Inside the curly brackets I know I can place the options, but I can't
> > find where are these options documented. Or wether these options can
> > help me in my task of append features to a QGIS layer.
> >
> > Can anyone point me in the right direction in this task of appending
> > features?
> >
> > Kind regards.
> > --
> > Luís Miguel Royo Pérez.
> > Analista-Programador GIS
> > C/ Antic Regne de Valencia nº 4. Manises (Valencia)
> > Teléfono:+34  679846103
> > webs:
> > inisig.com 
> > geofibra.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
> >
>
> J. Gustavo
> --
> Jorge Gustavo Rocha
> Departamento de Informática
> Universidade do Minho
> 4710-057 Braga
> Gabinete 3.29 (Piso 3)
> Tel: +351 253604480
> Fax: +351 253604471
> Móvel: +351 910333888
> skype: nabocudnosor
> ___
> 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



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


___
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] EditInPlace Processing script

2020-04-23 Thread Germán Carrillo
Hi Matteo,

the sample script I mentioned in my previous e-mail in this thread
should be working on master now. Nyall fixed the bug reported.

Regards,

Germán

El mar., 21 abr. 2020 a las 1:45, matteo ()
escribió:

> Hi Stefanos,
>
> yep, but digging into this I was wondering how to use the EditInPlace
> also for scripts :)
>
> Cheers and thanks for the hint
>
> 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


-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres 

https://twitter.com/GeoTux2 

Grupo de Usuarios QGIS Colombia 

https://twitter.com/qgiscolombia
___
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] EditInPlace Processing script

2020-04-18 Thread Germán Carrillo
Hi Matteo,

confirmed! Then, we've found a bug:

https://github.com/qgis/QGIS/issues/35844

Regards,

Germán

El vie., 17 abr. 2020 a las 2:29, matteo ()
escribió:

> Hola Germàn,
>
> thanks for the hint. While it is perfectly working on QGIS 3.10
> installed from repository. QGIS is crashing with the same data and the
> same script in QGIS master (compiled yesterday). Are there any API
> problems?
>
> Cheers and thanks!
>
> Matteo
>

-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres 

https://twitter.com/GeoTux2 

Grupo de Usuarios QGIS Colombia 

https://twitter.com/qgiscolombia
___
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] EditInPlace Processing script

2020-04-14 Thread Germán Carrillo
Hi Matteo,

yes, it's possible to write custom Processing scripts for editing layers
in-place.

Here you can find an example (buffer):
https://github.com/gacarrillor/QGIS-Resources/blob/master/collections/processing_scripts/processing/processing_script_edit_in_place.py

>From the example we can see:

   - We need to set the QgsProcessingAlgorithm.FlagSupportsInPlaceEdits
   flag for our algorithm.
   - It's not required that our algorithm inherits from
   QgsProcessingFeatureBasedAlgorithm for it to support edit-in-place[*].
   - The supportInPlaceEdit() method allows us to specify for which layers
   our algorithm can be offered as edit-in-place.

Regards,

Germán

[*] As a demo, the buffer example is OK. However, since each feature
generates a new feature without needing other source features, the buffer
example could also be written as a QgsProcessingFeatureBasedAlgorithm. :)

El mar., 14 abr. 2020 a las 3:22, matteo ()
escribió:

> Hi Arnaud,
>
> I explored the QgsProcessingFeatureBasedAlgorithm but unfortunately is
> not the case of what I'm looking for. From what I understood
> QgsProcessingFeatureBasedAlgorithm is the class to use when the
> algorithm performs "feature-by-feature" operations like buffers.
>
> In my case I would like to "change" the geometry of the input layer
> (union and dissolve).
>
> Cheers and thanks for the input anyway!
>
> 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



-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres 

https://twitter.com/GeoTux2 

Grupo de Usuarios QGIS Colombia 

https://twitter.com/qgiscolombia
___
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] Avoid running a Processing algorithm twice by accident

2020-02-21 Thread Germán Carrillo
Hi all,

would you like to vote about a small adjustment after running Processing
algorithms in QGIS?

https://github.com/qgis/QGIS/issues/34484

Regards,

Germán
-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
https://twitter.com/GeoTux2 
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] [Qgis-user] QGIS Voting Member Ballot Results

2019-02-19 Thread Germán Carrillo
Well deserved!
Congratulations Hugo!

Regards,

Germán

El mar., 19 feb. 2019 a las 14:41, Marco Bernasocchi ()
escribió:

> It is with great pleasure that I'd like to announce our latest community
> voting member Hugo Mercier.
>
> Thanks to everybody for voting and thanks already Hugo for your commitment.
>
> Here you can find the votes summaries:
>
>
> https://docs.google.com/spreadsheets/d/1ycJPCu9ylVKC9hefBx_BIi5yxrcLlYPwFCUwTvzHikI/edit?usp=sharing
>
> Cheers
>
> Marco
>
> --
> Marco Bernasocchi
>
> QGIS.org Co-chair
> http://berna.io
>
> ___
> Qgis-user mailing list
> qgis-u...@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] (Native) Difference algorithm not working with MultiPoints on Windows

2018-06-13 Thread Germán Carrillo
Hi,

just to comment that indeed, updating GEOS to v3.6.1 (available now in
OSGeo4W) fixed the Difference algorithm. Now it works with multipoins
as well!

I hope the weekly QGIS installer (i.e., the .exe available in QGIS
downloads) gets updated for next Monday, since the current one
(latests Monday) does not include an updated GEOS yet.


Regards,

Germán

2018-05-30 2:27 GMT-05:00 andreaerdna :
>
> Nyall Dawson wrote
> > Maybe related to the GEOS version in use?
>
>
> Germán Carrillo-2 wrote
> > On Windows:      GEOS v3.5.0-CAPI-1.9.0 r4084
> > On GNU/Linux:   GEOS v3.5.1-CAPI-1.9.1 r4246
> > Looking at the GEOS changelog for v3.5.1 there is indeed a fix for
> > multipoints. However, OSGeo4W stilll offers up to v3.5.0.
>
> It seems not related to GEOS version, or at least not only.
> On Windows 7 64 bit I can reproduce the bug in QGIS 3.1.0-Master (rev.
> 310bfb1e3e) with GEOS 3.5.0-CAPI-1.9.0 r4084 but not in QGIS 2.18.19 with
> the same GEOS version.
>
>
>
>
>
> -
> Andrea Giudiceandrea
> --
> 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




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

[image]
___
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] (Native) Difference algorithm not working with MultiPoints on Windows

2018-05-28 Thread Germán Carrillo
On Windows:  GEOS v3.5.0-CAPI-1.9.0 r4084
On GNU/Linux:   GEOS v3.5.1-CAPI-1.9.1 r4246

Looking at the GEOS changelog for v3.5.1 there is indeed a fix for
multipoints. However, OSGeo4W stilll offers up to v3.5.0.

I'll keep an eye on such coming update and report back to this list.


Thanks!

Germán



2018-05-28 18:44 GMT-05:00 Nyall Dawson :

> On 29 May 2018 at 05:10, Germán Carrillo 
> wrote:
> >
> > Hi,
> >
> >
> > just open an issue [1] regarding the (native) Difference algorithm on
> Windows for multipoint geometries.
> >
> > You could replicate it creating one multipoint layer and adding one
> point to it. Running the difference algorithm wiith such layer as both
> input and difference parameters should return an empty layer, but it
> doesn't, returning instead the same input point.
> >
> > Nonetheless, on GNU/Linux the algorithm works as expected.
>
> Maybe related to the GEOS version in use? Could you check what it is
> on both platforms (via the about screen).
>
> Nyall
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] (Native) Difference algorithm not working with MultiPoints on Windows

2018-05-28 Thread Germán Carrillo
Hi,


just open an issue [1] regarding the (native) Difference algorithm on
Windows for multipoint geometries.

You could replicate it creating one multipoint layer and adding one point
to it. Running the difference algorithm wiith such layer as both input and
difference parameters should return an empty layer, but it doesn't,
returning instead the same input point.

Nonetheless, on GNU/Linux the algorithm works as expected.


Regards,

Germán
-- 
[1] https://issues.qgis.org/issues/19049

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


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

Re: [QGIS-Developer] Can we remove a confirmation dialog in Refactor Fields algorithm?

2018-04-26 Thread Germán Carrillo
Hi Arnaud,


the videos I included in the first message of this thread were recorded
using QGIS master. So, probably the PR you mentioned (which was merged in
2017) didn't fully fix it, since this specific dialog is still showing up
when closing the project.


Regards,

Germán

2018-04-26 3:58 GMT-05:00 Arnaud Morvan <arnaud.mor...@camptocamp.com>:

> Hello Germán
>
> Note that I've already fixed some related problems with
> https://github.com/qgis/QGIS/pull/4964
>
> Calling deleteLater should delete the dialog on next events processing.
> Do dialog and child widgets signals should be correctly disconnected.
>
> Arnaud
>
>
>
> Le 25/04/2018 à 16:55, Germán Carrillo a écrit :
>
> Hi All,
>
>
> In the Refactor Fields algorithm dialog there is an "Input layer" combo
> box. Each time the user selects one layer a modal dialog (message box)
> appears, letting her select whether the fields mapping should be reset or
> not. See image: [1].
>
>
> I'd like to ask you if we can get rid of such modal dialog for these
> reasons:
>
>
> 1) In general, it's good to avoid modal dialogs as they block workflows
> and hamper interaction.
>
> 2) Other algorithms don't use such dialog to warn users about potential
> changes in other widgets (e.g., field combo boxes dependng on the selected
> layer).
>
> 3) The dialog is only *useful* if the user clicks on the combo box by
> accident and wants to avoid resetting the mapping (a very specific use
> case). However, in that case the combo box shows that a new layer is
> selected, but the mapping won't correspond to it, which is confusing.
>
> 4) Follow these steps:
>
>   a. Open QGIS and load a vector layer.
>   b. Open the Refactor Fields dialog and press ESC to close it.
>   c. Add another vector layer to QGIS.
>   d. Close the QGIS project.
>
> As soon as you close the project (e.g., when you want to start a new one)
> the modal  dialog shows up :(  (see this short video [2]).
>
> 5) The dialog is triggered too many times when using the "Fields Mapper"
> widget in a custom Processing model (and triggering it from a plugin) (see
> this short video [3]).
>
>
>
> So, the question for you is: Can we get rid of it? I've created a PR for
> that :D [4].
>
>
> Regards,
>
> Germán
> ---
> [1] http://downloads.tuxfamily.org/tuxgis/tmp/ai/reset_field_mapping.png
> [2] http://downloads.tuxfamily.org/tuxgis/tmp/ai/
> gif_refactor_fields_qgis.mp4
> [3] http://downloads.tuxfamily.org/tuxgis/tmp/ai/gif_
> refactor_fields_plugin.mp4
> [4] https://github.com/qgis/QGIS/pull/6857
> --
> ---
>|\__
> (:>__)(
>|/
> Soluciones Geoinformáticas Libres
> http://geotux.tuxfamily.org/
> http://twitter.com/GeoTux2
> http://about.me/germancarrillo
>
> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
>
>
> ___
> QGIS-Developer mailing listqgis-develo...@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
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] Can we remove a confirmation dialog in Refactor Fields algorithm?

2018-04-25 Thread Germán Carrillo
Hi All,


In the Refactor Fields algorithm dialog there is an "Input layer" combo
box. Each time the user selects one layer a modal dialog (message box)
appears, letting her select whether the fields mapping should be reset or
not. See image: [1].


I'd like to ask you if we can get rid of such modal dialog for these
reasons:


1) In general, it's good to avoid modal dialogs as they block workflows and
hamper interaction.

2) Other algorithms don't use such dialog to warn users about potential
changes in other widgets (e.g., field combo boxes dependng on the selected
layer).

3) The dialog is only *useful* if the user clicks on the combo box by
accident and wants to avoid resetting the mapping (a very specific use
case). However, in that case the combo box shows that a new layer is
selected, but the mapping won't correspond to it, which is confusing.

4) Follow these steps:

  a. Open QGIS and load a vector layer.
  b. Open the Refactor Fields dialog and press ESC to close it.
  c. Add another vector layer to QGIS.
  d. Close the QGIS project.

As soon as you close the project (e.g., when you want to start a new one)
the modal  dialog shows up :(  (see this short video [2]).

5) The dialog is triggered too many times when using the "Fields Mapper"
widget in a custom Processing model (and triggering it from a plugin) (see
this short video [3]).



So, the question for you is: Can we get rid of it? I've created a PR for
that :D [4].


Regards,

Germán
---
[1] http://downloads.tuxfamily.org/tuxgis/tmp/ai/reset_field_mapping.png
[2]
http://downloads.tuxfamily.org/tuxgis/tmp/ai/gif_refactor_fields_qgis.mp4
[3]
http://downloads.tuxfamily.org/tuxgis/tmp/ai/gif_refactor_fields_plugin.mp4
[4] https://github.com/qgis/QGIS/pull/6857
-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
http://about.me/germancarrillo


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

Re: [QGIS-Developer] Awating plugin review...

2018-04-03 Thread Germán Carrillo
Thank you Paolo!

Regards,

Germán

2018-04-03 6:04 GMT-05:00 Tim Sutton <t...@kartoza.com>:

> Admire can you please check the plugin review queue at least once a day?
>
> Thanks!
>
> Tim
>
> On 03 Apr 2018, at 12:57, Paolo Cavallini <cavall...@faunalia.it> wrote:
>
> Hi all.
> Sorry, I asked Admire from Kartoza to help me in this period, he might
> have overlooked this one.
> Done now.
> Thanks for your patience.
>
> Il 3 aprile 2018 00:30:02 GMT-04:00, "Germán Carrillo" <
> carrillo.ger...@gmail.com> ha scritto:
>>
>> It seems it's not Paolo who is approving plugins lately, but
>> zimbogisgeek.
>>
>> 2018-04-02 23:11 GMT-05:00 Nyall Dawson <nyall.daw...@gmail.com>:
>>
>>> On 3 April 2018 at 13:40, Germán Carrillo <carrillo.ger...@gmail.com>
>>> wrote:
>>> >
>>> > And it's a great work he does!
>>> >
>>> > I've seen other plugin approvals recently, so i guess the whole
>>> process doesn't stop if a person is on holiday.
>>>
>>> Heh... it's open source work -- nobody ever really FULLY tunes-out
>>> unless we're forced to by going camping in a forest or somewhere
>>> there's no mobile reception!
>>>
>>> Nyall
>>>
>>
>>
>>
>> --
>> ---
>>|\__
>> (:>__)(
>>|/
>> Soluciones Geoinformáticas Libres
>> http://geotux.tuxfamily.org/
>> http://twitter.com/GeoTux2
>> http://about.me/germancarrillo
>>
>> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
>>
>
> --
> 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
>
>
> —
>
>
>
>
>
>
> *Tim Sutton*
>
> *Co-founder:* Kartoza
> *Project chair:* QGIS.org
>
> Visit http://kartoza.com to find out about open source:
>
> Desktop GIS programming services
> Geospatial web development
> GIS Training
> Consulting Services
>
> *Skype*: timlinux
> *IRC:* timlinux on #qgis at freenode.net
>
>


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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] Awating plugin review...

2018-04-02 Thread Germán Carrillo
It seems it's not Paolo who is approving plugins lately, but zimbogisgeek.

2018-04-02 23:11 GMT-05:00 Nyall Dawson <nyall.daw...@gmail.com>:

> On 3 April 2018 at 13:40, Germán Carrillo <carrillo.ger...@gmail.com>
> wrote:
> >
> > And it's a great work he does!
> >
> > I've seen other plugin approvals recently, so i guess the whole process
> doesn't stop if a person is on holiday.
>
> Heh... it's open source work -- nobody ever really FULLY tunes-out
> unless we're forced to by going camping in a forest or somewhere
> there's no mobile reception!
>
> Nyall
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] Awating plugin review...

2018-04-02 Thread Germán Carrillo
And it's a great work he does!

I've seen other plugin approvals recently, so i guess the whole process
doesn't stop if a person is on holiday.

Also, a core developer suggested Paolo to grant me approval permissions,
with no success.

But, of course, I can wait, just wanted to make this case public.


Regards,

Germán

2018-04-02 22:23 GMT-05:00 Nyall Dawson <nyall.daw...@gmail.com>:

> On 3 April 2018 at 13:16, Germán Carrillo <carrillo.ger...@gmail.com>
> wrote:
> >
> > Hi All,
> >
> >
> > 16 days waiting for a review of my Remove Empty Layers plugin...
> >
> > I think it's fair to say that something in the Plugin approval process
> is not working properly.
>
> I believe the main (volunteer) plugin maintainer, Paolo, is on
> holiday at the moment.
>
> I'm sure we don't begrudge him a well-deserved break!
>
> Nyall
>
> >
> >
> > Regards,
> >
> > Germán
> >
> > 2018-03-25 9:48 GMT-05:00 Germán Carrillo <carrillo.ger...@gmail.com>:
> >>
> >> Hi All,
> >>
> >> my "Remove Empty Layers" plugin was submitted last Monday, but I still
> didn't get any reply. Could you please review it?
> >>
> >> Regards,
> >>
> >> Germán
> >>
> >> --
> >> ---
> >>|\__
> >> (:>__)(
> >>|/
> >> Soluciones Geoinformáticas Libres
> >> http://geotux.tuxfamily.org/
> >> http://twitter.com/GeoTux2
> >> http://about.me/germancarrillo
> >>
> >
> >
> >
> > --
> > ---
> >|\__
> > (:>__)(
> >|/
> > Soluciones Geoinformáticas Libres
> > http://geotux.tuxfamily.org/
> > http://twitter.com/GeoTux2
> > http://about.me/germancarrillo
> >
> >
> > ___
> > QGIS-Developer mailing list
> > QGIS-Developer@lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] Awating plugin review...

2018-04-02 Thread Germán Carrillo
Hi All,


16 days waiting for a review of my Remove Empty Layers plugin...

I think it's fair to say that something in the Plugin approval process is
not working properly.


Regards,

Germán

2018-03-25 9:48 GMT-05:00 Germán Carrillo <carrillo.ger...@gmail.com>:

> Hi All,
>
> my "Remove Empty Layers" plugin was submitted last Monday, but I still
> didn't get any reply. Could you please review it?
>
> Regards,
>
> Germán
>
> --
> ---
>|\__
> (:>__)(
>|/
> Soluciones Geoinformáticas Libres
> http://geotux.tuxfamily.org/
> http://twitter.com/GeoTux2
> http://about.me/germancarrillo
>
> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] Awating plugin review...

2018-03-25 Thread Germán Carrillo
Hi All,

my "Remove Empty Layers" plugin was submitted last Monday, but I still
didn't get any reply. Could you please review it?

Regards,

Germán

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


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

Re: [QGIS-Developer] Does Polyline.intersects(Point) work in QGIS master?

2017-11-30 Thread Germán Carrillo
Thank you Nyall, that makes sense.

It would be nice to have a tolerance parameter so that this very little
discrepancies can also be found, but I guess one could snap one geometry to
the other (with such little distance as tolerance) and then run intersects.

Regards,

Germán

2017-11-29 17:56 GMT-05:00 Nyall Dawson <nyall.daw...@gmail.com>:

> On 29 November 2017 at 02:22, Germán Carrillo <carrillo.ger...@gmail.com>
> wrote:
> >
> > Hi devs,
> >
> >
> > do you know why this polyline
> >
> > >>> my_line = QgsGeometry().fromWkt('0 0, 963461.4299970197678
> 1077875.7919943375587, 1 1')
> >
> > and this point
> >
> > >>> my_point = QgsGeometry().fromWkt("Point (963461.430 1077875.792)")
> >
> > don't intersect?
> >
> > >>> my_line.intersects(my_point) # returns False
> >
>
> Because we use the GEOS library to test intersects, and it performs an
> exact intersection test. So 963461.4299970197678
> 1077875.7919943375587 is not the same as 963461.430 1077875.792.
>
> This is the same behaviour in 2.x, and all other GEOS based projects
> (e.g. PostGIS gives the same result).
>
> Nyall
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] Does Polyline.intersects(Point) work in QGIS master?

2017-11-29 Thread Germán Carrillo
Moreover, the "Select by Location" tool in QGIS Processing is also not able
to find such intersection (Point-Line or Line-Point) when using a PostGIS
layer as the first parameter (*Select features from*).

Not sure if they are related issues.

I created a couple of issues reporting that: [1] and [2].


Regards,

Germán
---
[1] https://issues.qgis.org/issues/17585
[2] https://issues.qgis.org/issues/17586

2017-11-28 11:22 GMT-05:00 Germán Carrillo <carrillo.ger...@gmail.com>:

> Hi devs,
>
>
> do you know why this polyline
>
> >>> my_line = QgsGeometry().fromWkt('0 0, 963461.4299970197678
> 1077875.7919943375587, 1 1')
>
> and this point
>
> >>> my_point = QgsGeometry().fromWkt("Point (963461.430 1077875.792)")
>
> don't intersect?
>
> >>> my_line.intersects(my_point) # returns False
>
>
> I'm having such issue with points and a line captured using snapping
> (vertex mode, 9 pixels of tolerance).
>
>
> I'm using QGIS v2.99.0-master (4f9e2a5
> <https://github.com/qgis/QGIS/commit/4f9e2a5>) running against GEOS
> 3.5.1-CAPI-1.9.1 r4246.
>
>
> Thanks in advance,
>
> Germán
>
> --
> ---
>|\__
> (:>__)(
>|/
> Soluciones Geoinformáticas Libres
> http://geotux.tuxfamily.org/
> http://twitter.com/GeoTux2
> http://about.me/germancarrillo
>
> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] Does Polyline.intersects(Point) work in QGIS master?

2017-11-28 Thread Germán Carrillo
Hi devs,


do you know why this polyline

>>> my_line = QgsGeometry().fromWkt('0 0, 963461.4299970197678
1077875.7919943375587, 1 1')

and this point

>>> my_point = QgsGeometry().fromWkt("Point (963461.430 1077875.792)")

don't intersect?

>>> my_line.intersects(my_point) # returns False


I'm having such issue with points and a line captured using snapping
(vertex mode, 9 pixels of tolerance).


I'm using QGIS v2.99.0-master (4f9e2a5
) running against GEOS
3.5.1-CAPI-1.9.1 r4246.


Thanks in advance,

Germán

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


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

[QGIS-Developer] Handy methods to Copy/Paste Features via QgisInterface

2017-11-09 Thread Germán Carrillo
Hi qgis-devs,


what do you think about exposing methods to copy/paste features from/to
*given layers* through QgisInterface?

Such methods are available in qgisapp.cpp already [1], but plugin devs
cannot access them. What is exposed right now are the actionCopyFeatures
and actionPasteFeatures, which:

1) Require the layers to be loaded in the QGIS Layer Tree.
2) Require the layers to be active when the corresponding method is called.

There is really no need for those 2 GUI-related requirements.


I've created a Pull Request [2] to make it possible to use source and
target layers for copy/paste operations without loading them into the Layer
Tree, which is much more handy for people using the QGIS API.

That is, you have both layers and just pass them as parameters to the
corresponding copy/paste methods:

>> source_layer.selectAll()
>> iface.copyFeatures(source_layer)
>> target_layer.startEditing()
>> iface.pasteFeatures(target_layer)


*FYI, I'm using copy/paste features functionality to mimic an append
operation from one layer to another, which I've found difficult to achieve
with the API or  even using current Processing algorithms.*


Does it make sense for you?


Regards,

Germán

[1] https://github.com/qgis/QGIS/blob/master/src/app/qgisapp.cpp#L8071-L8192
[2] https://github.com/qgis/QGIS/pull/5578


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


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

[QGIS-Developer] Is PySpatiaLite needed for QGIS v3?

2017-10-23 Thread Germán Carrillo
Hi devs,


there are known issues using pyspatialite that lead to QGIS v3 crashes (see
[1] and [2]). In fact, using DB Manager these days to explore a SpatiaLite
database leads to a QGIS crash on Windows. :(

The easy fix for such issue could be to avoid pyspatialite (see why [3])
and use sqlite3 instead, loading the SpatiaLite module (see [4]). Avoiding
pyspatialite is possible adjusting qgis.utils.spatialite_connect().
However, loading the SpatiaLite module doesn't seem to be simple depending
on the Operating System. I've attempted to do so on Windows with no success
(several combinations, giving full path to the module, etc.).

Does anybody know how to load the SpatiaLite module for sqlite3 on Windows?
Apart from that, is there any problem if QGIS v3 switches to sqlite3 for
SpatiaLite connections?


Regards,

Germán
-
[1] https://issues.qgis.org/issues/16720
[2]
https://lists.osgeo.org/pipermail/qgis-developer/2017-September/049776.html
[3]
https://groups.google.com/d/msg/spatialite-users/o0jUwMUqx_g/OEat2JTUAAAJ
[4] https://github.com/qgis/QGIS/blob/master/python/utils.py#L602-L609



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


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

Re: [QGIS-Developer] qgis master freeze with transaction groups activated

2017-07-26 Thread Germán Carrillo
Hi Régis,

I've experienced such behavior in master as well.

In my case, using the Project Generator plugin [1] (which configures a QGIS
project from Interlis models or PostgreSQL/PostGIS schemas and by default
activates transaction groups), as soon as I finish digitizing a geometry
and the attribute form is opening, QGIS freezes entirely and sometimes even
crashes.

See here [2] a backtrace of a QGIS crash.

Regards,

Germán
--
[1] http://plugins.qgis.org/plugins/projectgenerator/
[2] https://gist.github.com/gacarrillor/6cfa023b447b7e161df4c70363357b2a

2017-07-26 10:07 GMT-05:00 Régis Haubourg :

> Hi all,
> I'm facing QGIS freezes when using project with postgres transaction
> groups activated.
>
> I just open the project, switch layers to edition mode, and pan >> freeze.
>
> I can reproduce that on two different massive projects, (one is QGEP) but
> not on another one (QWAT).
>
> Has anyone seen that too? My goal is to reduce that to something
> reproducible and light, but it's a moving target right now.
>
> Cheers
> Régis
>
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>



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


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

Re: [Qgis-developer] Dropping the "render" checkbox

2017-02-28 Thread Germán Carrillo
Hi All,


I use mapCanvas().setRenderFlag( False ) before loading a (potentially)
large number of layers using the 'Load Them All' plugin [1]. I acknowledge
I needed to toggle such flag years ago (the plugin was mainly developed in
2012) and still use it.

For another plugin (private according to requirements from a company), I
use heavy PostGIS layers in a Processing workflow. As I don't want the
canvas to show anything in the meantime (I'm only interested in getting
progress bar updates in QgsMessageBar), I use the setRenderFlag(False) and
only ask canvas to show all needed layers, including results, after all
processing is done.

Does it make sense or could I avoid toggling the flag?


Regards,

Germán

[1] http://plugins.qgis.org/plugins/loadthemall/


2017-02-28 6:49 GMT-05:00 Tim Sutton :

> Hi
>
> On 28 Feb 2017, at 12:00 PM, Matthias Kuhn  wrote:
>
> Hi Tim
>
> On 02/28/2017 10:42 AM, Tim Sutton wrote:
>
> One reason to keep it: For us the use case has often been when you are
> doing first set up of a project and you are dropping a bunch of large
> layers yet. You want to set up scale dependent visibility and rules
> first without waiting for time consuming renders, then enable rendering
> when everything is added. I know we can also use the option to make
> layers not visible when they are first added to the canvas so I reckon
> that use case can be worked around easily enough.
>
>
> Sorry if I'm missing something, but why is it important that in this
> case nothing is rendered? I imagine you can just configure scale
> dependent rendering, while ignoring that something is rendered in the
> background. And once you apply the changed config, rendering will
> restart with the same net-time and net-result (but less clicks).
>
>
>
> Hmm probably not so important if it is rendering nicely in a side thread
> and esc cancels rendering efficiently. Anyway it seems that others like
> Giovanni and Denis are quite invested in the feature so probably it is more
> useful to understand their needs as I could easily see it go and not be too
> worried...
>
> Regards
>
> Tim
>
>
>
> Matthias
>
>
> —
>
>
>
>
>
>
>
>
>
> *Tim Sutton*
>
> *Co-founder:* Kartoza
> *Project chair:* QGIS.org
>
> Visit http://kartoza.com to find out about open source:
>
> Desktop GIS programming services
> Geospatial web development
> GIS Training
> Consulting Services
>
> *Skype*: timlinux
> *IRC:* timlinux on #qgis at freenode.net
>
> Kartoza is a merger between Linfiniti and Afrispatial
>
>
> ___
> 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
>



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


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

Re: [Qgis-developer] Error is QgsFeature API Documentation

2017-02-14 Thread Germán Carrillo
Hi Calvin,

have a look at the corresponding PyQGIS documentation for the
QgsFeature.attribute() method:

http://geoapis.sourcepole.com/qgispyapi/qgsfeature#QgsFeature.attribute


Regards,

Germán


2017-02-14 16:31 GMT-05:00 Jürgen E. Fischer :

> Hi Calvin,
>
> On Tue, 14. Feb 2017 at 14:28:14 -0500, C Hamilton wrote:
> > Am I missing something here or is the second 'attribute' method invalid?
>
> It's valid in C++ - in python there is only the method taking the index.
>
> Alternatively you can pythonically access the attribute with
> feature[fieldname]
> and feature[fieldindex] (also for assignment) and iterate the attributes
> [attr
> for attr in feature].
>
>
> Jürgen
>
> --
> Jürgen E. Fischer   norBIT GmbH Tel.
> +49-4931-918175-31
> Dipl.-Inf. (FH) Rheinstraße 13  Fax.
> +49-4931-918175-50
> Software Engineer   D-26506 Norden
> http://www.norbit.de
> QGIS release manager (PSC)  GermanyIRC: jef on FreeNode
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>



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


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

Re: [Qgis-developer] Qgis private plugin repository

2016-10-28 Thread Germán Carrillo
There is another option that I'm currently using:

https://github.com/mstuyts/phpQGISrepository/

You just upload you plugin ZIP file into the downloads folder and you're
done.

If you have issues with it, make sure you have installed the dependencies.


Regards,

Germán

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


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

[Qgis-developer] Issues with a Python test for Processing

2016-10-20 Thread Germán Carrillo
Hi All,


I'm having troubles trying to run a custom test [1] for my PR [2].


I'm able to run it against my local build in this way:

  $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/lib/
  $ QGIS_PREFIX_PATH=/apps
PYTHONPATH=/apps/share/qgis/python:/apps/share/qgis/python/plugins:$PYTHONPATH
python ../python/plugins/processing/tests/GdalAlgorithmsMemoryTest.py

It passes (prints OK) but I get a segmentation fault:

  ERROR 10: Pointer 'hDriver' is NULL in 'OGR_Dr_GetName'.
  *** Error in `python': double free or corruption (!prev):
0x03a116b0 ***

When I push a commit to my PR, Travis says there are errors [3] with my
test, I guess related to file path configurations. Travis also gets the
segmentation fault.

Could someone please give me a clue on how to solve this issues?
Why tests pass against a local build but fail with Travis?


Regards,

Germán
--
[1]
https://github.com/gacarrillor/QGIS/blob/ogrmemorylayers/python/plugins/processing/tests/GdalAlgorithmsMemoryTest.py
[2] https://github.com/qgis/QGIS/pull/3644
[3] https://travis-ci.org/qgis/QGIS/jobs/169346549

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


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

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

2016-10-19 Thread Germán Carrillo
My bad, Victor. I was testing against an old build. Just re-built QGIS and
the None is gone.
Thanks for the fix.

Regards,

Germán

2016-10-19 16:05 GMT-05:00 Victor Olaya <vola...@gmail.com>:

> hmm, it's strange that you get None...If the value pased is empty or None,
> it should set an empty string as value
>
> see: https://github.com/qgis/QGIS/commit/d911671b0669d3654d85954b52e38a
> 9f5e952d4a
>
> I adapted the test to check that, and it is passing
>
> see: https://github.com/qgis/QGIS/commit/0d09ad1ecd4a850c421bb1820e3d58
> 23dde5d33f
>
> 2016-10-19 22:55 GMT+02:00 Germán Carrillo <carrillo.ger...@gmail.com>:
>
>> After rebasing a few hours ago, I'm still having issues (None appearing
>> in ogr2ogr commands) with the same example described in this comment [1]
>> (OGR "Convert format" algorithm).
>>
>> Am I doing something wrong? Should I fix/adjust/add something to OGR
>> algorithms?
>>
>> Regards,
>>
>> Germán
>>
>> --
>> [1] https://github.com/qgis/QGIS/commit/61a10df45283a47782bf
>> 49ac62f9c5e5f9b27b21#commitcomment-19464285
>>
>>
>> 2016-10-18 11:19 GMT-05:00 Victor Olaya <vola...@gmail.com>:
>>
>>> Yes, they should. I will take care of that
>>>
>>> 2016-10-18 17:48 GMT+02:00 Sandro Santilli <s...@kbt.io>:
>>> > On Tue, Oct 18, 2016 at 05:44:43PM +0200, Victor Olaya wrote:
>>> >> I just made this fix, which should solve those issues
>>> >>
>>> >> https://github.com/qgis/QGIS/commit/d7bd5dc50705eec3f37ef82f
>>> c819b5bc47cce0f0
>>> >>
>>> >> Let me know if we need to do something else.
>>> >
>>> > I still think a testcase would be very useful.
>>> > Besides, there seem to be tests checking for "None" (string)
>>> > being returned by setting None (type) in
>>> >
>>> >  python/plugins/processing/tests/ParametersTest.py
>>> >
>>> > Should they be updated ?
>>> >
>>> > --strk;
>>> >
>>>
>>
>>
>>
>> --
>> ---
>>|\__
>> (:>__)(
>>|/
>> Soluciones Geoinformáticas Libres
>> http://geotux.tuxfamily.org/
>> http://twitter.com/GeoTux2
>> http://about.me/germancarrillo
>>
>> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
>>
>
>


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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2016-10-19 Thread Germán Carrillo
After rebasing a few hours ago, I'm still having issues (None appearing in
ogr2ogr commands) with the same example described in this comment [1] (OGR
"Convert format" algorithm).

Am I doing something wrong? Should I fix/adjust/add something to OGR
algorithms?

Regards,

Germán

--
[1]
https://github.com/qgis/QGIS/commit/61a10df45283a47782bf49ac62f9c5e5f9b27b21#commitcomment-19464285


2016-10-18 11:19 GMT-05:00 Victor Olaya :

> Yes, they should. I will take care of that
>
> 2016-10-18 17:48 GMT+02:00 Sandro Santilli :
> > On Tue, Oct 18, 2016 at 05:44:43PM +0200, Victor Olaya wrote:
> >> I just made this fix, which should solve those issues
> >>
> >> https://github.com/qgis/QGIS/commit/d7bd5dc50705eec3f37ef82fc819b5
> bc47cce0f0
> >>
> >> Let me know if we need to do something else.
> >
> > I still think a testcase would be very useful.
> > Besides, there seem to be tests checking for "None" (string)
> > being returned by setting None (type) in
> >
> >  python/plugins/processing/tests/ParametersTest.py
> >
> > Should they be updated ?
> >
> > --strk;
> >
>



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


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

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

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

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


Hi All,

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

Regards,

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




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


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

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

2016-10-17 Thread Germán Carrillo
Hi All,


I've been studying ogrLayerName and GDAL/OGR algorithms in recent days. I
understand ogrLayerName expects a URI from QGIS layers.

One valid QGIS layer URI might be (talking about Spatialite layers):

'dbname=\'/tmp/test.sqlite\' table="test" (geometry) sql='

The PR you merged [1] made it impossible to run an OGR algorithm with a
Spatialite layer with such URI. Hence my comment to the corresponding
commit.

I'm working on another PR [2] at the moment that also deals with
ogrLayerName, so I've tested your version of ogrLayerName and adjusted it.
Now it can handle the aforementioned Spatialite layer. This is how
ogrLayerName looks right now in my local repo (that I'll be pushing into my
PR):

https://gist.github.com/gacarrillor/233567ca4b407bfd4e92ca66c0fe01df


Regards,

Germán

--

[1] https://github.com/qgis/QGIS/pull/3605

[2] https://github.com/qgis/QGIS/pull/3591

2016-10-17 9:31 GMT-05:00 Mark Johnson :

> Sorry, I misread the request.
>
> In this case, if I have now understood correctly, you are opening the
> source before retrieving the layer.
>
> That would then be everything up to the first '|'.
>
> For a file-base source the full-filename with path.
>
> For a Database-System such as PostGis the Connection-String to connect to
> the Database (with user/password-information).
>
> ---
>
> After the connection has been made use GetName or GetLayer as needed from
> the information supplied after the first '|' to retrieve the layer.
>
> When the Layer-Name is unique, GetName should be used
> - for drivers such as GML and KML, where the Layer-Name may not be unique,
> Getlayer should be used
>
>
> Mark
>
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



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


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

Re: [Qgis-developer] Let's clean up hub.qgis.org

2016-09-08 Thread Germán Carrillo
Hi Paolo,

please remove the following plugins from hub.qgis.org. They all have been
uploaded to GitHub and, at least their latest version reflects such change
in the metadata file:

Load Them All,
Remove Empty Layers,
Synchronize QGIS with a dir.

Thanks in advance,

Germán


2016-08-25 4:25 GMT-05:00 Paolo Cavallini :

> Il 25/08/2016 09:46, Borys Jurgiel ha scritto:
> > Hi Paolo,
> >
> > The following projects are now migrated to github and ready to be
> removed:
> >
> > newmemorylayer
> > pluginreloader
> > pointsamplingtool
> > shpencodingfixer
> > swapxy
> > triangulation
> >
> > Thanks a lot for your initiative!
>
> done, thanks!
>
> --
> Paolo Cavallini - www.faunalia.eu
> QGIS & PostGIS courses: http://www.faunalia.eu/training.html
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



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


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

Re: [Qgis-developer] Issue with QgsVectorLayerUndoCommand class (QGIS crashes)

2016-07-19 Thread Germán Carrillo
Hi All,

just to let you know that I created an issue in the QGIS issue Tracking
with this problem:

http://hub.qgis.org/issues/15311

Regards,

Germán

2016-07-15 12:26 GMT-05:00 Germán Carrillo <carrillo.ger...@gmail.com>:

> Hi All,
>
> I've discovered an issue with QgsVectorLayerUndoCommand class
> (QgsVectorLayerUndoCommandChangeAttribute.undo() method) when updating an
> attribute value after featureAdded SIGNAL is emitted.
>
> Steps to reproduce:
>
> 1. Open QGIS, load a sample vector layer like this (
> http://downloads.tuxfamily.org/tuxgis/tmp/test_point.zip ) and select it
> in the Layer List Widget (ToC).
> 2. Run the following code snippet into the QGIS Python Console to connect
> featureAdded SIGNAL  to a custom SLOT that changes an attribute value:
>
> ##
> myLayer = iface.activeLayer()
> field = 0   # Please use the test Shapefile provided, if not, adjust the
> field index
>
> def updateFeatureAttrs( fId ):
> f = myLayer.getFeatures( QgsFeatureRequest( fId ) ).next()
> geom = f.geometry()
> myLayer.changeAttributeValue( fId, field, geom.asPoint().x() )
>
> myLayer.featureAdded.connect( updateFeatureAttrs )
> ##
>
> 3. Start editing. Add a new point. (If a form opens click on OK). Don't
> save anything.
> 4. Stop editing and choose "Close without saving."
> 5. QGIS crashes and prints the following error message:
>
> %%%
> Fatal: ASSERT: "it != mBuffer->mAddedFeatures.end()" in file
> /tmp/buildd/qgis-2.14.2+20trusty/src/core/qgsvectorlayerundocommand.cpp,
> line 255
> Stacktrace (piped through c++filt):
> /usr/bin/qgis.bin[0x40a440]
> /usr/bin/qgis.bin[0x40a548]
> /usr/lib/x86_64-linux-gnu/libQtCore.so.4(qt_message_output(QtMsgType, char
> const*)+0x21)[0x7fd508939bb1]
> /usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x70ff9)[0x7fd508939ff9]
> /usr/lib/x86_64-linux-gnu/libQtCore.so.4(qFatal(char const*,
> ...)+0x94)[0x7fd50893a804]
>
> /usr/lib/libqgis_core.so.2.14.2(QgsVectorLayerUndoCommandChangeAttribute::undo()+0x659)[0x7fd5092e2c09]
>
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(QUndoCommand::undo()+0x50)[0x7fd5084144e0]
>
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(QUndoStack::setIndex(int)+0xc8)[0x7fd508414e58]
>
> /usr/lib/libqgis_core.so.2.14.2(QgsVectorLayerEditBuffer::rollBack()+0x23)[0x7fd5092c4d43]
>
> /usr/lib/libqgis_core.so.2.14.2(QgsVectorLayer::rollBack(bool)+0x46)[0x7fd5092b81e6]
> /usr/lib/libqgis_app.so.2.14.2(QgisApp::toggleEditing(QgsMapLayer*,
> bool)+0xb4b)[0x7fd50a1b677b]
> /usr/lib/libqgis_app.so.2.14.2(+0x478d41)[0x7fd50a4edd41]
> /usr/lib/x86_64-linux-gnu/libQtCore.so.4(QMetaObject::activate(QObject*,
> QMetaObject const*, int, void**)+0x2da)[0x7fd508a5a87a]
>
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(QAction::triggered(bool)+0x32)[0x7fd507dd9a62]
>
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(QAction::activate(QAction::ActionEvent)+0x63)[0x7fd507ddb433]
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x57cb02)[0x7fd508192b02]
>
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(QAbstractButton::mouseReleaseEvent(QMouseEvent*)+0x6c)[0x7fd508192c2c]
>
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(QToolButton::mouseReleaseEvent(QMouseEvent*)+0xa)[0x7fd508249a4a]
>
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(QWidget::event(QEvent*)+0xaca)[0x7fd507e2f50a]
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplicationPrivate::notify_helper(QObject*,
> QEvent*)+0x8c)[0x7fd507ddfe2c]
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplication::notify(QObject*,
> QEvent*)+0x3ad)[0x7fd507de65dd]
> /usr/lib/libqgis_core.so.2.14.2(QgsApplication::notify(QObject*,
> QEvent*)+0x5b)[0x7fd509049c8b]
> /usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::notifyInternal(QObject*,
> QEvent*)+0x6d)[0x7fd508a464dd]
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplicationPrivate::sendMouseEvent(QWidget*,
> QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&,
> bool)+0x153)[0x7fd507de5d93]
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x2449cb)[0x7fd507e5a9cb]
>
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplication::x11ProcessEvent(_XEvent*)+0x1559)[0x7fd507e5a269]
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x26bb02)[0x7fd507e81b02]
>
> /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x254)[0x7fd500ceee04]
> /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x49048)[0x7fd500cef048]
>
> /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7fd500cef0ec]
>
> /usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventDispatcherGlib::processEvents(QFlags)+0x71)[0x7fd508a737a1]
> /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x26bbb6)[0x7fd507e81bb6]
>
> /usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventLoop::processEvents(QFlags)+0x2f)[0x7fd508a450af]

[Qgis-developer] Issue with QgsVectorLayerUndoCommand class (QGIS crashes)

2016-07-15 Thread Germán Carrillo
Hi All,

I've discovered an issue with QgsVectorLayerUndoCommand class
(QgsVectorLayerUndoCommandChangeAttribute.undo() method) when updating an
attribute value after featureAdded SIGNAL is emitted.

Steps to reproduce:

1. Open QGIS, load a sample vector layer like this (
http://downloads.tuxfamily.org/tuxgis/tmp/test_point.zip ) and select it in
the Layer List Widget (ToC).
2. Run the following code snippet into the QGIS Python Console to connect
featureAdded SIGNAL  to a custom SLOT that changes an attribute value:

##
myLayer = iface.activeLayer()
field = 0   # Please use the test Shapefile provided, if not, adjust the
field index

def updateFeatureAttrs( fId ):
f = myLayer.getFeatures( QgsFeatureRequest( fId ) ).next()
geom = f.geometry()
myLayer.changeAttributeValue( fId, field, geom.asPoint().x() )

myLayer.featureAdded.connect( updateFeatureAttrs )
##

3. Start editing. Add a new point. (If a form opens click on OK). Don't
save anything.
4. Stop editing and choose "Close without saving."
5. QGIS crashes and prints the following error message:

%%%
Fatal: ASSERT: "it != mBuffer->mAddedFeatures.end()" in file
/tmp/buildd/qgis-2.14.2+20trusty/src/core/qgsvectorlayerundocommand.cpp,
line 255
Stacktrace (piped through c++filt):
/usr/bin/qgis.bin[0x40a440]
/usr/bin/qgis.bin[0x40a548]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(qt_message_output(QtMsgType, char
const*)+0x21)[0x7fd508939bb1]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x70ff9)[0x7fd508939ff9]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(qFatal(char const*,
...)+0x94)[0x7fd50893a804]
/usr/lib/libqgis_core.so.2.14.2(QgsVectorLayerUndoCommandChangeAttribute::undo()+0x659)[0x7fd5092e2c09]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QUndoCommand::undo()+0x50)[0x7fd5084144e0]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QUndoStack::setIndex(int)+0xc8)[0x7fd508414e58]
/usr/lib/libqgis_core.so.2.14.2(QgsVectorLayerEditBuffer::rollBack()+0x23)[0x7fd5092c4d43]
/usr/lib/libqgis_core.so.2.14.2(QgsVectorLayer::rollBack(bool)+0x46)[0x7fd5092b81e6]
/usr/lib/libqgis_app.so.2.14.2(QgisApp::toggleEditing(QgsMapLayer*,
bool)+0xb4b)[0x7fd50a1b677b]
/usr/lib/libqgis_app.so.2.14.2(+0x478d41)[0x7fd50a4edd41]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QMetaObject::activate(QObject*,
QMetaObject const*, int, void**)+0x2da)[0x7fd508a5a87a]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QAction::triggered(bool)+0x32)[0x7fd507dd9a62]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QAction::activate(QAction::ActionEvent)+0x63)[0x7fd507ddb433]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x57cb02)[0x7fd508192b02]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QAbstractButton::mouseReleaseEvent(QMouseEvent*)+0x6c)[0x7fd508192c2c]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QToolButton::mouseReleaseEvent(QMouseEvent*)+0xa)[0x7fd508249a4a]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QWidget::event(QEvent*)+0xaca)[0x7fd507e2f50a]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplicationPrivate::notify_helper(QObject*,
QEvent*)+0x8c)[0x7fd507ddfe2c]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplication::notify(QObject*,
QEvent*)+0x3ad)[0x7fd507de65dd]
/usr/lib/libqgis_core.so.2.14.2(QgsApplication::notify(QObject*,
QEvent*)+0x5b)[0x7fd509049c8b]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::notifyInternal(QObject*,
QEvent*)+0x6d)[0x7fd508a464dd]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplicationPrivate::sendMouseEvent(QWidget*,
QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&,
bool)+0x153)[0x7fd507de5d93]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x2449cb)[0x7fd507e5a9cb]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplication::x11ProcessEvent(_XEvent*)+0x1559)[0x7fd507e5a269]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x26bb02)[0x7fd507e81b02]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x254)[0x7fd500ceee04]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x49048)[0x7fd500cef048]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7fd500cef0ec]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventDispatcherGlib::processEvents(QFlags)+0x71)[0x7fd508a737a1]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x26bbb6)[0x7fd507e81bb6]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventLoop::processEvents(QFlags)+0x2f)[0x7fd508a450af]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventLoop::exec(QFlags)+0x175)[0x7fd508a453a5]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::exec()+0x89)[0x7fd508a4ab79]
/usr/bin/qgis.bin[0x406fd7]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fd507358ec5]
/usr/bin/qgis.bin[0x409d48]
Aborted
%%%


I've tested both Shapefiles and SpatiaLite layers, getting the same error.


Do you have an idea of what could be happening?

I'm using QGIS v.2.14.2 on a Linux Mint machine.


Regards,

Germán

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


Re: [Qgis-developer] QgsVectorLayer's attributeValueChanged SIGNAL emitted when it should not

2016-07-13 Thread Germán Carrillo
Great. I'll open an issue in the QGIS issue tracker.
I'll see what I can do.


Regards,

Germán

2016-07-13 8:23 GMT-05:00 Matthias Kuhn <matth...@opengis.ch>:

> Hi Germán
>
> On 07/13/2016 03:19 PM, Germán Carrillo wrote:
> > What you say about edit widgets makes sense, what I'd like to discuss is
> > whether the SIGNAL should be emitted in such cases.
>
> I don't think this needs to be discussed. It simply should not be emitted.
>
> Matthias
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] QgsVectorLayer's attributeValueChanged SIGNAL emitted when it should not

2016-07-13 Thread Germán Carrillo
Hi Matthias,


thanks for the response.

In the first message I've included a link to a sample Shapefile. It has a
single field (called id) with these properties: type:int, type
name:Integer, length:10, precision:0, fieldIndex:0, edit widget:text edit.

The SIGNAL is emitted when the first feature has a NULL value for id field.
It happens only the first time I click on Toggle Edit Mode (after the
attribute table is open), the second time I start an edit session from the
same attribute table window, the SIGNAL is not emitted. To get the SIGNAL
emitted once more, I just need to close the attribute table window and open
it again, then starting an edit session emits the SIGNAL again.

What you say about edit widgets makes sense, what I'd like to discuss is
whether the SIGNAL should be emitted in such cases.


Regards,

Germán


2016-07-13 1:12 GMT-05:00 Matthias Kuhn <matth...@opengis.ch>:

> Hi Germán,
>
> I think some edit widgets have effects like this, when an unsupported
> value is set on them, they will just convert it to a supported one and
> change it.
> Like some widgets may not support NULL values so they just change it to
> something else.
> Please check which field is affected, what edit type is set and what's the
> value of the first (topmost) feature on the attribute table for this field.
>
> Thanks
> Matthias
>
>
> On 13/07/16 00:33, Germán Carrillo wrote:
>
> Hi All,
>
> I'm working on a plugin and trying to connect a SLOT to
> layer.attributeValueChanged SIGNAL. However, I found that such SIGNAL is
> (weirdly) emitted in the following scenario:
>
> 1. Load a vector file (I've tested this with a Shapefile and an SQLITE
> file) with a numeric (int or real) field, whose value for the first feature
> is NULL.
> 2. Open the attribute table of the vector layer.
> 3. Start an edit session cliking on "Toggle Edit Mode" button from the
> Attribute table window.
>
> As soon as the edit session starts, the SIGNAL is emitted. Now, if I click
> on the "Toggle Edit Mode" button from the Attribute table window, I have to
> choose among Save, Cancel, or Close Without Saving options, even without
> changing any attribute value at all. Once I choose Close Without Saving,
> the layer.attributeValueChanged SIGNAL is emitted once more.
>
> Such behavior is hampering my plugin, which will depend on the
> aforementioned SIGNAL.
>
> Is this a bug? Do you know why layer.attributeValueChanged is being
> emitted in such scenario? I've noticed that sometimes a blockSignals()
> method is used in QGIS source code; couldn't we use blockSignals() to avoid
> emitting the SIGNAL in this case?
>
> ##
> Note: I use this code snippet in the QGIS Python console to be notified
> when layer.attributeValueChanged is emitted:
>
> ##
> def f(fid, idx, value):
>   print fid,idx,value
>
> l = iface.activeLayer()
> l.attributeValueChanged.connect( f )
> ##
>
> I'm getting these messages printed (4 is the index of the numeric field
> whose value for the first feature is NULL):
>
> 0 4 NULL # When I open the edit session.
> 0 4 NULL # When I close the edit session.
>
> If you want to reproduce the problem, you can use a sample Shapefile from
> here: http://downloads.tuxfamily.org/tuxgis/tmp/test.zip
> ##
>
>
> Regards,
>
> Germán
>
>
> --
> ---
>|\__
> (:>__)(
>|/
> Soluciones Geoinformáticas Libres
> http://geotux.tuxfamily.org/
> http://twitter.com/GeoTux2
> http://about.me/germancarrillo
>
> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
>
>
> ___
> Qgis-developer mailing listqgis-develo...@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
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] QgsVectorLayer's attributeValueChanged SIGNAL emitted when it should not

2016-07-12 Thread Germán Carrillo
Hi All,

I'm working on a plugin and trying to connect a SLOT to
layer.attributeValueChanged SIGNAL. However, I found that such SIGNAL is
(weirdly) emitted in the following scenario:

1. Load a vector file (I've tested this with a Shapefile and an SQLITE
file) with a numeric (int or real) field, whose value for the first feature
is NULL.
2. Open the attribute table of the vector layer.
3. Start an edit session cliking on "Toggle Edit Mode" button from the
Attribute table window.

As soon as the edit session starts, the SIGNAL is emitted. Now, if I click
on the "Toggle Edit Mode" button from the Attribute table window, I have to
choose among Save, Cancel, or Close Without Saving options, even without
changing any attribute value at all. Once I choose Close Without Saving,
the layer.attributeValueChanged SIGNAL is emitted once more.

Such behavior is hampering my plugin, which will depend on the
aforementioned SIGNAL.

Is this a bug? Do you know why layer.attributeValueChanged is being emitted
in such scenario? I've noticed that sometimes a blockSignals() method is
used in QGIS source code; couldn't we use blockSignals() to avoid emitting
the SIGNAL in this case?

##
Note: I use this code snippet in the QGIS Python console to be notified
when layer.attributeValueChanged is emitted:

##
def f(fid, idx, value):
  print fid,idx,value

l = iface.activeLayer()
l.attributeValueChanged.connect( f )
##

I'm getting these messages printed (4 is the index of the numeric field
whose value for the first feature is NULL):

0 4 NULL # When I open the edit session.
0 4 NULL # When I close the edit session.

If you want to reproduce the problem, you can use a sample Shapefile from
here: http://downloads.tuxfamily.org/tuxgis/tmp/test.zip
##


Regards,

Germán


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


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

Re: [Qgis-developer] Segmentation fault when using layersRemoved SIGNAL.

2016-06-20 Thread Germán Carrillo
For reference, this is the ticket I've just opened:
http://hub.qgis.org/issues/15088

Regards,

Germán

2016-06-18 5:56 GMT-05:00 René-Luc Dhont <rldh...@gmail.com>:

> Open a ticket with your code example.
>
> Regards,
>
>
> Le 18/06/2016 00:28, Germán Carrillo a écrit :
>
> Should I open a ticket reporting this issue to the QGIS issue tracker?
>
> Regards,
>
> Germán
>
> 2016-06-13 15:53 GMT-05:00 Germán Carrillo <carrillo.ger...@gmail.com>:
>
>> Hi All,
>>
>> there seems to be an issue connecting the SIGNAL layersRemoved from
>> QgsMapLayerRegistry.
>>
>> For example, if I save this script to a file, and run it from the Linux
>> terminal:
>>
>> 
>> import unittest
>> from qgis.core import QgsApplication, QgsMapLayerRegistry
>>
>> class SIGNALTest( unittest.TestCase ):
>>
>> def setUp( self ):
>> app = QgsApplication([], True)
>> QgsApplication.setPrefixPath("/usr", True)
>> QgsApplication.initQgis()
>>
>> QgsMapLayerRegistry.instance().layersRemoved.connect(
>> self.myFunction )
>>
>> def myFunction( self, layerIds ):
>> print "Called!"
>>
>> def test1( self ):
>> self.assertEqual(1,1)
>>
>> def tearDown( self ):
>> QgsApplication.exitQgis()
>>
>> if __name__ == "__main__":
>> unittest.main()
>> 
>>
>> I get the following result:
>>
>> ##
>> Called!
>> .
>> --
>> Ran 1 test in 0.119s
>>
>> OK
>> Segmentation fault
>> ###
>>
>> If, on the contrary, I comment out the line where the connection is set
>> or if I use other signals such as layerRemoved or layersAdded instead of
>> layersRemoved, I get:
>>
>> ###
>> .
>> --
>> Ran 1 test in 0.111s
>>
>> OK
>> ###
>>
>> I'm using QGIS 2.14.2 on a GNU/Linux machine.
>>
>> Can you confirm such problem? Do you have any clue about it?
>>
>>
>> Regards,
>>
>> Germán
>>
>> --
>> ---
>>|\__
>> (:>__)(
>>|/
>> Soluciones Geoinformáticas Libres
>> http://geotux.tuxfamily.org/
>> http://twitter.com/GeoTux2
>> http://about.me/germancarrillo
>>
>> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
>>
>
>
>
> --
> ---
>|\__
> (:>__)(
>|/
> Soluciones Geoinformáticas Libres
> http://geotux.tuxfamily.org/
> http://twitter.com/GeoTux2
> http://about.me/germancarrillo
>
> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
>
>
> ___
> Qgis-developer mailing listqgis-develo...@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
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] Segmentation fault when using layersRemoved SIGNAL.

2016-06-17 Thread Germán Carrillo
Should I open a ticket reporting this issue to the QGIS issue tracker?

Regards,

Germán

2016-06-13 15:53 GMT-05:00 Germán Carrillo <carrillo.ger...@gmail.com>:

> Hi All,
>
> there seems to be an issue connecting the SIGNAL layersRemoved from
> QgsMapLayerRegistry.
>
> For example, if I save this script to a file, and run it from the Linux
> terminal:
>
> 
> import unittest
> from qgis.core import QgsApplication, QgsMapLayerRegistry
>
> class SIGNALTest( unittest.TestCase ):
>
> def setUp( self ):
> app = QgsApplication([], True)
> QgsApplication.setPrefixPath("/usr", True)
> QgsApplication.initQgis()
>
> QgsMapLayerRegistry.instance().layersRemoved.connect(
> self.myFunction )
>
> def myFunction( self, layerIds ):
> print "Called!"
>
> def test1( self ):
> self.assertEqual(1,1)
>
> def tearDown( self ):
> QgsApplication.exitQgis()
>
> if __name__ == "__main__":
> unittest.main()
> 
>
> I get the following result:
>
> ##
> Called!
> .
> --
> Ran 1 test in 0.119s
>
> OK
> Segmentation fault
> ###
>
> If, on the contrary, I comment out the line where the connection is set or
> if I use other signals such as layerRemoved or layersAdded instead of
> layersRemoved, I get:
>
> ###
> .
> --
> Ran 1 test in 0.111s
>
> OK
> ###
>
> I'm using QGIS 2.14.2 on a GNU/Linux machine.
>
> Can you confirm such problem? Do you have any clue about it?
>
>
> Regards,
>
> Germán
>
> --
> ---
>|\__
> (:>__)(
>|/
> Soluciones Geoinformáticas Libres
> http://geotux.tuxfamily.org/
> http://twitter.com/GeoTux2
> http://about.me/germancarrillo
>
> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] Segmentation fault when using layersRemoved SIGNAL.

2016-06-13 Thread Germán Carrillo
Hi All,

there seems to be an issue connecting the SIGNAL layersRemoved from
QgsMapLayerRegistry.

For example, if I save this script to a file, and run it from the Linux
terminal:


import unittest
from qgis.core import QgsApplication, QgsMapLayerRegistry

class SIGNALTest( unittest.TestCase ):

def setUp( self ):
app = QgsApplication([], True)
QgsApplication.setPrefixPath("/usr", True)
QgsApplication.initQgis()

QgsMapLayerRegistry.instance().layersRemoved.connect(
self.myFunction )

def myFunction( self, layerIds ):
print "Called!"

def test1( self ):
self.assertEqual(1,1)

def tearDown( self ):
QgsApplication.exitQgis()

if __name__ == "__main__":
unittest.main()


I get the following result:

##
Called!
.
--
Ran 1 test in 0.119s

OK
Segmentation fault
###

If, on the contrary, I comment out the line where the connection is set or
if I use other signals such as layerRemoved or layersAdded instead of
layersRemoved, I get:

###
.
--
Ran 1 test in 0.111s

OK
###

I'm using QGIS 2.14.2 on a GNU/Linux machine.

Can you confirm such problem? Do you have any clue about it?


Regards,

Germán

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


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

Re: [Qgis-developer] SIGNAL to know when a feature is added to vector layer using PyQGIS

2016-06-10 Thread Germán Carrillo
Hi Matthias,

thanks for the response.

I'm writing a plugin and would like to be notified when vector layers get
new features. As a SIGNAL from dataProvider.addFeatures doesn't exist, the
plugin won't be able to handled such case. I could just suggest people to
avoid writing directly to the provider if they want the plugin to work as
expected, but I think QGIS could notify on those situations.

Do you think a (future) Pull Request is worth for handling this or better
avoid dealing with the provider directly?

Regards,

Germán

2016-06-10 1:43 GMT-05:00 Matthias Kuhn <matth...@opengis.ch>:

> Hi Germán,
>
> I don't think there's a signal to do that.
>
> Is there a reason you have to write the the dataprovider directly rather
> then using the layer's methods?
> If you are in control of the code writing to the dataprovider and the
> code that should react to this, you could also produce the signalling on
> your side.
>
> Matthias
>
> On 06/09/2016 11:24 PM, Germán Carrillo wrote:
> > Hi,
> >
> > I'd like to ask you whether you know any way of being notified when a
> > feature is being added to a vector layer without opening and closing an
> > edit session, e.g., by using:
> >
> > myLayer.dataProvider().addFeatures( [feature] )
> >
> > Which directly writes the new feature to the provider.
> >
> > When working with an edit session I can use featureAdded SIGNAL, which
> > gives me the feature id, but still haven't found a way of using such
> > SIGNAL with no edit session involved.
> >
> > Regards,
> >
> > Germán
> >
> > --
> > ---
> >|\__
> > (:>__)(
> >|/
> > Soluciones Geoinformáticas Libres
> > http://geotux.tuxfamily.org/
> > http://twitter.com/GeoTux2
> > http://about.me/germancarrillo
> >
> > <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
> >
> >
> > ___
> > 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




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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] Layer Name and originalName, was: [QGIS-Server] Add a Short Name to layers for OGC Web Services

2016-06-09 Thread Germán Carrillo
Does anybody have any thought on this?


2016-06-01 10:31 GMT-05:00 Germán Carrillo <carrillo.ger...@gmail.com>:

> Hi All,
>
> what is the purpose of originalName() method in QgsMapLayer class?
>
> Documentation states:
>Get the original name of the layer.
>Returns
>the original layer name
>
> Which perhaps isn't clear enough.
>
> Plugin developers reading the API would generally expect originalName to
> preserve the name the layer was given when it was first loaded into QGIS.
> And it might be so, except for this line (
> http://qgis.org/api/2.14/qgsmaplayer_8cpp_source.html#l00117) that
> modifies the originalName private variable.
>
> Am I getting it wrong? Is id() supposed to fulfill such requirement?
>
> Regards,
>
> Germán
>
>
> 2015-12-08 6:33 GMT-05:00 René-Luc Dhont <rldh...@gmail.com>:
>
>>
>>
>> Le 22/09/2015 13:36, Paolo Cavallini a écrit :
>>
>>> Il 22/09/2015 13:24, Tom Chadwin ha scritto:
>>>
>>>> Many apologies - you are right. I change "Layer name", and couldn't
>>>> understand what Display as was meant to be: a non-editable text field
>>>> which
>>>> mirrors Layer name? Why?
>>>>
>>> agreed, an old issue, I also do not understant its use.
>>> all the best.
>>>
>>
>> It's not an issue :-)
>>
>> In QgsMapLayer there are originalName and name.
>> The method setLayerName sets originalName and name.
>> The attribute name is the capitalize originalName if the settings
>> "/qgis/capitaliseLayerName" is set to True.
>>
>> In the Layer properties the originalName and Name are displayed and the
>> originalName is the editable attribute.
>>
>> René-Luc
>> ___
>> 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
>
>
>
>
> --
> ---
>|\__
> (:>__)(
>|/
> Soluciones Geoinformáticas Libres
> http://geotux.tuxfamily.org/
> http://twitter.com/GeoTux2
> http://about.me/germancarrillo
>
> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
>



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

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
___
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] SIGNAL to know when a feature is added to vector layer using PyQGIS

2016-06-09 Thread Germán Carrillo
Hi,

I'd like to ask you whether you know any way of being notified when a
feature is being added to a vector layer without opening and closing an
edit session, e.g., by using:

myLayer.dataProvider().addFeatures( [feature] )

Which directly writes the new feature to the provider.

When working with an edit session I can use featureAdded SIGNAL, which
gives me the feature id, but still haven't found a way of using such SIGNAL
with no edit session involved.

Regards,

Germán

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


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

Re: [Qgis-developer] Layer Name and originalName, was: [QGIS-Server] Add a Short Name to layers for OGC Web Services

2016-06-01 Thread Germán Carrillo
Hi All,

what is the purpose of originalName() method in QgsMapLayer class?

Documentation states:
   Get the original name of the layer.
   Returns
   the original layer name

Which perhaps isn't clear enough.

Plugin developers reading the API would generally expect originalName to
preserve the name the layer was given when it was first loaded into QGIS.
And it might be so, except for this line (
http://qgis.org/api/2.14/qgsmaplayer_8cpp_source.html#l00117) that modifies
the originalName private variable.

Am I getting it wrong? Is id() supposed to fulfill such requirement?

Regards,

Germán


2015-12-08 6:33 GMT-05:00 René-Luc Dhont :

>
>
> Le 22/09/2015 13:36, Paolo Cavallini a écrit :
>
>> Il 22/09/2015 13:24, Tom Chadwin ha scritto:
>>
>>> Many apologies - you are right. I change "Layer name", and couldn't
>>> understand what Display as was meant to be: a non-editable text field
>>> which
>>> mirrors Layer name? Why?
>>>
>> agreed, an old issue, I also do not understant its use.
>> all the best.
>>
>
> It's not an issue :-)
>
> In QgsMapLayer there are originalName and name.
> The method setLayerName sets originalName and name.
> The attribute name is the capitalize originalName if the settings
> "/qgis/capitaliseLayerName" is set to True.
>
> In the Layer properties the originalName and Name are displayed and the
> originalName is the editable attribute.
>
> René-Luc
> ___
> 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




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


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

[Qgis-developer] How to store a QIcon in QGIS project file?

2015-03-07 Thread Germán Carrillo
Hi All,

I'd like to add a Set Group Icon... action to the context menu for groups
in the layer tree. I'm preparing a pull request for that.

Everything is working fine, but I have a doubt on how to make the QGIS
project to store the QIcon (location), so that when the project is open
again, the QIcon can be constructed properly.

My first attempt was to store the QIcon path in the project, which works
fine when the icon is set through QGIS GUI. However, it wouldn't work for
PyQGIS users, who pass a QIcon object to the setIcon() method of
QgsLayerTreeGroup. Since QIcon does not store its image file path, it would
not be possible to access the path and store it in the project file. I
would have to force PyQGIS users to set the image file path via get/set
functions iconPath()-setIconPath(), which is not very elegant, but it's the
only solution I see.

Do you know any other solution for this problem? Perhaps something about
storing the QIcon somehow serialized?

Regards,

Germán Carrillo
-- 
---
  |\__
(:__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] How to store a QIcon in QGIS project file?

2015-03-07 Thread Germán Carrillo
Thanks Alain, that would imply creating a new class in the QGIS source
code, and, unless other parts of the code needed it, I think it woudn't be
welcomed.

Regards,

Germán


2015-03-07 12:38 GMT-05:00 alain al.ber...@free.fr:

  Hello,

 Maybe you can use a derived class, in python this would look like:

 QIconWithPath(QIcon):
 def __init__(self,iconPath):
 super(QIconWithPath,self).__init__(iconPath)
 self.setIconPath(iconPath)

 I'm not sure this is considered elegant...

 Alain

 Le 07/03/2015 17:06, Germán Carrillo a écrit :

 Hi All,

  I'd like to add a Set Group Icon... action to the context menu for
 groups in the layer tree. I'm preparing a pull request for that.

  Everything is working fine, but I have a doubt on how to make the QGIS
 project to store the QIcon (location), so that when the project is open
 again, the QIcon can be constructed properly.

  My first attempt was to store the QIcon path in the project, which works
 fine when the icon is set through QGIS GUI. However, it wouldn't work for
 PyQGIS users, who pass a QIcon object to the setIcon() method of
 QgsLayerTreeGroup. Since QIcon does not store its image file path, it would
 not be possible to access the path and store it in the project file. I
 would have to force PyQGIS users to set the image file path via get/set
 functions iconPath()-setIconPath(), which is not very elegant, but it's the
 only solution I see.

  Do you know any other solution for this problem? Perhaps something about
 storing the QIcon somehow serialized?

  Regards,

  Germán Carrillo
 --
 ---
   |\__
 (:__)(
|/
 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/
 http://twitter.com/GeoTux2


 ___
 Qgis-developer mailing 
 listQgis-developer@lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/qgis-developer



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




-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Problems while including .h files in QGIS code

2015-03-07 Thread Germán Carrillo
Hi All,

I'd like to let (PyQGIS) users choose between Table and Form View when
calling showAttributeTable() via QgisInterface. I'm preparing a pull
request for that.

However, I'm having a hard time with includes, since once I add #include
qgsdualview.h in my qgisInterface.h file, I get the following error:


*.../QGIS/src/providers/delimitedtext/../../gui/qgisinterface.h:49:25:
fatal error: qgsdualview.h: No such file or directory #include
qgsdualview.h*
Of course, if I don't add such include, I get a qgisinterface.h:296:57:
error: 'QgsDualView' has not been declared error.

On the other hand, if I add the (../gui/attributetable) path to
CMakeLists.txt I start getting problems with the Interpolation plugin,
namely:

*
QGIS/src/plugins/interpolation/../../gui/attributetable/qgsdualview.h:21:32:
fatal error: ui_qgsdualviewbase.h: No such file or directory #include
ui_qgsdualviewbase.h*

Which I couldn't resolve.

I would avoid this problem by using a boolean value (bool formViewMode =
False)  as parameter of showAttributeTable() but I guess it's better and
clearer to use the QgsDualView::ViewMode enum, even if it's more complex to
implement.

The code I'm working on can be accessed in this branch [1].

What would be the correct way of dealing with such include?

Regards,

Germán
--
[1] https://github.com/gacarrillor/QGIS/tree/editform
-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] How to store a QIcon in QGIS project file?

2015-03-07 Thread Germán Carrillo
It's a visual guidance to navigate your layer tree. It could help you
differentiate, for example, between data authorities (see an example at
[1]). Additionally, as some user stated in GIS.SE, plugin authors would be
able to differentiate groups created by their plugins from other groups.

I by no means think it's indispensable, but would consider it nice to have.

Regards,

Germán
--
[1] http://downloads.tuxfamily.org/tuxgis/otros/layertree.png

2015-03-07 22:07 GMT-05:00 Nathan Woodrow madman...@gmail.com:

 Hey Germán,

 What is the purpose of being able to set different group icons?

 - Nathan

 On Sun, 8 Mar 2015 at 02:06 Germán Carrillo carrillo.ger...@gmail.com
 wrote:

 Hi All,

 I'd like to add a Set Group Icon... action to the context menu for
 groups in the layer tree. I'm preparing a pull request for that.

 Everything is working fine, but I have a doubt on how to make the QGIS
 project to store the QIcon (location), so that when the project is open
 again, the QIcon can be constructed properly.

 My first attempt was to store the QIcon path in the project, which works
 fine when the icon is set through QGIS GUI. However, it wouldn't work for
 PyQGIS users, who pass a QIcon object to the setIcon() method of
 QgsLayerTreeGroup. Since QIcon does not store its image file path, it would
 not be possible to access the path and store it in the project file. I
 would have to force PyQGIS users to set the image file path via get/set
 functions iconPath()-setIconPath(), which is not very elegant, but it's the
 only solution I see.

 Do you know any other solution for this problem? Perhaps something about
 storing the QIcon somehow serialized?

 Regards,

 Germán Carrillo
 --
 ---
   |\__
 (:__)(
|/
 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/
 http://twitter.com/GeoTux2
  ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/qgis-developer




-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Moving a layer with PyQGIS using the new layer tree

2014-12-21 Thread Germán Carrillo
Nobody said he wasn't :)

Please also modify the last Python line in the Removing nodes section
from [1].

Instead of:

QgsMapLayerRegistry.instance().addMapLayer(layer1)

It should be:

QgsMapLayerRegistry.instance().removeMapLayers([layer1.id()])


Thanks for your work!

Regards,

Germán
---
[1]
http://www.lutraconsulting.co.uk/blog/2014/07/25/qgis-layer-tree-api-part-2/

2014-12-21 8:55 GMT-05:00 Martin Dobias wonder...@gmail.com:

 Hi

 On Thu, Dec 18, 2014 at 9:50 PM, Germán Carrillo 
 carrillo.ger...@gmail.com wrote:

 Thank you Luigi.

 So, I guess the following code would be enough to make the example given
 in [1] much more generic:

 ###
 cloned_group1 = node_group1.clone()
 root.insertChildNode(0, cloned_group1)

 parent = node_group1.parent()   # new code

 parent.removeChildNode(node_group1) # replace root by parent
 ###


  Luigi is right - you need to call removeChildNode() on the parent node.
 When I will find some time I will add a note to the example.

 Cheers
 Martin




-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Moving a layer with PyQGIS using the new layer tree

2014-12-18 Thread Germán Carrillo
Thank you Luigi.

So, I guess the following code would be enough to make the example given in
[1] much more generic:

###
cloned_group1 = node_group1.clone()
root.insertChildNode(0, cloned_group1)

parent = node_group1.parent()   # new code

parent.removeChildNode(node_group1) # replace root by parent
###


Wouldn't make sense to post such modified example instead?

Regards,

Germán
---
[1]
http://www.lutraconsulting.co.uk/blog/2014/07/25/qgis-layer-tree-api-part-2/




2014-12-17 17:39 GMT-05:00 Luigi Pirelli lui...@gmail.com:

 You have to refer to the group as root to remove his child

 Regards Luigi Pirelli

 On Wednesday, 17 December 2014, Germán Carrillo carrillo.ger...@gmail.com
 wrote:

 Hi all (and Martin D.),


 I've been trying to reproduce the instructions given here [1] for moving
 layers. It seems that the code doesn't work if the layer to be moved is
 inside a group.

 Specifically, trying to move a layer that is inside a group, I can add
 the clonned layer to the layer tree but I cannot get the original layer
 removed, i.e., the following command doesn't work:

root.removeChildNode( originalLayer )

 It doesn't throw any message nor change the map/ToC status.


 Can you reproduce the problem? I'm using QGIS 2.6.1 on Ubuntu.


 Regards,

 Germán Carrillo
 --
 [1]
 http://www.lutraconsulting.co.uk/blog/2014/07/25/qgis-layer-tree-api-part-2/


 --
 ---
|\__
 (:__)(
|/

 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/
 http://twitter.com/GeoTux2



-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Moving a layer with PyQGIS using the new layer tree

2014-12-17 Thread Germán Carrillo
Hi all (and Martin D.),


I've been trying to reproduce the instructions given here [1] for moving
layers. It seems that the code doesn't work if the layer to be moved is
inside a group.

Specifically, trying to move a layer that is inside a group, I can add the
clonned layer to the layer tree but I cannot get the original layer
removed, i.e., the following command doesn't work:

   root.removeChildNode( originalLayer )

It doesn't throw any message nor change the map/ToC status.


Can you reproduce the problem? I'm using QGIS 2.6.1 on Ubuntu.


Regards,

Germán Carrillo
--
[1]
http://www.lutraconsulting.co.uk/blog/2014/07/25/qgis-layer-tree-api-part-2/


-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [Qgis-user] How load Postgis layer from command line?

2014-12-10 Thread Germán Carrillo
Exactly Richard, that would be the expected behaviour.

Regards,

Germán

2014-12-10 4:37 GMT-05:00 Richard Duivenvoorde rdmaili...@duif.net:

 On 10-12-14 10:11, Uggla Henrik wrote:
  In Linux it is very easy to setup a ramdisk for fast temporal file
 storage.
 
  --help really gives the impression that loading Qgis with PostGIS layers
 using the FILE parameter is a breeze. Also, I still doesn't get what this
 PostGIS extension mentioned in --help is.

 cc'ing to dev list, original thread here:

 http://lists.osgeo.org/pipermail/qgis-user/2014-December/030180.html


 Me neither, best to bring this to the dev list then, to ask which this
 extension is.

 And IF we want a FILE parameter work for postgis we could come up with a
 design for that file param and do a feature request to get this
 implemented?

 For example, as this works:

 l = iface.addVectorLayer('dbname=bag host=localhost port=5432 user=geo
 password=xxx sslmode=disable key=gid estimatedmetadata=true srid=28992
 type=MULTIPOLYGON table=bag8mrt2014.provincie (geovlak) sql=',
 test, postgres)

 this is the actual uri:

 'dbname=bag host=localhost port=5432 user=geo
 password=xxx sslmode=disable key=gid estimatedmetadata=true srid=28992
 type=MULTIPOLYGON table=bag8mrt2014.provincie (geovlak) sql='

 so maybe prepend that with the provider part:

 postgres:'dbname=bag host=localhost port=5432 user=geo
 password=xxx sslmode=disable key=gid estimatedmetadata=true srid=28992
 type=MULTIPOLYGON table=bag8mrt2014.provincie (geovlak) sql='

 and add a --uri option to QGIS?

 qgis --uri postgres:'dbname=bag host=localhost port=5432 user=geo
 password=xxx sslmode=disable key=gid estimatedmetadata=true srid=28992
 type=MULTIPOLYGON table=bag8mrt2014.provincie (geovlak) sql='

 or something like that?

 Regards,

 Richard Duivenvoorde




-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] QGIS standalone app - layer tree, legend and co.

2014-07-05 Thread Germán Carrillo
Matthias,

have a look at the Layer list widget for PyQGIS applications [1], perhaps
it could fit your needs.

Not sure if it works on recent QGIS versions, though.

Regards,

Germán
-
[1]
http://geotux.tuxfamily.org/index.php/en/component/k2/item/270-tabla-de-contenido-leyenda-para-aplicaciones-basadas-en-pyqgis/



2014-07-04 10:07 GMT-05:00 Martin Dobias wonder...@gmail.com:

 Hi Matthias

 On Wed, Jul 2, 2014 at 4:17 PM, Matthias Ludwig kaot...@gmx.de wrote:
 
  Hi,
 
  I'am writing a data viewer as python qgis standalone application. Is it
 possible to use the QgisInterface and other classes (like
 QgsLegendInterface) for layer handling (adding, removing, activation, etc.)?
  Cause I didn't found a way I have written my own layer model based on
 qts QAbstractListModel. It's working more or less, but I would prever a
 nativ solution if available.

 QgisInterface and QgsLegendInterface will not work if you are
 developing a standalone application. As Andreas suggested, if you base
 your application on QGIS 2.4, you can use new layer tree classes:
 QgsLayerTreeView + QgsLayerTreeModel for Qt model/view and
 QgsLayerTreeGroup + QgsLayerTreeLayer classes for the actual hierarchy
 that will be used by the model and view classes. There is some doxygen
 documentation in the header files, but I am in the process of
 preparing some blog posts about the new classes... stay tuned!

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




-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] XSLT in a QGIS plugin

2012-10-10 Thread Germán Carrillo
Hi,

not sure if there is another way, but I added something similar for
displaying XML Exception reports in the WPS client.

Have a look at the 'errorHandler' function in [1].

Regards,

Germán
---
[1] https://www.kappasys.ch/svn/wps/trunk/QgsWpsDockWidget.py


2012/10/10 Jakob Lanstorp jlanst...@gmail.com

 I need to transform XML into HTML in a Python QGIS plugin I am writing. Is
 there XSLT available in QGIS Python? What would be the recommended
 approach?

 Jakob



 --
 View this message in context:
 http://osgeo-org.1560.n6.nabble.com/XSLT-in-a-QGIS-plugin-tp5007716.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




-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Python ogr driver issue (was ---- (no subject))

2012-08-25 Thread Germán Carrillo
Hi Ludovic,

probably the prefix path you are using is wrong. Try with '/usr/local/' or
check where qgis bins and libraries are located and adjust the prefix path
accordingly.

Regards,

Germán

2012/8/25 ludo ludovic.gran...@wanadoo.fr

 Hi

 Yes you are right, I forgot the title I'm sorry

 I try your code on monday and I tell you

 Thanks



 Ludovic




  Message du 24/08/12 19:09
  De : Tim Sutton
  A : ludo
  Copie à : qgis-developer@lists.osgeo.org
  Objet : Re: [Qgis-developer] Python ogr driver issue (was  (no
 subject))

 
  Hi (adding a proper subject line to your messages is always nice)
 
  On Fri, Aug 24, 2012 at 12:09 PM, ludo wrote:
   Hi all
  
   I try to start the developpement for a custom application with qgis,
 so I
   try simple things like add a vector layer but I have some problems. In
 a
   python console when I try to do something like that :
  
   core.QgsApplication.setPrefixPath('/usr',True)
   core.QgsApplication.initQgis()
   l = core.QgsVectorLayer('/home/ludo/data/test.shp', 'test', 'ogr')
   l.isValid()
  
   I always have a False result
  
   But if I try in the python console of qgis :
  
   l = QgsVectorLayer('/home/ludo/data/test.shp', 'test', 'ogr')
   l.isValid()
  
   The result is True
  
   Is someone have an idea ? Are there any other documentation that
   http://qgis.org/pyqgis-cookbook/
 
 
  There is a growing set of python unit tests that you can consult for
 ideas.
 
  Providiing the stdout from your console might help us to understand
  where your problem originates. Here is a little sript I often use:
 
  -
 
  import os
  import sys
  from qgis.core import QgsApplication, QgsProviderRegistry
 
  myUseDefaultPathFlag = True
  QGISAPP.setPrefixPath('/usr', myUseDefaultPathFlag)
  QGISAPP.initQgis()
  s = QGISAPP.showSettings()
  print s
  r = QgsProviderRegistry.instance()
  if not 'ogr' in r.providerList():
  print 'Could not find OGR provider!'
  else:
  print 'Providers found ok!'
 
  -
 
  Hope that helps!
 
 
  Tim
  
   Thanks a lot
  
   Ludovic
   ___
   Qgis-developer mailing list
   Qgis-developer@lists.osgeo.org
   http://lists.osgeo.org/mailman/listinfo/qgis-developer
  
 
 
 
  --
  Tim Sutton - QGIS Project Steering Committee Member (Release Manager)
  ==
  Please do not email me off-list with technical
  support questions. Using the lists will gain
  more exposure for your issues and the knowledge
  surrounding your issue will be shared with all.
 
  Visit http://linfiniti.com to find out about:
  * QGIS programming and support services
  * Mapserver and PostGIS based hosting plans
  * FOSS Consulting Services
  Skype: timlinux
  Irc: timlinux on #qgis at freenode.net
  ==
 


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




-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] What will be in QGIS 2.0

2012-07-11 Thread Germán Carrillo
Hi all,

please don't forget the QGIS legend and its issues when keeping track of
both layer and group positions.

Since there could be too many new functionalities, what about publishing a
survey in qgis.org for prioritizing and, perhaps, postponing them for minor
2.x releases?

Focusing on too many new stuff could yield the
next-major-version-is-coming-since-several-years-ago problem that other GIS
software have experienced.

Regards,

Germán

2012/7/11 Marco Hugentobler marco.hugentob...@sourcepole.ch

 - Threading branch and threaded data provider refactor (a long time
 ago in GSOC project far away Martin Dobias got much of the ground work
 in place but the delta between his branch and master is huge now)


 As you mention, a large part of the work is the data provider refactoring
 (implementing the iterator pattern for every provider).
 On the other hand, it is a task that can be parallelized. If each
 maintainer of a vector provider could implement that for his provider(s),
 that would make the whole process much easier. I'm available to change the
 WFS provider.
 What do others think?

 Regards,
 Marco

 Am 11.07.2012 13:26, schrieb Tim Sutton:

  Hi All

 Marco and I have been discussing version 2.0 and wanted to bring the
 discussion onto the list. In particular we are interested in:

 - When is a reasonable date to aim for the release?
 - What features will be part of 2.0?
 - What things are we going to clean away for the release?

 Here are a list of the possible things that could go into 2.0 that we
 came up with:

 - QgsGeometry Refactor to support arcs, measures, 3d geometries and
 geometry collections (Marco is working on this though unless he is
 funded to work on it it is unlikely to happen for 2.0)
 - Threading branch and threaded data provider refactor (a long time
 ago in GSOC project far away Martin Dobias got much of the ground work
 in place but the delta between his branch and master is huge now)
 - Raster refactor to use new renderer architecture, native WCS
 support, pipelines, 'save as' support and more (this work is being
 funded by the World Bank and will be available in master over the next
 3 months)
 - GSOC project for symbology UI redesign / improvements (how is this
 work going?)
 - GSOC project for on the fly feature generalization (also how is this
 going)
 - Addition of Sextante into QGIS as a standard plugin (assuming that
 sits well with Victor)

 What else do we miss from the list? Are any others out there actively
 working on features / funding features that we should be aware of?

 In terms of decrufting, it would be good to remove all the duplicated
 items:

 - twin labelling systems
 - unified add layer dialogs
 - twin symbology systems
 - about 15 ways to generate hillshades
 - too many toolbars / icons by default
 - remove all deprecated calls from the API

 Are there any other things that folks would like to add to the
 discussion for the roadmap for version 2.0?

 Regards





 --
 Dr. Marco Hugentobler
 Sourcepole -  Linux  Open Source Solutions
 Weberstrasse 5, CH-8004 Zürich, Switzerland
 marco.hugentobler@sourcepole.**ch marco.hugentob...@sourcepole.ch
 http://www.sourcepole.ch
 Technical Advisor QGIS Project Steering Committee


 __**_
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/**mailman/listinfo/qgis-**developerhttp://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] 'reload' a layer

2012-06-26 Thread Germán Carrillo
Hi QGIS devs,


same question here but regarding rasters. I load a GDAL virtual raster that
is being overwritten every time a new raster is available in a raster
repository. Is there any way of reflecting the layer source updates
(changes in the vrt file) in the map?

In a more generic way, I'm attempting to visualize a tile-based raster,
from which I cannot get all tiles at once. Do you think it could be
possible in QGIS?

P.S. Loading each tile as a separate layer wouldn't be possible because of
performance.


Thanks in advance,

Germán Carrillo


2012/5/21 Germán Carrillo carrillo.ger...@gmail.com

 Hi Carson,

 have you tried updateFieldMap() from QgsVectorLayer? I've just had a
 similar problem with memory layers and it turned out to do the trick.

 Regards,

 Germán
 -
 [1]
 http://qgis.org/api/classQgsVectorLayer.html#ae703a20367b66ef0200e972f83d1

 2012/5/17 G. Allegri gioha...@gmail.com

 You're right Carson. I used it only with a WFS layer, and in fact I see
 that WFS is the only providers that implements it.
 There would be the setDataProvider method on the vector layer but it's
 private...

 You've raised an important point, that I took for granted :(
 I fear that in this moment the only solution is remove it and reload it.
 giovanni



 2012/5/17 Carson Farmer carson.far...@gmail.com

 Hi Giovanni,

 Thanks for the tip. To answer your question: I am trying to
 synchronise the layer with the datasource. Having said that, I don't
 seem to be able to get 'reload' to work. It looks like reload is
 reimplemented in QgsVectorLayer, which in turns calls the
 dataProvider's reloadData method, so this may vary by provider type? I
 tried it with a shapefile and a spatialite layer, and it did not seem
 to do anything: I deleted several fields from the shapefile and added
 a field to the spatialite layer in an external program, and these
 changes were not reflected when I 'reloaded' the layers. Am I missing
 something here? Perhaps there is something else needed to get the
 changes to 'show up'?

 Cheers,

 Carson

 On Wed, May 16, 2012 at 4:36 PM, G. Allegri gioha...@gmail.com wrote:
  Do you mean refresh the rendering or synchronizing the layer with the
 data
  source?
  I usually use QgsMapLayer::reload() for the latter, and
  QgsMapCanvas::refresh() for the first.
 
  giovanni
 
  2012/5/16 Carson Farmer carson.far...@gmail.com
 
  Hi list, does anyone know of a clever way to (programmatically) reload
  a layer without actually removing it and re-adding it to the layer
  list. Some context: I have a layer that sometimes gets updated by an
  external application, and I want to be able to 'refresh' the layer
  from the Python console to reflect these changes (new features,
  deleted features, new attributes, etc.). I *could* simply load the
  layer again, but I'm hoping there is a more efficient way to do this
  (also I want to keep the current styling, layer order, unique layer
  id, etc).
 
  Any thoughts/ideas? Note: assume we are working with a spatialite
 layer
  for now.
 
  Carson
 
  --
  Dr. Carson J. Q. Farmer
  Centre for GeoInformatics (CGI)
  School of Geography and Geosciences
  Irvine Building, University of St Andrews
  St Andrews, Fife, KY16 9AL
  Scotland, UK
  ___
  Qgis-developer mailing list
  Qgis-developer@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/qgis-developer
 
 



 --
 Dr. Carson J. Q. Farmer
 Centre for GeoInformatics (CGI)
 School of Geography and Geosciences
 Irvine Building, University of St Andrews
 St Andrews, Fife, KY16 9AL
 Scotland, UK



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




 --
 ---
|\__
 (:__)(
|/

 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/
 http://twitter.com/GeoTux2


-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] Fwd: Displaying local file's geometries as rubber bands

2012-05-29 Thread Germán Carrillo
Hi QGIS devs,

could someone please give this thread's code a try?

I've already attempted several things with no success, namely to store
layers (vlayer), features, geometries and/or rubber bands in a list. Still
I'm unable to get the geometries displayed as rubber bands, is it possible
with QGIS?

I'm using QGIS 1.8.0-Lisboa, rev. a1255fc, Python v.2.7.2, GDAL/OGR v.1.7.3

Thanks in advance,

Germán


-- Forwarded message --
From: Germán Carrillo carrillo.ger...@gmail.com
Date: 2012/5/21
Subject: Displaying local file's geometries as rubber bands
To: qgis-developer qgis-developer@lists.osgeo.org


Hi all,

I'd like to get geometries from a local file (e.g. GML) displayed as
QgsRubberBands. However, I wouldn't like to load the layer into the map
because in the real scenario there could be a large number of files to get
geometries from.

I've been attempting it with the following code (you can copy it directly
to the QGIS Python Console), but only the last feature is displayed:

#-
from qgis.core import QgsFeature, QgsVectorLayer
from qgis.gui import QgsRubberBand

def loadGMLAsRubberBands(fileName):
featList = []
rb = QgsRubberBand(qgis.utils.iface.mapCanvas(), True)

vlayer = QgsVectorLayer(fileName, layer, ogr)
allAttrs = vlayer.dataProvider().attributeIndexes()
vlayer.select(allAttrs)
f = QgsFeature()

while vlayer.dataProvider().nextFeature(f):
featList.append(f)
rb.addGeometry(featList[-1].geometry(), None)

loadGMLAsRubberBands(/tmp/gml/sample_three_features.gml)
#-

Based on the solution given in this thread [1] I'm storing the features in
a list, but somehow it doesn't work in this scenario. A sample GML file can
be found at [2].

Do you have any hint?


Regards,

Germán

---
[1] http://lists.osgeo.org/pipermail/qgis-developer/2012-May/020143.html
[2] http://ifgibox.de/g_carr02/sample_three_features.gml

-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2


-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] 'reload' a layer

2012-05-21 Thread Germán Carrillo
Hi Carson,

have you tried updateFieldMap() from QgsVectorLayer? I've just had a
similar problem with memory layers and it turned out to do the trick.

Regards,

Germán
-
[1]
http://qgis.org/api/classQgsVectorLayer.html#ae703a20367b66ef0200e972f83d1

2012/5/17 G. Allegri gioha...@gmail.com

 You're right Carson. I used it only with a WFS layer, and in fact I see
 that WFS is the only providers that implements it.
 There would be the setDataProvider method on the vector layer but it's
 private...

 You've raised an important point, that I took for granted :(
 I fear that in this moment the only solution is remove it and reload it.
 giovanni



 2012/5/17 Carson Farmer carson.far...@gmail.com

 Hi Giovanni,

 Thanks for the tip. To answer your question: I am trying to
 synchronise the layer with the datasource. Having said that, I don't
 seem to be able to get 'reload' to work. It looks like reload is
 reimplemented in QgsVectorLayer, which in turns calls the
 dataProvider's reloadData method, so this may vary by provider type? I
 tried it with a shapefile and a spatialite layer, and it did not seem
 to do anything: I deleted several fields from the shapefile and added
 a field to the spatialite layer in an external program, and these
 changes were not reflected when I 'reloaded' the layers. Am I missing
 something here? Perhaps there is something else needed to get the
 changes to 'show up'?

 Cheers,

 Carson

 On Wed, May 16, 2012 at 4:36 PM, G. Allegri gioha...@gmail.com wrote:
  Do you mean refresh the rendering or synchronizing the layer with the
 data
  source?
  I usually use QgsMapLayer::reload() for the latter, and
  QgsMapCanvas::refresh() for the first.
 
  giovanni
 
  2012/5/16 Carson Farmer carson.far...@gmail.com
 
  Hi list, does anyone know of a clever way to (programmatically) reload
  a layer without actually removing it and re-adding it to the layer
  list. Some context: I have a layer that sometimes gets updated by an
  external application, and I want to be able to 'refresh' the layer
  from the Python console to reflect these changes (new features,
  deleted features, new attributes, etc.). I *could* simply load the
  layer again, but I'm hoping there is a more efficient way to do this
  (also I want to keep the current styling, layer order, unique layer
  id, etc).
 
  Any thoughts/ideas? Note: assume we are working with a spatialite layer
  for now.
 
  Carson
 
  --
  Dr. Carson J. Q. Farmer
  Centre for GeoInformatics (CGI)
  School of Geography and Geosciences
  Irvine Building, University of St Andrews
  St Andrews, Fife, KY16 9AL
  Scotland, UK
  ___
  Qgis-developer mailing list
  Qgis-developer@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/qgis-developer
 
 



 --
 Dr. Carson J. Q. Farmer
 Centre for GeoInformatics (CGI)
 School of Geography and Geosciences
 Irvine Building, University of St Andrews
 St Andrews, Fife, KY16 9AL
 Scotland, UK



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




-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] Displaying local file's geometries as rubber bands

2012-05-21 Thread Germán Carrillo
Hi all,

I'd like to get geometries from a local file (e.g. GML) displayed as
QgsRubberBands. However, I wouldn't like to load the layer into the map
because in the real scenario there could be a large number of files to get
geometries from.

I've been attempting it with the following code (you can copy it directly
to the QGIS Python Console), but only the last feature is displayed:

#-
from qgis.core import QgsFeature, QgsVectorLayer
from qgis.gui import QgsRubberBand

def loadGMLAsRubberBands(fileName):
featList = []
rb = QgsRubberBand(qgis.utils.iface.mapCanvas(), True)

vlayer = QgsVectorLayer(fileName, layer, ogr)
allAttrs = vlayer.dataProvider().attributeIndexes()
vlayer.select(allAttrs)
f = QgsFeature()

while vlayer.dataProvider().nextFeature(f):
featList.append(f)
rb.addGeometry(featList[-1].geometry(), None)

loadGMLAsRubberBands(/tmp/gml/sample_three_features.gml)
#-

Based on the solution given in this thread [1] I'm storing the features in
a list, but somehow it doesn't work in this scenario. A sample GML file can
be found at [2].

Do you have any hint?


Regards,

Germán

---
[1] http://lists.osgeo.org/pipermail/qgis-developer/2012-May/020143.html
[2] http://ifgibox.de/g_carr02/sample_three_features.gml

-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] Couldn't load PyQGIS after downgrading PyQt4

2012-05-16 Thread Germán Carrillo
Hi devs,

does anyone know why I'm getting a Couldn't load PyQGIS error when
starting QGIS? I'm working with QGIS 1.8.0-Lisboa, a1255fc, Python 2.7.2.

I've just downgraded PyQt4 from 4.8.5 to 4.8.3 on Ubuntu Oneiric. I had to
remove qgis-python before downgrading but I already installed it again. The
error message is:

---

Traceback (most recent call last):
  File , line 1, in
RuntimeError: the PyQt4.QtCore module is version -1 but the qgis.core
module requires version 1
---

The strange thing is that I'm able to load PyQt4.QtCore from a Python
terminal.


Regards,

Germán

-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Next Hackfest Location

2012-05-07 Thread Germán Carrillo
Auch Ich möchte Essen. :)

Perhaps I could attend my first HF there.

Regards,

Germán

2012/5/7 Werner Macho werner.ma...@gmail.com

 On 07/05/12 16:26, Horst Düster wrote:


 Please let me know what are the next steps to find a decsison.

 Regards
 Horst



 Don't know what the steps are but ..
 +1 from me for Essen ..

 kind regards
 Werner


 __**_
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/**mailman/listinfo/qgis-**developerhttp://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] New version of a plug-in to be approved

2012-03-29 Thread Germán Carrillo
Hi all,

could some dev please approve the new version of my plug-in Load them
all [1]?

Regards,

Germán


[1] http://planet.qgis.org/plugins/loadthemall/

-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] New version of a plug-in to be approved

2012-03-29 Thread Germán Carrillo
Thanks a lot!

2012/3/29 Nathan Woodrow madman...@gmail.com

 Done

 Also added you as a trusted author so it will auto approve from now on.

 - Nathan

 Sent from some fancy phone looking thingo
 From: Germán Carrillo
 Sent: 29/03/2012 8:35 PM
 To: qgis-developer
 Subject: [Qgis-developer] New version of a plug-in to be approved
 Hi all,

 could some dev please approve the new version of my plug-in Load them
 all [1]?

 Regards,

 Germán

 
 [1] http://planet.qgis.org/plugins/loadthemall/

 --
 ---
   |\__
 (:__)(
   |/

 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/
 ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] current layer changed signal

2012-02-28 Thread Germán Carrillo
Hi,

what about this?

http://www.qgis.org/api/classQgisInterface.html#7e502c8c406538e6b518c4d93cc741d8

Regards,

Germán

2012/2/28 Denis Rouzaud denis.rouz...@gmail.com

 Hi all,

 I could not find any signal emitted when the current layer of the map
 canvas changes.
 I only found the currentlayer() function in mapCanvas and nothing in the
 legendInterface.

 Did I miss something, is there a lack or is there a reason for this?

 Thanks

 Denis
 __**_
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/**mailman/listinfo/qgis-**developerhttp://lists.osgeo.org/mailman/listinfo/qgis-developer

-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] Plugin not yet accepted

2012-02-06 Thread Germán Carrillo
Hi all,

some days ago I uploaded a couple of plugins to [1]. One of them was
approved but the other one [2] was not. Could somebody please check
it? If necessary, my user account is gcarrillo.

Regards,

Germán

[1] http://plugins.qgis.org/plugins/
[2] http://plugins.qgis.org/plugins/RemoveEmptyLayers/

-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] How to debug and unit test Python plugins outside QGIS (e.g. in Ecplise IDE + PyDev)

2012-01-10 Thread Germán Carrillo
Hi,

you can find an example at [1], namely a class called QgisInterface in
the postgis_viewer.py, line 313.

Hope it helps.

Regards,

Germán

---
[1]
http://downloads.tuxfamily.org/tuxgis/geoblogs/visor_postgis_pgadmin_3/postgis_viewer.zip


2012/1/10 Tim Sutton li...@linfiniti.com

 Hi

 On Tue, Jan 10, 2012 at 7:08 PM, Martin Dobias wonder...@gmail.com
 wrote:
  On Thu, Mar 3, 2011 at 10:40 AM, Martin Dobias wonder...@gmail.com
 wrote:
 
  The only difference when running unit-tests (i.e. standalone apps) is
  that you cannot access QGIS interface (qgis.utils.iface) since there
  is no QGIS running. But that should not pose a big problem. In case
  you really need access to that interface you can create your own
  implementation of QgisInterface class and assign it to
  qgis.utils.iface.
 
  Regards
  Martin
 
  Martin do you (or anyone else) have example code for creating an iface
  instance from a standalone python / QGIS app?
 
  Hi Tim
 
  no I do not have a working example. In general it should be something
 like this:
 
  import qgis.utils
  import qgis.gui
 
  class MyQgisInterface(qgis.gui.QgisInterface):
   def __init__(self):
 QgisInterface.__init__(self)
   def mapCanvas(self):
 return FOO
   def mainWindow(self):
 return BAR
   def activeLayer(self):
 return BAZ
   # ... more methods ...
 
  # use our interface instance
  qgis.utils.iface = MyQgisInterface()
 
  You will have to provide implementation of all the abstract virtual
  functions defined in QgisInterface. Luckily most of them are not used
  by plugins, so you may provide just implementations not
  doing/returning anything - depending on how precisely would you like
  to imitate QGIS environment.
 

 Thanks Martin. Yes I have used the same approach in openModeller
 desktop some years ago to allow it to use QGIS (C++) plugins - I was
 just interested to know if someone had already baked a python
 equivalent in keeping with DRAY (dont repeat anyone else :-)).

 I'll go ahead and make an attempt at a python one then, thanks.

 Regards

 Tim


  Regards
  Martin



 --
 Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
 ==
 Please do not email me off-list with technical
 support questions. Using the lists will gain
 more exposure for your issues and the knowledge
 surrounding your issue will be shared with all.

 Visit http://linfiniti.com to find out about:
  * QGIS programming and support services
  * Mapserver and PostGIS based hosting plans
  * FOSS Consulting Services
 Skype: timlinux
 Irc: timlinux on #qgis at freenode.net
 ==
 ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Quality assurance (was: Georeferencer produces wrong (shifted) result)

2011-12-17 Thread Germán Carrillo
I agree with Agustin.

Here in my University, QGIS is seen as a 'buggy' software, so some
professors and lecturers are not considering it anymore and are choosing
proprietary software for the exercises. In such a scenario there is nothing
a promoter of FOSS4G (and specially QGIS) like me can do to revert things.

I myself stopped installing each QGIS new version in my laptop because I
know there are lots of bugs I don't want to deal with, so I stuck to a
version I know works in a predictable way. I've also reported some bugs but
nothing seems to happen with the report after a while and that discourages
users like me. For me it seems that the bug doesn't care anyone, not even
the author of the module/plug-in. I remember some time ago I enjoyed fixing
small bugs in the QGIS Table of contents (TOC) but it turned out the TOC
was totally changed afterwards (by the way, I find annoying to move layers
in this new TOC.)

I think you already suggested something like an ongoing contest of bug
fixes. I thing this simple thing could encourage people to visit the bug
tracker and see what they can fix. Of course, I don't know whether you have
enough time to arrange it.

Just my 2 cents.

Regards,

Germán

2011/12/17 Agustin Lobo alobolis...@gmail.com

 I agree with Paolo and furthermore think that taking action is urgent:
 qgis has a serious risk of getting the label of unreliable tool and
 that label will be very difficult to overcome afterwards.
 I personally confess I feel uncomfortable every time I use it for a
 course because you never know
 what bugs the students are going to find. This last time has worked
 quite well (except on Macs, where
 it has shown to be very unstable), but thanks to the fact that I
 realized the error in georeferencing before the class and
 skipped that exercise. Otherwise, can you imagine the opinion of the
 students towards qgis after
 getting the result shown earlier in this thread? On the other hand,
 styling of rasters is so insufficient that I have to use other
 software to explain the parts related to operations through histogram.

 I personally think that if we are a sufficient number of users willing
 to act as testers we should start doing it right now, not waiting for
 the result of discussions any more.We should consider all releases of
 qgis as RC for us and publish the results of
 our testing as soon as we can after the release. The rest of users
 will decide upon our results.  I understand the interest of many
 developers is having qgis as a test bed and not a producing
 environment and I respect that point of view that makes possible that
 so many improvements and new tools become widely distributed, but
 users requiring a reliable tool must have a tested software with a
 clear summary of the operational problems they will face.

 Agus


 2011/12/16 Paolo Cavallini cavall...@faunalia.it:
  Il 16/12/2011 18:53, Werner Macho ha scritto:
 
  I dont think we need a Release Candidate cycle - From my point that will
  bring only more confuse into the release cycle..
 
  So why most respected and established projects follow this route?
  Now QGIS is used very widely in professional contexts, and releasing
 supposedly
  stable packages with nasty regressions (as it is happening) brings no
 good to our
  users and reputation.
  I think our QA approach should improve, one way or another.
  All the best.
  --
  Paolo Cavallini - Faunalia
  www.faunalia.eu
  Full contact details at www.faunalia.eu/pc
  ___
  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




-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Quality assurance

2011-12-17 Thread Germán Carrillo
 I think this is the exception rather than the rule. I see QGIS adoption
increasing at
 a speedy pace, and in fact eroding the position of several other
programs, both
 proprietary and free. Here in Italy the increase is rather spectacular.

Then I'm relieved, I was just describing the situation in my university.

 I think this is the root of the problem: if you do not want to deal with
your
 problems, why do you expect somebody else to do it for you, and for free?

I consider those are not 'my' problems, I can perfectly keep using the
version I'm using but new users will have to deal with them anyway. By the
way, you omitted the paragraph where I said that some time ago I didn't
expect somebody else to do it for me, I fixed the bugs that were bothering
me.

 I care of the bugs that are a problem for me, either by fixing them
myself or by
 paying someone to do it for you.

That's right, but perhaps another way to care about bugs is filling a
ticket, if I don't care I don't even fill the ticket. I think this is not a
binary decision: either you pay or you fix it. You can also contribute to
the project by reporting bugs, can't you? Additionally, we users expect
developers to be cared for bugs in their own plug-ins, are we wrong at
this?

 To have a proper contest, we should have money to fuel it. So everybody
is encouraged
 to contribute, with their time, donation, or sponsorship.

Ok.


And please don't get me wrong. QGIS devs are great in what they do and I
gratefully acknowledge their effort!

Regards,

Germán

2011/12/17 Paolo Cavallini cavall...@faunalia.it

 Il 17/12/2011 11:04, Germán Carrillo ha scritto:

  Here in my University, QGIS is seen as a 'buggy' software, so some
 professors and
  lecturers are not considering it anymore and are choosing proprietary
 software for
  the exercises.

 I think this is the exception rather than the rule. I see QGIS adoption
 increasing at
 a speedy pace, and in fact eroding the position of several other programs,
 both
 proprietary and free. Here in Italy the increase is rather spectacular.

  I myself stopped installing each QGIS new version in my laptop because I
 know there
  are lots of bugs I don't want to deal with

 I think this is the root of the problem: if you do not want to deal with
 your
 problems, why do you expect somebody else to do it for you, and for free?

  predictable way. I've also reported some bugs but nothing seems to
 happen with the
  report after a while and that discourages users like me. For me it seems
 that the bug
  doesn't care anyone, not even the author of the module/plug-in.

 I care of the bugs that are a problem for me, either by fixing them myself
 or by
 paying someone to do it for you.

  I think you already suggested something like an ongoing contest of bug
 fixes. I thing
  this simple thing could encourage people to visit the bug tracker and
 see what they
  can fix. Of course, I don't know whether you have enough time to arrange
 it.

 To have a proper contest, we should have money to fuel it. So everybody is
 encouraged
 to contribute, with their time, donation, or sponsorship.
 Thanks.

 --
 Paolo Cavallini - Faunalia
 www.faunalia.eu
 Full contact details at www.faunalia.eu/pc




-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] quick noob python question

2011-12-16 Thread Germán Carrillo
Hi Duarte,

well, now I understand better your first question. Sorry for the confusion.

Regarding the 1 million dollars, I think I'll let anyone else to get them
(which means: I don't know the answer :) ).

Regards,

Germán

2011/12/16 Duarte Carreira dcarre...@edia.pt

 Hi Germán.

 ** **

 Your tips are exactly what I was looking for!

 ** **

 So I can now open a dialog:

 ** **

 iface=qgis.utils.iface

 menu=iface.layerMenu()

 myActions=menu.actions()

 myAction=[ac for ac in myActions if
 ac.objectName()==mActionEmbedLayers][0]

 myAction.trigger()

 ** **

 So now for the final 1 million dollar question: can I change the first
 textbox in the dialog?

 ** **

 Thanks,

 Duarte

 ** **

 *De:* Germán Carrillo [mailto:carrillo.ger...@gmail.com]
 *Enviada:* quinta-feira, 15 de Dezembro de 2011 13:26
 *Para:* Duarte Carreira; qgis-developer@lists.osgeo.org

 *Assunto:* Re: [Qgis-developer] quick noob python question

 ** **

 Hi Duarte,

 if I understood well, you would like to simulate a click in QGIS buttons.
 For this you can use the slot trigger() of the available QAction's in the
 class QgisInteface [1]. For example, if you want to open the Open
 Project... dialog you can type this in the Python Console (inside QGIS):*
 ***

 iface=qgis.utils.iface

 iface.actionOpenProject().trigger()


 Regarding Toolbars, you can also access them from the QgisInterface class.
 For example, to access the Layer menu do this:

 iface=qgis.utils.iface

 m=iface.layerMenu()

 ** **

 Since a menu consists of a set of actions you could trigger any action of
 the menu: 

 ** **

 iface=qgis.utils.iface

 for a in m.actions():

 print a.text()

 m.actions()[2].trigger()


 Hope this helps.

 Regards,

 Germán

 -
 [1] http://www.qgis.org/api/classQgisInterface.html 

 2011/12/15 Duarte Carreira dcarre...@edia.pt

 Just an additional question: generally speaking the gui is not accessible
 from python? We cannot simulate a toolbar button click, or menu item?

  

 Duarte

  

 *De:* Duarte Carreira [mailto:dcarre...@edia.pt]
 *Enviada:* quarta-feira, 14 de Dezembro de 2011 17:05
 *Para:* Germán Carrillo; qgis-developer@lists.osgeo.org
 *Assunto:* RE: [Qgis-developer] quick noob python question

  

 Germán, thanks.

  

 Maybe that’s what I’ll do, but it pains me to duplicate code…

  

 Duarte

  

 *De:* Germán Carrillo [mailto:carrillo.ger...@gmail.com]
 *Enviada:* quarta-feira, 14 de Dezembro de 2011 12:30
 *Para:* qgis-developer@lists.osgeo.org; Duarte Carreira
 *Assunto:* Re: [Qgis-developer] quick noob python question

  

 Hi Duarte,

 from my experience it is not possible. You can of course re-use the ui
 file and implement the whole functionality on your own based on the cpp
 file, basically a translation from C++ to Python. I've done this before and
 it is not a complex process, but it requires time.

 By the way, the folder app of QGIS source code contains
 QGIS-application-specific code, so I would say you won't find there
 functionality available in PyQGIS, for that you would have to have a look
 to the gui and core folders.

 Perhaps there are other ways to set the project file programmatically from
 Python, but I don't know them, sorry.

 Regards,

 Germán

 2011/12/14 Duarte Carreira dcarre...@edia.pt

 Using python is it possible to call QgsEmbedLayerDialog and set the
 project file programmatically (mProjectFileLineEdit)?

  


 https://github.com/qgis/Quantum-GIS/blob/release-1_8/src/app/qgsembedlayerdialog.cpp
 


 https://github.com/qgis/Quantum-GIS/blob/release-1_8/src/ui/qgsembedlayerdialogbase.ui
 

  

 Thanks,
 Duarte Carreira

  


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

 --
 ---
   |\__
 (:__)(
   |/

 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/




 --
 ---
   |\__
 (:__)(
   |/

 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/




-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] quick noob python question

2011-12-15 Thread Germán Carrillo
Hi Duarte,

if I understood well, you would like to simulate a click in QGIS buttons.
For this you can use the slot trigger() of the available QAction's in the
class QgisInteface [1]. For example, if you want to open the Open
Project... dialog you can type this in the Python Console (inside QGIS):

 iface=qgis.utils.iface

iface.actionOpenProject().trigger()

Regarding Toolbars, you can also access them from the QgisInterface class.
For example, to access the Layer menu do this:

iface=qgis.utils.iface

m=iface.layerMenu()


Since a menu consists of a set of actions you could trigger any action of
the menu:


iface=qgis.utils.iface

m=iface.layerMenu()

for a in m.actions():

print a.text()

m.actions()[2].trigger()


Hope this helps.

Regards,

Germán

-
[1] http://www.qgis.org/api/classQgisInterface.html

2011/12/15 Duarte Carreira dcarre...@edia.pt

 Just an additional question: generally speaking the gui is not accessible
 from python? We cannot simulate a toolbar button click, or menu item?

 ** **

 Duarte

 ** **

 *De:* Duarte Carreira [mailto:dcarre...@edia.pt]
 *Enviada:* quarta-feira, 14 de Dezembro de 2011 17:05
 *Para:* Germán Carrillo; qgis-developer@lists.osgeo.org
 *Assunto:* RE: [Qgis-developer] quick noob python question

 ** **

 Germán, thanks.

 ** **

 Maybe that’s what I’ll do, but it pains me to duplicate code…

 ** **

 Duarte

 ** **

 *De:* Germán Carrillo [mailto:carrillo.ger...@gmail.com]
 *Enviada:* quarta-feira, 14 de Dezembro de 2011 12:30
 *Para:* qgis-developer@lists.osgeo.org; Duarte Carreira
 *Assunto:* Re: [Qgis-developer] quick noob python question

 ** **

 Hi Duarte,

 from my experience it is not possible. You can of course re-use the ui
 file and implement the whole functionality on your own based on the cpp
 file, basically a translation from C++ to Python. I've done this before and
 it is not a complex process, but it requires time.

 By the way, the folder app of QGIS source code contains
 QGIS-application-specific code, so I would say you won't find there
 functionality available in PyQGIS, for that you would have to have a look
 to the gui and core folders.

 Perhaps there are other ways to set the project file programmatically from
 Python, but I don't know them, sorry.

 Regards,

 Germán

 2011/12/14 Duarte Carreira dcarre...@edia.pt

 Using python is it possible to call QgsEmbedLayerDialog and set the
 project file programmatically (mProjectFileLineEdit)?

  


 https://github.com/qgis/Quantum-GIS/blob/release-1_8/src/app/qgsembedlayerdialog.cpp
 


 https://github.com/qgis/Quantum-GIS/blob/release-1_8/src/ui/qgsembedlayerdialogbase.ui
 

  

 Thanks,
 Duarte Carreira

  


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

 --
 ---
   |\__
 (:__)(
   |/

 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/




-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Re: Python - recreate the exact Legend in a QTreeWidget

2011-06-20 Thread Germán Carrillo
Hi Kimaidou,

may you share your solution? It may be useful for some people here
(including myself).

Regards,

Germán

2011/6/20 kimaidou kimai...@gmail.com

 Hi all

 I managed to reconstruct my legend in my QTreeWidget by using a dictionary
 to store the item I have already added in the tree while looping through
 groupLayerRelationship !

 Cheers
 Kimaidou


 2011/6/20 kimaidou kimai...@gmail.com

 Hi devs,

 I am a bit stuck here
 I would like to recreate the complete legend tree inside a python plugin.
 I have chosen to use a QtreeWidget to do so.

 Imagine I have:
 *
 group 0 (empty)

 group 1
 |-- group 11
|-- layer 11a
|-- layer 11b
 |-- layer 1a

 layer a

 group 2
 |-- group 21
 |-- layer 2a
 ***

 I have seen the

 iface.legendInterface().groupLayerRelationship()

 returns usefull information, but in a flat C-style way like :


 [
   ['group 0', [] ],
   ['group 1', ['group 11', 'layer_1a_10020100526085601790'] ],
   ['', ['layer_a_20110617181245226'] ],
   ['group 2', ['groupe21', 'layer_2a_20110616121558434'] ],
   ['group 11', ['layer_11a_20100526085601799',
 'layer_11b_gen20100526100356932'] ],
   ['groupe21', []]
 ]


 I would like to loop though this result and create my own hierarchical
 representation such as :
 [
 'name' : 'group 0' , 'type' : 'group', 'children' : [],
 'name' : 'group 1' , 'type' : 'group', 'children' : [
 'name' : 'group 11' , 'type' : 'group', 'children' : [
 'name' : 'layer 11a' , 'type' : 'layer', 'children' : [],
 'name' : 'layer 11b' , 'type' : 'layer', 'children' : []
 ],
 'name' : 'layer 1a' , 'type' : 'layer', 'children' : []
 ],
 'name' : 'layer a' , 'type' : 'layer', 'children' : [],
 'name' : 'group 2' , 'type' : 'group', 'children' : [
 'name' : 'group 21' , 'type' : 'group', 'children' : [],
 'name' : 'layer 2a' , 'type' : 'layer', 'children' : []
 ]
 ]

 I have tried hard since yesterday, but have not succeeded... Has anyone
 already encoutered this need ?

 Thanks in advance,
 kimaidou



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


-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Re: Python - recreate the exact Legend in a QTreeWidget

2011-06-20 Thread Germán Carrillo
I appreciate it!

Regards

2011/6/20 kimaidou kimai...@gmail.com

 Of course !

 This is basically what I have done :

 http://pastebin.com/1yhyuRxA

 Regards,

Kimaidou


 2011/6/20 Germán Carrillo carrillo.ger...@gmail.com

 Hi Kimaidou,

 may you share your solution? It may be useful for some people here
 (including myself).

 Regards,

 Germán

 2011/6/20 kimaidou kimai...@gmail.com

 Hi all

 I managed to reconstruct my legend in my QTreeWidget by using a
 dictionary to store the item I have already added in the tree while looping
 through groupLayerRelationship !

 Cheers
 Kimaidou


 2011/6/20 kimaidou kimai...@gmail.com

 Hi devs,

 I am a bit stuck here
 I would like to recreate the complete legend tree inside a python
 plugin. I have chosen to use a QtreeWidget to do so.

 Imagine I have:
 *
 group 0 (empty)

 group 1
 |-- group 11
|-- layer 11a
|-- layer 11b
 |-- layer 1a

 layer a

 group 2
 |-- group 21
 |-- layer 2a
 ***

 I have seen the

 iface.legendInterface().groupLayerRelationship()

 returns usefull information, but in a flat C-style way like :


 [
   ['group 0', [] ],
   ['group 1', ['group 11', 'layer_1a_10020100526085601790'] ],
   ['', ['layer_a_20110617181245226'] ],
   ['group 2', ['groupe21', 'layer_2a_20110616121558434'] ],
   ['group 11', ['layer_11a_20100526085601799',
 'layer_11b_gen20100526100356932'] ],
   ['groupe21', []]
 ]


 I would like to loop though this result and create my own hierarchical
 representation such as :
 [
 'name' : 'group 0' , 'type' : 'group', 'children' : [],
 'name' : 'group 1' , 'type' : 'group', 'children' : [
 'name' : 'group 11' , 'type' : 'group', 'children' : [
 'name' : 'layer 11a' , 'type' : 'layer', 'children' : [],
 'name' : 'layer 11b' , 'type' : 'layer', 'children' : []
 ],
 'name' : 'layer 1a' , 'type' : 'layer', 'children' : []
 ],
 'name' : 'layer a' , 'type' : 'layer', 'children' : [],
 'name' : 'group 2' , 'type' : 'group', 'children' : [
 'name' : 'group 21' , 'type' : 'group', 'children' : [],
 'name' : 'layer 2a' , 'type' : 'layer', 'children' : []
 ]
 ]

 I have tried hard since yesterday, but have not succeeded... Has anyone
 already encoutered this need ?

 Thanks in advance,
 kimaidou



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


 --
 ---
   |\__
 (:__)(
   |/

 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/





-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Antialiasing not working in standalone PyQGIS app

2011-03-02 Thread Germán Carrillo
Hi Ivan,

right now I am working on the plugin and I have finally gotten the
antialiasing working as expected with these two lines:

---
self.canvas.useImageToRender( True )
self.canvas.enableAntiAliasing( True )
---

I am not sure if that is the appropriate way to get it working but... it
works.

I plan to release the plugin soon, but I need to do the
multi-layer-properties stuff before.

Regards,

Germán


2011/3/2 Ivan Mincik ivan.min...@gmail.com

 Hi all,
 we are developing simple PyQGIS PostGIS viewer [1], [2] and having
 troubles to get antialiasing working. Code is the same as in PyQGIS
 Cookbook, but not working with current QGIS trunk version (
 self.canvas.enableAntiAliasing( True ) in QMainWindow class ).

 Can somebody look at code [1] (line 137 in 'postgis_viewer.py' ) and
 confirm that I should fill bug report?




 [1] - https://github.com/imincik/QgsPostGIS-Viewer/tree/multilayer
 [2] - https://github.com/imincik/QgsPostGIS-Viewer

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




-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] Re: PyQGIS Cookbook, MySQL geometries and Graduated symbol renderer

2011-03-01 Thread Germán Carrillo
Hi Martin,

I was unable to get the code highlighted in an appropriate way. However,
here is the patch [1].

Regards,

Germán

--
[1] https://trac.osgeo.org/qgis/ticket/3536

2011/2/28 Martin Dobias wonder...@gmail.com

 2011/2/28 Germán Carrillo carrillo.ger...@gmail.com:
  Hi Martin,
  I would like to propose a couple of Python snippets to be included in the
  PyQGIS Cookbook.
  1)  Load of MySQL geometries:
  2) Graduated symbol renderer (Old symbology):

 Hi German,

 thank you for the snippets. Would you mind to spend few more minutes
 with that to add some comments and prepare a patch for the cookbook?
 The sources are in SVN repository here:
 http://svn.osgeo.org/qgis/docs/trunk/english_us/developer_cookbook/

 That would speed up the addition to the cookbook.

 Regards
 Martin




-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] PyQGIS Cookbook, MySQL geometries and Graduated symbol renderer

2011-02-27 Thread Germán Carrillo
Hi Martin,

I would like to propose a couple of Python snippets to be included in the
PyQGIS Cookbook.

1)  Load of MySQL geometries:
--
uri =
MySQL:dbname,host=localhost,port=3306,user=root,password=xxx|layername=my_table
vLayer = QgsVectorLayer( uri, 'my_table', 'ogr' )
--
BTW, I'm not sure if it is the best way to do it, but it works.

2) Graduated symbol renderer (Old symbology):
--
fieldName = My_Field
numberOfClasses = 5
mFieldMap = {}

# Get the field index based on the field name
fields = layer.pendingFields()
for ( key, field ) in fields.iteritems():
if field.type() == QVariant.Int or field.type() == QVariant.Double:

mFieldMap[ str( field.name() ) ] = key
fieldIndex = mFieldMap[ fieldName ]

# Create the renderer object
renderer = QgsGraduatedSymbolRenderer( layer.geometryType() )
renderer.setMode( QgsGraduatedSymbolRenderer.EqualInterval ) #
EqualInterval/Quantile/Empty

# Prepare the required symbol objects
symbolList = []
geom = layer.geometryType()
provider = layer.dataProvider()
for i in range( numberOfClasses ):
symbol = QgsSymbol( geom )
brush = QBrush()
brush.setColor( self.randomColor() )
brush.setStyle( Qt.SolidPattern )
symbol.setBrush( brush )
symbolList.append( symbol )

# Define classes
minimum = provider.minimumValue( fieldIndex ).toDouble()[ 0 ]
maximum = provider.maximumValue( fieldIndex ).toDouble()[ 0 ]
for i in range( numberOfClasses ):
# Switch if attribute is int or double
lower = ('%.*f' % (2, minimum + ( maximum - minimum ) / numberOfClasses
* i ) )
upper = ('%.*f' % (2, minimum + ( maximum - minimum ) / numberOfClasses
* ( i + 1 ) ) )

lowerString = QVariant( lower ).toString()
upperString = QVariant( upper ).toString()
symbolList[ i ].setLowerValue( lowerString )
symbolList[ i ].setUpperValue( upperString )
symbolList[ i ].setLabel( lowerString +  -  + upperString )

# Define a symbol object based on each class
for i in range( numberOfClasses ):
symbol = symbolList[ i ]
lower_bound = symbol.lowerValue()
upper_bound = symbol.upperValue()
label = symbol.label()

sy = QgsSymbol( layer.geometryType(), lower_bound, upper_bound, label )
sy.setFillColor( symbol.brush().color() )
sy.setFillStyle( symbol.brush().style() )

renderer.addSymbol( sy )

renderer.setClassificationField( fieldIndex )
layer.setRenderer( renderer )
--


Regards,

Germán

-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] Layer list widget for PyQGIS applications

2011-01-17 Thread Germán Carrillo
Hi all,

first of all, sorry for the delay in publishing this :-)

At [1] you can find a basic layer list (legend) widget for PyQGIS standalone
applications. It's under GPL v.2. and it is based on the OpenOceanMap legend
[2] written by Aaron Racicot and, of course, on the QGIS layer list widget.

See [1] for further information and instructions to add it to your
application.

Regards,

Germán

---
[1]
http://geotux.tuxfamily.org/index.php?option=com_myblogtask=viewid=270Itemid=59lang=en
[2] http://svn.infodrizzle.org/openocean/trunk/openoceanmap/Tools/legend.py

-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Determine QGIS version from Python

2011-01-05 Thread Germán Carrillo
Try this:

from qgis.core import QGis
print QGis.QGIS_VERSION

if QGis.QGIS_VERSION[0:3] = 1.5:
...

Regards,

Germán

2011/1/5 Chris Crook ccr...@linz.govt.nz

 Hi All

 I'm looking for help on how to find the Qgis version that is running from
 Python, in order to put version conditional code into a plugin.

 I think that generally it is a better idea to test specific capabilities,
 but in this case I can't find a way to do that either :-(

 Thanks for any help
 Chris

 __

 This message contains information, which is confidential 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




-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Plugin GdalTools - Build Virtual Raster (catalog) idea to develop

2010-11-24 Thread Germán Carrillo
Hi all,

I think you may reuse some code of the Load Them All Plugin [1] to
accomplish this.

Regards,

Germán

---
[1]
http://geotux.tuxfamily.org/index.php?option=com_myblogtask=viewid=264Itemid=59lang=en

2010/11/24 Giuseppe Sucameli sucam...@faunalia.it

 Hi Santiago,

 On Wed, Nov 24, 2010 at 6:01 PM, Santiago Lastra 
 santiago.las...@gmail.com wrote:

 Recently I've found this very interesting and useful tool, at least for
 me. I will propose two ways to improve the tool:
 - The tool right now offers the user the possibility to select as many
 files as he wants inside a directory. I propose to give also the possibility
 to define only a directory that contains raster files (of every kind), with
 a check box to give the oportunity to follow the subdirectories of the first
 one.

 there's an opened ticket yet, see [1] ;)

  - I think it's better to explain my problem and I think you will
 understand the reason of my second proposal. I have directories with up to
 2000 raster files or even more. If you try the tool as is and if you select
 add to canvas, it takes several minutes to load and see the virtual raster
 catalog (VRT) into QGIS, but if I zoom in to the right scale QGIS move the
 images very quickly. What I suggest is to add in the dialog the possibility
 to define the scale dependent visibility when the VRT is added to the TOC
 of QGIS.

 Why don't you stop the rendering? So you can set the scale dependent
 visibility
 range using the existent layer properties dialog.

 Simply you can disable it either before you add the layer or while QGis
 loads it.
 Or maybe did I misunderstand?

 Cheers.

 [1] https://trac.osgeo.org/qgis/ticket/3095


 --
 Giuseppe Sucameli


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

 --
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Plugin GdalTools - Build Virtual Raster (catalog) idea to develop

2010-11-24 Thread Germán Carrillo
Giuseppe,

I mean, the Load Them All plugin receives a base directory and an extension
(e.g. GML) to look for layers in the base directory and in its
subdirectories. It also loads those layers to QGIS by managing the canvas
setRenderFlag method to avoid an unnecessary waste of time in the process.

Regards,

Germán

2010/11/24 Giuseppe Sucameli sucam...@faunalia.it

 Hi Germán,

 2010/11/24 Germán Carrillo carrillo.ger...@gmail.com

 I think you may reuse some code of the Load Them All Plugin [1] to
 accomplish this.

 what did you mean writing to accomplish this, to load the layers or
 maybe to do a recursive scan?

 Cheers.


 Regards,

 Germán

 ---
 [1]
 http://geotux.tuxfamily.org/index.php?option=com_myblogtask=viewid=264Itemid=59lang=en

 2010/11/24 Giuseppe Sucameli sucam...@faunalia.it

  Hi Santiago,

 On Wed, Nov 24, 2010 at 6:01 PM, Santiago Lastra 
 santiago.las...@gmail.com wrote:

 Recently I've found this very interesting and useful tool, at least for
 me. I will propose two ways to improve the tool:
 - The tool right now offers the user the possibility to select as many
 files as he wants inside a directory. I propose to give also the 
 possibility
 to define only a directory that contains raster files (of every kind), with
 a check box to give the oportunity to follow the subdirectories of the 
 first
 one.

 there's an opened ticket yet, see [1] ;)

  - I think it's better to explain my problem and I think you will
 understand the reason of my second proposal. I have directories with up to
 2000 raster files or even more. If you try the tool as is and if you select
 add to canvas, it takes several minutes to load and see the virtual 
 raster
 catalog (VRT) into QGIS, but if I zoom in to the right scale QGIS move the
 images very quickly. What I suggest is to add in the dialog the possibility
 to define the scale dependent visibility when the VRT is added to the TOC
 of QGIS.

 Why don't you stop the rendering? So you can set the scale dependent
 visibility
 range using the existent layer properties dialog.

 Simply you can disable it either before you add the layer or while QGis
 loads it.
 Or maybe did I misunderstand?

 Cheers.

 [1] https://trac.osgeo.org/qgis/ticket/3095


 --
 Giuseppe Sucameli


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

 --
 ---
   |\__
 (:__)(
   |/

 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/

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




 --
 Giuseppe Sucameli




-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Plugin GdalTools - Build Virtual Raster (catalog) idea to develop

2010-11-24 Thread Germán Carrillo
The waste of time occurs when you call the add layer methods (either vector
or raster) several times and the QGIS canvas is refreshed once by layer, so
you can see every layer refreshing the canvas unnecesarily. For me it's
certainly a waste of time. Anyway, QGIS manages this in an appropriate way
by providing the setRenderFlag method.

As Santiago proposed, he'd like the Build Virtual Raster tool to take into
account files in subdirectories, so you can use some code of the Load Them
All plugin to achieve this, particularly the getFilesToLoad method in
LoadFiles.py. Of course, you won't load more than one layer, but anyway you
need to look for layers in subdirectories.

I'm just trying to help, if you find my comments causing troubles please
ignore them :)

Regards,

Germán

2010/11/24 Giuseppe Sucameli sucam...@faunalia.it

 Germán,

 2010/11/25 Germán Carrillo carrillo.ger...@gmail.com

 I mean, the Load Them All plugin receives a base directory and an extension
 (e.g. GML) to look for layers in the base directory and in its
 subdirectories. It also loads those layers to QGIS by managing the canvas
 setRenderFlag method to avoid an unnecessary waste of time in the process.

 the BuildVRT tool add only one layer to canvas. I unable to find the waste
 of time
 in cases like this.

 Instead managing the render flag would be pretty useful in batch tools
 (e.g. Translate).
 Thanks a lot, I'm going to improve each batch tool by properly
 disabling/enabling the
 render flag while it adds layers to canvas.

 Cheers.

 Regards,

 Germán

 2010/11/24 Giuseppe Sucameli sucam...@faunalia.it

 Hi Germán,

 2010/11/24 Germán Carrillo carrillo.ger...@gmail.com

 I think you may reuse some code of the Load Them All Plugin [1] to
 accomplish this.

 what did you mean writing to accomplish this, to load the layers or
 maybe to do a recursive scan?

 Cheers.


 Regards,

 Germán

 ---
 [1]
 http://geotux.tuxfamily.org/index.php?option=com_myblogtask=viewid=264Itemid=59lang=en

 2010/11/24 Giuseppe Sucameli sucam...@faunalia.it

  Hi Santiago,

 On Wed, Nov 24, 2010 at 6:01 PM, Santiago Lastra 
 santiago.las...@gmail.com wrote:

 Recently I've found this very interesting and useful tool, at least
 for me. I will propose two ways to improve the tool:
 - The tool right now offers the user the possibility to select as many
 files as he wants inside a directory. I propose to give also the 
 possibility
 to define only a directory that contains raster files (of every kind), 
 with
 a check box to give the oportunity to follow the subdirectories of the 
 first
 one.

 there's an opened ticket yet, see [1] ;)

  - I think it's better to explain my problem and I think you will
 understand the reason of my second proposal. I have directories with up 
 to
 2000 raster files or even more. If you try the tool as is and if you 
 select
 add to canvas, it takes several minutes to load and see the virtual 
 raster
 catalog (VRT) into QGIS, but if I zoom in to the right scale QGIS move 
 the
 images very quickly. What I suggest is to add in the dialog the 
 possibility
 to define the scale dependent visibility when the VRT is added to the 
 TOC
 of QGIS.

 Why don't you stop the rendering? So you can set the scale dependent
 visibility
 range using the existent layer properties dialog.

 Simply you can disable it either before you add the layer or while QGis
 loads it.
 Or maybe did I misunderstand?

 Cheers.

 [1] https://trac.osgeo.org/qgis/ticket/3095


 --
 Giuseppe Sucameli


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

 --
 ---
   |\__
 (:__)(
   |/

 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/

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




 --
 Giuseppe Sucameli




 --
 ---
   |\__
 (:__)(
   |/

 Soluciones Geoinformáticas Libres
 http://geotux.tuxfamily.org/

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




 --
 Giuseppe Sucameli




-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] QgsMapCanvas - Special zoom

2010-09-30 Thread Germán Carrillo
Hi,

not sure if it's the same, but the Aaron Racicot's MirrorMap plugin does
something similar. Have a look at it:

http://www.reprojected.com/geoblog/2009/02/17/mirrormap/

Regards,

Germán

On Thu, Sep 30, 2010 at 2:13 PM, GOO Creations goocreati...@gmail.comwrote:

  Hello,

  Is there any trick I can use to zoom into a canvas with a specific centre
 AND a specific scale.
  I have 2 map canvases, and I want to zoom into the same position and scale
 on both canvases at the same time: If i zoom into canvas1 at location (x,y)
 with factor 0.87, canvas2 should also zoom in with factor0.87 at position
 (x,y).

  What I currently do is:
  1. When the user zooms on one canvas (zoomLastStatusChanged signal), the
 signal is caught and the continues to step 2
  2. Zoomin - QgsMapCanvas provides 2 functions that can be used:
 zoomWithCenter and zoomScale

  The problem is that there is not a function that can zoom into a certain
 point WITH a certain scale.
  If zoomScale is used and one image is moved/paned individual, the zooming
 will have the same scale, but with different locations.
  Hence if I zoom into one point, both canvases should the same location
 (zoomed in with the same amount)

  If zoomWithCenter is used a fixed factor will be used to zoom in. Hence,
 if I zoom in on canvas1 with a factor different to 1, canvas2 will be zoomed
 into the correct location, but with a factor of 1 and not the factor of
 canvas1.

  Does anyone have a solution to this problem? And is it even possible?

  Thanks
  Christoph

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




-- 
---
  |\__
(:__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


  1   2   >