[QGIS-Developer] Running QGIS 2.18 and QGIS 3 together?

2017-05-11 Thread Marco Grisolia
Hi,
I'm currently running QGIS 2.18.7 on a Win64bit machine, which I installed
using OsGeo4W Network Installer (32bit).
I recently installed the 2.99dev version and I encountered this error when
trying to start QGIS 3:

"Impossible to find the entry point [...] qwt.dll"

After a quick search, I found it in two different paths (as expected):

Path1: 'C:\OSGeo4W\bin\qwt.dll'

Path2: 'C:\OSGeo4W\apps\Qt5\bin\qwt.dll'

I know that this issue can be solved by renaming it in the proper location,
so I renamed the .dll file in the Path1 and, as expected, QGIS 3 WORKED
without any problem.

However, now the problem is reversed: I'm able to run QGIS 3, but I can't
run QGIS 2.18.7 anymore unless I rename again the .dll file in the Path1.
Is there a way for having both QGIS versions working without always
renaming the .dll file?

I want to remark that the "renaming procedure" allows running only one QGIS
version, while I wish to work with both of them (I'm quite sure I
didn't consider some simple workaround!).

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

Re: [QGIS-Developer] Custom python expression question

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

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

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

my_function(@layer_name, $currentfeature)

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

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

geom = curr_feat.geometry()

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

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

I hope that helps.
Best regards,
Marco





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

> Hi,
>
> If one creates a custom python expression, one gets a reference to the
> "feature" and the "parent".
>
> Question: what is "parent" referring to? What object type is it?
>
> Is it somehow possible in the Python script to get a reference to the
> layer the feature is part of? Would there be some example Python code
> around that shows how one can get access to the layer the feature belongs
> to?
>
> Thank you for any hints,
>
> Andreas
>
>
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] New feature proposal for the Dissolve tool

2017-02-28 Thread Marco Grisolia
Hi Arnaud,
thanks for your answer. This algorithm could be very useful and it should
add the neighborhood condition: I will wait for trying it, thanks!

Marco

2017-02-28 10:43 GMT+01:00 Arnaud Morvan <arnaud.mor...@camptocamp.com>:

> Hello Marco,
>
> Note that I'm currently working on a new Algorithm that supersede dissolve
> tool.
>
> Here is how it should look like :
>
> Name : "Aggregate"
>
> Parameters :
>
> * input vector layer
>
> * group_by expression (field name or complex expression, possible to
> add conditions on geometry predicates)
>
> * geometry aggregator : collect (multipart) or combine/union (single
> part)
>
> * Fields aggregators, for each field :
>
> aggregate function, input field, delimiter (for the concatenate
> aggregator)
>
> output filed definition (type, length, precision)
>
> with possibility to add/remove output fields, import the fields
> from an existing layer
>
> The UI should looks like the Refactor Fields algorithm.
>
> With this it should be possible to set a neighborhood condition in the
> group_by expression.
>
> Cheers
>
> Arnaud
>
> Le 22/02/2017 à 10:32, Marco Grisolia a écrit :
>
> Hi,
> I recently answered to a question on GIS StackExchange [0]. In this
> question, the asker was looking for a way for dissolving features using an
> adjacency criterion instead of using common attribute field (please, follow
> the link below for a better understanding). This feature is already
> available in the analogous ArcGIS tool when the"Create multipart features"
> option is enabled and I think it could be of interest having an additional
> option like this in the "Dissolve" tool main dialog for next releases.
> I never submitted a feature request on the QGIS Project site but, since
> there is already a (very rough) code and a general idea on how to approach
> the issue, I didn't know if this was the case of adding it there.
> Otherwise, let me know if I need to add it on the QGIS Project site (if
> this is the case, I'm sorry for wasting your time).
> Regards,
> Marco
>
>
> [0] http://gis.stackexchange.com/questions/228267/merging-
> adjacent-lines-in-qgis
>
>
> ___
> 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
>
___
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] New feature proposal for the Dissolve tool

2017-02-22 Thread Marco Grisolia
Hmm maybe I'm wrong, but I think it will only return singleparts without
taking care of an adjacency criterion (even if ran after the dissolving
operation).
Marco

2017-02-22 11:37 GMT+01:00 Anita Graser <anitagra...@gmx.at>:

