Hi list
When loading a vector layer via Python, is there a way to get a hold of the
error message for when the loading fails?
I can check if the layer is valid or not, but I'd like to get a description
of the error. I see the error on the QGIS log panel, so I'm hoping it is
possible to access it
But now I see that it is there and I was the one looking at the wrong
place.
Cheers
Denis Rouzaud escreveu no dia quarta, 2/06/2021
à(s) 09:09:
>
>
> Le mar. 1 juin 2021 à 16:43, Ricardo Filipe Soares Garcia da <
> ricardo.garcia.si...@gmail.com> a écrit :
>
>> Hi all
&g
Hi all
I see that settings management in QGIS seems to be changing for the
upcoming 3.20 release. I got this clue when consulting the online API docs
for master and then realizing there is no QgsSettings class in there
anymore.
I then searched the commit history on github and found some commits da
e
>
> On mobile, please excuse my brevity.
>
> On Tue, Feb 19, 2019, 12:50 Ricardo Filipe Soares Garcia da <
> ricardo.garcia.si...@gmail.com wrote:
>
>> Hi all
>> I'm using the flatpak version of QGIS and I'd like to install some
>> additional pytho
Hi all
I'm using the flatpak version of QGIS and I'd like to install some
additional python packages. Is this possible?
My current use case is I'd like to install the Time Manager plugin. This
requires the `future` package, which I do not have installed. So I want to
install it.
The flatpak is us
Hi Richard
You can add widgets to a specific layer if you know the widget provider's
id. It is simply a matter of setting up the relevant custom properties.
Take a look at the code in the PR you linked, more specifically here:
https://github.com/qgis/QGIS/pull/3170/files#diff-0c8d41d794f1b84a129
Hi all
I have a working python code snippet that enables updating a WMS layer with
a different named style.
It basically manipulates the raster provider's `dataSourceUri` property,
replacing the `style=` with a different substring. and then it calls for a
reload of the data and triggers a repaint
is the class you have to inherit.
> You need to implement title, icon and createWidget. In the latter, you'll
> be able to load your UI and return the widget to be displayed. The widget
> you return must inherit QgsOptionsPageWidget.
>
> I hope this helps!
>
&
Hi all
The API docs for QgisInterface[1] mention the existence of a
`registerMapLayerConfigWidgetFactory()` method which says in its
documentation:
> Register a new tab in the vector layer properties dialog.
I've been trying to test this out and see if I can add a new panel to a
layer's properti
Ricardo
>
> Sorry for the delayed answer...
>
> On Mon, Sep 17, 2018 at 12:10 AM Ricardo Filipe Soares Garcia da
> wrote:
> >
> > This code kind of works, but I'm facing two problems at the moment:
> >
> > 1. The `MyWidgetProvider.supportsLayer()` meth
Hi all (specially Martin Dobias)
I'm working on a plugin that will use embedded widgets in the layer tree. I
am using the following as reference:
- Martin's PR that brought this feature into existence (thanks for that
BTW):
https://github.com/qgis/QGIS/pull/3170/files#diff-3b9be845f2ea37602ca451
Hi Peter
In addition to Matthias' advice perhaps try using QNetworkAccessManager[1]
and related classes in order to deal with your http requests
asynchronously. This should fix the UI blocking issues.
Best regards
[1] -
http://pyqt.sourceforge.net/Docs/PyQt4/qnetworkaccessmanager.html#details
e world to use.
>
> Just my two cents.
>
> Denis
>
>
Cheers
>
>
>
>
> Le mar. 3 oct. 2017 à 16:09, Ricardo Filipe Soares Garcia da <
> ricardo.garcia.si...@gmail.com> a écrit :
>
>> Hi all
>>
>> Answering my own question for
lowing
seems to work on QGIS 2.18:
```
provider_registry = qgis.core.QgsProviderRegistry.instance()
add_wms_dialog = provider_registry.selectWidget("wms")
action.triggered.disconnect()
action.triggered.connect(add_wms_dialog.show)
```
Best regards
On Mon, Oct 2, 2017 at 12:41 PM, R
Hi all
Is it possible to replace one of QGIS' dialogues with a custom one during
runtime by using Python?
My concrete goal is to replace the dialogue that shows when clicking the
'Add WMS/WMTS Layer' with something custom. I'd like to enhance the native
QGIS dialogue with additional elements for
It's looking great :)
Having processing algs run in the background will really improve the user
experience IMO.
Having the possibility to use expressions in order to define parameters
dynamically is really awesome too! In your video demo you effectively
turned the fixed distance buffer algorithm
I generally avoid wildcard imports. Two additional reasons not to use them:
- When you use the wildcard form it is harder for other people (and for
yourself in the future) to know just what it is that you are actually
importing. As such, debugging eventual errors takes more time.
- wildcard impor
My two cents:
Personally I see this whole sandbox thing as being more suitable for the
application as a whole and not specifically for the python plugins part. As
such, it seems to me that sandboxing would be a job better suited for the
OS that is running apps, and not for the apps themselves. Thi
+1 it is a great idea. I've been teaching a few training courses on Python
and QGIS for prospecting plugin writers and I'm always reccommending
creating new plugins via processing rather than standalone (after going
through what is possible and what is not).
The main issue here, in my opinion, is
Hi list
hub.qgis.org seems to be broken for people who want to use it as a
repository for plugin's source code.
I'm having problems with it since almost a year:
http://osgeo-org.1560.x6.nabble.com/using-hub-qgis-org-git-repository-td5057063.html
and there are also several tickets related to it:
Hi list
I don't know it this is related to the recent processing upgrade, but I
cannot get plugins that add themselves as processing providers to get their
geoalgorithms loaded by default when I start QGIS.
This is hapenning with a custom plugin that I am writing, but I have
noticed it happening
l for other people to study them and run them. I think this is
> the best way of distributing them. If the number of example models is
> high I might even classify them differently.
>
> Thanks!
>
> Victor
>
>
> 2013/9/15 Ricardo Filipe Soares Garcia da >:
> > So
Sorry for the noise, but this message's title should say 'how to distribute
Processing models' instead of modules...
On Sun, Sep 15, 2013 at 2:39 AM, Ricardo Filipe Soares Garcia da <
ricardo.garcia.si...@gmail.com> wrote:
> Hi list
>
> I am building a plugin f
Hi list
I am building a plugin for Processing (former Sextante). Besides the
GeoAlgorithms, I'd like to include some ready-made models along with the
plugin.
Is this feasible? How to do it?
I am currently using a 'models' subdir under my plugin's code with the
models.
It seems I should be able
Hi list
What is the recommended way to show a help dialog in a plugin?
The pyqgis cookbook[1] advises using the qgis.utils.showPluginHelp()
function. However, this function calls iface.openURL(), which logs a
DeprecationWarning, so I guess it should not be used anymore.
Is there another recommen
> For f in layer.getFeatures:
>
> No it just comes down to
>
> If selected:
> features = layers.selectedFeatures()[]
> Else:
> features = layer.getFeatures()
> From: Ricardo Filipe Soares Garcia da
> Sent: 17/06/2013 11:47 PM
> To: qgis-developer@lists.osgeo.org
&
> I've got that functionality ready in a separate branch but it will have
> to wait for 2.1 due to the feature freeze as you mentioned
>
>
Great! Will be looking forward to it then :)
--
___ ___ __
Ricardo Garcia Silva
___
Qgis-
Hi list
When building plugins that operate on vector layers, it is a common pattern
to include a checkbox in the plugin's GUI where the user can choose to
perform the plugin analysis on the whole layer or just using the currently
selected features (see for example most fTools dialogs).
However, I
Nevermind... I just add to click to enable the plugin and it showed me the
error just as the old plugin manager. Sorry for the noise.
On Tue, Jun 11, 2013 at 11:10 PM, Ricardo Filipe Soares Garcia da <
ricardo.garcia.si...@gmail.com> wrote:
> Hello list
>
> When dealing with plug
Hello list
When dealing with plugins with broken code, as is my current case, while
updating to the new SIP API, the new plugin manager (which is super nice,
by the way) will only show a portion of the error.
In my case I get an 'invalid syntax' message, which does not include the
line number any
ion denied.
What could be the problem?
On Thu, May 30, 2013 at 11:50 PM, Alex Mandel wrote:
> On 05/30/2013 03:42 PM, Ricardo Filipe Soares Garcia da wrote:
>
>> Hi list
>>
>> I created a new plugin in hub.qgis.org and I'd like to use a git
>> repository. I
Hi list
I created a new plugin in hub.qgis.org and I'd like to use a git
repository. I've done this in the past and had no problems but now I am
having dificulties pushing the initial commit to gitosis.qgis.org
In redmine I created the repository and added my SSH key. Then I
initialized my git re
Hi list
How could I extract the current project's CRS from python?
I've tried looking for it in QSettings but came up short. Mybe somewhere in
QgsProject? I can't figure out how to use the readListEntry() method though.
Thanks
--
___ ___ __
Ricardo Garcia Silva
Thanks Martin
It's working fine now!
On Tue, May 22, 2012 at 8:35 PM, Martin Dobias wrote:
> On Mon, May 21, 2012 at 1:26 AM, Ricardo Filipe Soares Garcia da
> wrote:
>> Hi list
>>
>> I am writing a plugin that creates new features. According to the
>> pyq
Hi list
I am writing a plugin that creates new features. According to the
pyqgis cookbook[0], and the API docs[1], when I call the addFeatures
method on a QgsVectorLayer, the features should get added to the
layers editing buffer. It is my understanding that this action ought
to be undo-able, sinc
Hi list
I'm trying to translate and rotate a geometry using python, in order
to create parallel lines.
For the translation I could use QgsGeometry's translate() method, but
for the rotation I haven't found a ready-made solution. So my current
strategy is to individually rotate each vertex, accord
Thanks
I got it working now!
I now have a different doubt, regarding geometry vertex iteration
(sending another e-mail with it).
On Sun, May 13, 2012 at 9:24 AM, Martin Dobias wrote:
> Hi Ricardo
>
> On Sun, May 13, 2012 at 1:39 AM, Ricardo Filipe Soares Garcia da
Hi list
I'm trying to code some tools for working with lines layers using
python. One such tool is meant to create parallel lines.
I am trying to create my new line geometry by first copying the
geometry of a previously selected linestring and then translating it
according to a specified distance.
Hi Paolo
> One more:
>
>
> Traceback (most recent call last):
> File "C:\Documents and Settings\eleauser/.
> qgis/python/plugins\profiletool\doProfile.py", line 244, in selectLayer1
> self.readData(0)
>
> File "C:\Documents and Settings\eleauser/.
> qgis/python/plugins\profiletool\doProfile.p
Hi Paolo
Thanks for your reports, I am the author of this plugin. I'll be
looking into the mentioned issues in a short while.
I am using hub.qgis.org for this plugin, so feel free to open new
tickets there in the future. For these issues I will do it myself.
>> - it is important (and does not lo
FYI, just opened ticket #4941 describing this issue.
--
___ ___ __
Ricardo Garcia Silva
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Hi all
I'm getting the same error trying to compile latest trunk on Ubuntu
11.10 (Oneiric) 32 bit. Is there some way to solve this without
messing around with sip source? Borys, did you solve it?
--
___ ___ __
Ricardo Garcia Silva
___
Hi list
Sorry for the noise, but I just want to bring some attention to bug #4302.
Being able to visualize data using the GEOS projection would be a big
plus for people working with meteorological satellites, like me ;)
I guess I am hitting two separate issues, one of them seems to be
related to
Hello list
in order to identify pixel values I'm using QgsRasterLayer.identify()
This method returns a tuple, with first value being a boolean (by the
way, see ticket[1] on trac). The second value is a dictionary with
band names as keys and pixel value.
I want to check for the pixel value and, i
Hi list
Sorry for the newbish question:
I remember reading somewhere online about the QGIS_PLUGINPATH
environment variable and thinking it was a cool idea. I set it up to
point to my local development folder.
Now I want to disable it to test some improvements on a plugin, but I
don't remember wher
Hi Guiseppe
I think it is great that you're willing to develop the Database manager idea :)
Me and Luiz Motta have been collaborating on the customDBQuery plugin,
which also allows for loading of spatial queries on the map canvas. It
takes a more minimalist approach than the other plugins, requir
Hi Chris
In the 'Profile from lines' plugin I'm using a similar approach:
# python code
projectionSettingKey = "Projections/defaultBehaviour"
oldProjectionSetting = self.qgisSettings.value(projectionSettingKey)
self.qgisSettings.setValue(projectionSettingKey, "useGlobal")
self.qgisSettings.sync()
Hi list
I have been working with Luiz Motta in the 'Custom db query' plugin
and we came about the dilemma of how to best format our Python code.
Looking around the QGIS wiki, we found the developers manual [1] and
read through the coding guidelines, but the rules defined in it are
for C++ program
Hi Noli
I can run your query in both plugins without any problem.
Maybe the real problem lies elsewhere.
I have been using using ubuntu almost exclusively lately, with
packages from the ubuntugis repository. So I really haven't had a
chance to test these things out on diferent OS/software version
PRAGMA TABLE_INFO(table_name) to view table before you start
> using the plugin. The probably a link to this Spatialite Tutorials
> (i.e. http://www.gaia-gis.it/spatialite/spatialite-tutorial-2.3.1.html#t1
> ).
>
> Thanks.
>
> Noli
>
>
> On 12/17/10, Ricardo Filipe Soar
hema, type
'public' (without the quotes)
- write a valid SQL query (maybe it is best to first test the query
without visualizing to the map canvas to make sure it works)
Best regards
On Thu, Dec 16, 2010 at 1:16 PM, Ricardo Filipe Soares Garcia da
wrote:
> Hi Noli, Guiseppe, all
>
Hi Noli, Guiseppe, all
I downloaded the spatialite sample database and ran your query.
I could run it fine without the errors you mention. The problem here
seems to be that I still need to write some documentation on how to
use the plugin so that you (the user) can know how to operate it
correctly
Hi Noli
I can't seem to reproduce any of your errors with my sample data.
Can you give me some more information? What queries are you trying?
Is it possible for you to send me some testing data?
On Thu, Dec 16, 2010 at 1:47 AM, Noli Sicad wrote:
> Hi Ricardo,
> .
> I got another error in 0.4, th
Hi all
To celebrate the fixing of this bug by brushtyler (Guiseppe maybe?), I
have updated 'custom db query' to version 0.4.
The plugin's window is now modeless, and it stays on top of the QGIS
main window. So you can interact with the rest of QGIS while having
the plugin open. This way you can, fo
Hi Guiseppe, Luiz
I have to do some more checking to be sure, but I think this problem
is happening with both plugins. I haven't got a postgis database at
hand right now, but with my home testing set I was getting the same
error (something about cursor states lost) with both 'custom db query'
and
Hi all
> But after upgrading to v. 3.0 I get following traceback when trying to
> load every query in PostGIS (for example: SELECT * from schema.table).
I uploaded v 0.3.1 that (hopefully) fixes the bug you are refering.
I will think about adding Noli's feature requests, which seem
reasonable en
Hi Paolo, all
Uploaded a new version (v0.3) of the 'Custom DB query' plugin.
I've added it to the 'database' menu. Also, it is now possible to save
the result of the SQL query as a new table in its corresponding
database.
So, to summarize, you can run SQL queries over postgis or spatialite
datab
still unfinished.
A small gotcha: if you decide to test it with postgis layers, don't
forget to include the schema name when you reference a table.
Please let me have some feedback, if you have the time to test it out. Thanks
On Thu, Dec 9, 2010 at 10:40 AM, Ricardo Filipe Soares Garcia da
wrot
Sorry, forgot to add this:
I will add a small help page explaining the functionality later.
Probably tomorrow.
Cheers
On Thu, Dec 9, 2010 at 10:38 AM, Ricardo Filipe Soares Garcia da
wrote:
> Hello
>
> I have uploaded my plugin to the contributed repository. I marked it
> as expe
Hello
I have uploaded my plugin to the contributed repository. I marked it
as experimental. It is called 'Custom DB query'. I did a bit of
cleaning up and even managed to get the 'normal query' feature to
work.
So, by now you can:
- run an SQL query and choose to view the result in the map canva
Hi all
In fact, I have a plugin that allows to load custom spatialite queries
to the map canvas. I started it as a pet project, to see if I could
improve my Qt skills ;)
Currently it is really crude. I can make it available at the
experimental repository if you are interested.
My initial goal was
you please reproduce this procedure and verify that it is not
working? Thank you
On Fri, Dec 3, 2010 at 3:57 AM, Gary Sherman wrote:
> On 12/2/10 5:31 AM, Ricardo Filipe Soares Garcia da wrote:
>>
>> Hi list
>>
>> There is a bug in the generation of the Makefile in th
Hi list
There is a bug in the generation of the Makefile in the online pyqgis
plugin builder [1].
I'm no expert on Makefile generation, but I think the only issue is an
evil tabspace, right after the 'compile' rule.
Didn't know where to report this, hopefully here is the right place.
[1] - http:
Hi
I think it would be great if this new 'database' section could be made
to work with spatialite as well as with postgis. Maybe the creation of
a general manager for spatial databases that could integrate the
'Postgis manager', 'Spatialite manager', 'RT SQL layer' and the rest
of the functionality
; "layerWillBeRemoved(QString)" ), f )
> ---
> I'm not sure it works if the user starts a new project...
> Regards,
> Germán
>
> On Sat, Sep 4, 2010 at 7:53 AM, Ricardo Filipe Soares Garcia da
> wrote:
>>
>> Hi list
>>
>> I&
Hi list
I'm trying to toggle my plugin's availability based on the presence or
absence of loaded vector layers of type 'line'.
For this purpose I have a _get_loaded_layers() and a
toggle_availability() methods (code follows in the end of this
message).
After searching the online API docs, it seem
Thanks Jurgen, it is working now!
On Tue, Aug 17, 2010 at 12:37 PM, Jürgen E. wrote:
> Hi Ricardo,
>
> On Tue, 17. Aug 2010 at 12:32:06 +0100, Ricardo Filipe Soares Garcia da wrote:
>> > def initGui(self):
>> > some other code
>> > QObject.connect(self.
I am sorry, I accidentally pressed some key combination that caused
gmail to send the previous message before it was finished...
Please follow the rest of the code in the attached version of the
previous e-mail.
On Tue, Aug 17, 2010 at 12:29 PM, Ricardo Filipe Soares Garcia da
wrote:
> He
Hello list
I am trying to call the layerWasAdded and layerWillBeRemoved signals
that are emmited by the mapLayerRegistry.instance() object, but I'm
getting no luck.
I am hoping to toggle my plugin on and off based on the user having
any vector layer of type 'line' loaded on the map canvas.
I've rea
Hi list
How could I go about defining a custom Map Canvas Item in Python?
In addition to the current QgsRubberBand and QgsVertexMarker I'd like
to have a new Map Canvas Item that could write text on the map canvas.
I am thinking about creating a plugin to display a raster's value
directly on the
gt; Do you have some insight on this error? Thanks for you help
>
> On Tue, Aug 10, 2010 at 9:55 PM, Martin Dobias wrote:
>> Hi Ricardo
>>
>> On Mon, Aug 9, 2010 at 2:50 PM, Ricardo Filipe Soares Garcia da
>> wrote:
>>> Hello list
>>>
>>> How
'channelValue' variable
values = {feat.id() : {newFieldIndex: QVariant(channel)}}
provider.ChangeAttributeValues(values)
Do you have some insight on this error? Thanks for you help
On Tue, Aug 10, 2010 at 9:55 PM, Martin Dobias wrote:
> Hi Ricardo
>
> On Mon, Aug 9, 201
Hello list
How can I add a new field to an existing layer and insert some new
values in it? In the following example, pointLayer refers to an
existing layer, previously created using the memory provider. This
code is creating the new field, but I cannot insert the values in it.
Although it runs wi
releasing it sometime during the week (it'll be called
'Profile from line')
Thank you Martin and Václav for your speedy and most helpful assistance.
2010/8/9 Václav Řehák :
> 2010/8/9 Ricardo Filipe Soares Garcia da :
>> Hi Martin
>>
>> could you please elabora
oding in
Python.
Thank you
On Sat, Aug 7, 2010 at 4:23 PM, Martin Dobias wrote:
> On Sat, Aug 7, 2010 at 12:00 AM, Ricardo Filipe Soares Garcia da
> wrote:
>> Hi list
>> I'm trying to create a plugin that creates a new layer using the
>> memory provider. I'd like
Hi list
I'm trying to create a plugin that creates a new layer using the
memory provider. I'd like this new layer to have the same crs as
another layer ('linesLayer' in my code below). All is going well,
except that when I add the new layer to the mapLayerRegistry I always
get prompted for selectin
Hi again
My problem has been solved, although I admit I don't know why. I just
had to restart Qgis, and now I can see the output of my print commands
in the shell again. Sorry for the noise
On Thu, Aug 5, 2010 at 4:25 PM, Ricardo Filipe Soares Garcia da
wrote:
> Hi list
> A quick (an
Hi list
A quick (and hopefully not too embarassing ;) ) question:
-How can I print some variables to the shell when creating a python plugin?
For example, I have a piece of code that goes:
# python code
parameters = dlg.return_parameters()
print("parameters: %s" % parameters)
# end of code
I was
78 matches
Mail list logo