> You can run multiplart to singlepart afterwards.
>
>
> On Wed, Feb 22, 2017 at 11:18 AM, roy roy <royr...@outlook.com> wrote:
>
>> Hi Anita, that does not do what Marco is asking for, because you get a
>> multipart geometry;
>>
>> he needs a linestring geometry I think...
>>
>> Il 22/02/2017 11:10, Anita Graser ha scritto:
>>
>> Hi Marco,
>>
>> The Dissolve tool already has a "unique fields" option. It sounds like
>> you are reinventing that.
>>
>> Best wishes,
>> Anita
>>
>>
>>
>> On Wed, Feb 22, 2017 at 10:32 AM, Marco Grisolia <
>> marco.grisol...@gmail.com> wrote:
>>
>>> Hi,
>>> I recently answered to a question on GIS StackExchange [0]. In this
>>> question, the asker was looking for a way for dissolving features using an
>>> adjacency criterion instead of using common attribute field (please, follow
>>> the link below for a better understanding). This feature is already
>>> available in the analogous ArcGIS tool when the"Create multipart features"
>>> option is enabled and I think it could be of interest having an additional
>>> option like this in the "Dissolve" tool main dialog for next releases.
>>> I never submitted a feature request on the QGIS Project site but, since
>>> there is already a (very rough) code and a general idea on how to approach
>>> the issue, I didn't know if this was the case of adding it there.
>>> Otherwise, let me know if I need to add it on the QGIS Project site (if
>>> this is the case, I'm sorry for wasting your time).
>>> Regards,
>>> Marco
>>>
>>>
>>> [0] http://gis.stackexchange.com/questions/228267/merging-ad
>>> jacent-lines-in-qgis
>>>
>>> ___
>>> 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 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
>>
>
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] New feature proposal for the Dissolve tool

2017-02-22 Thread Marco Grisolia
Thanks to all for the answers! I really appreciate.

@Daan, actually it should work for all the features for a specific field (I
set it inside the code, but it may easily become an input parameter). So,
after the setting of a specific field, the code will dissolve all the
features which have the same attribute and that are adjacent (see the
sample image in the answer).

@Anita, I think would be a new feature because, starting from the features
with the same attribute value, I try to only dissolve those ones which are
adjacent (so, it should be an additional feature to the "Unique ID fields"
option).

@roy roy, I never used that tool but it does the same thing I'm trying to
do for linestring geometries. It could be interesting having a similar
feature (for both polygon and linestring vector) in the QGIS geoalgorithms!

Regards,
Marco

2017-02-22 11:18 GMT+01:00 roy roy <royr...@outlook.com>:

> Hi Anita, that does not do what Marco is asking for, because you get a
> multipart geometry;
>
> he needs a linestring geometry I think...
>
> Il 22/02/2017 11:10, Anita Graser ha scritto:
>
> Hi Marco,
>
> The Dissolve tool already has a "unique fields" option. It sounds like you
> are reinventing that.
>
> Best wishes,
> Anita
>
>
>
> On Wed, Feb 22, 2017 at 10:32 AM, Marco Grisolia <
> marco.grisol...@gmail.com> wrote:
>
>> Hi,
>> I recently answered to a question on GIS StackExchange [0]. In this
>> question, the asker was looking for a way for dissolving features using an
>> adjacency criterion instead of using common attribute field (please, follow
>> the link below for a better understanding). This feature is already
>> available in the analogous ArcGIS tool when the"Create multipart features"
>> option is enabled and I think it could be of interest having an additional
>> option like this in the "Dissolve" tool main dialog for next releases.
>> I never submitted a feature request on the QGIS Project site but, since
>> there is already a (very rough) code and a general idea on how to approach
>> the issue, I didn't know if this was the case of adding it there.
>> Otherwise, let me know if I need to add it on the QGIS Project site (if
>> this is the case, I'm sorry for wasting your time).
>> Regards,
>> Marco
>>
>>
>> [0] http://gis.stackexchange.com/questions/228267/merging-ad
>> jacent-lines-in-qgis
>>
>> ___
>> 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 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
>
___
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] New feature proposal for the Dissolve tool

2017-02-22 Thread Marco Grisolia
Hi,
I recently answered to a question on GIS StackExchange [0]. In this
question, the asker was looking for a way for dissolving features using an
adjacency criterion instead of using common attribute field (please, follow
the link below for a better understanding). This feature is already
available in the analogous ArcGIS tool when the"Create multipart features"
option is enabled and I think it could be of interest having an additional
option like this in the "Dissolve" tool main dialog for next releases.
I never submitted a feature request on the QGIS Project site but, since
there is already a (very rough) code and a general idea on how to approach
the issue, I didn't know if this was the case of adding it there.
Otherwise, let me know if I need to add it on the QGIS Project site (if
this is the case, I'm sorry for wasting your time).
Regards,
Marco


[0]
http://gis.stackexchange.com/questions/228267/merging-adjacent-lines-in-qgis
___
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