New answers tagged

0

It's not possible yet - the relevant methods and classes aren't exposed to the python API. This will be addressed when 3.0 is released.


2

Sorry for answering my own question. After browsing the API I found the solution is to cast the QgsPaintEffect to QgsEffectStack and edit the existing effects, maybe someone can benefit from this code: QgsPaintEffect* oldEffect=p_Symbol->symbolLayer(0)->paintEffect(); QgsEffectStack* stackEffect=(static_cast<QgsEffectStack*>(oldEffect)); ...


0

Following I found out: For deploying a cpp-plugin for QGIS it is requiered building the dll separately for every version - even point releases of a LTR. From this perspective it makes no difference if it is the actual or the ltr release. We have to take care that customers are using same version/point realease. For setting up development environement I don'...


0

Just tried QGIS 2.14.4 and DB Manager seems to keep in memory last field names selected for Column with unique values and Geometry column parameters! The solution is simple then: upgrade!


0

Actually, you just needed to check if your browser has WebGL support enabled or not. You can check your browser capability on http://get.webgl.org/ If the page say if your browser doesn't have it. You can install higher version of the browser that support it, or you can update your display driver. It works for me. Hope it's work for you.


0

Maybe you need update your version,to fix it.


1

In a plugin of mine I have a similair problem and I use the ogr library to delete shape files. You could try something like this: from osgeo import ogr driver = ogr.GetDriverByName('ESRI Shapefile') driver.DeleteDataSource('path_to_your_shape.shp') More informations about python and ogr you can find here: osgeo.ogr


0

Do you still have the processing plugin under C:\users\username.qgis2\python\plugins? If yes, delete it and try again. Processing is now a core feature, stored in the programs subfolder.


2

You can avoid having to edit the .ui file or compiling, etc by doing the following: import sys sys.path.append(os.path.dirname(__file__)) FORM_CLASS, _ = uic.loadUiType(os.path.join( os.path.dirname(__file__), 'test_dialog_base.ui'), resource_suffix='') resource_suffix defaults to '_rc' which is why it's always looking for 'resources_rc.' (you can ...


0

After a night without sleep, I fixed it myself: selectedLayerIndex = self.dlg.cbox_layer.currentIndex() selectedLayer = layers[selectedLayerIndex] # get unique values fni = selectedLayer.fieldNameIndex('firebrary') unique_values = selectedLayer.dataProvider().uniqueValues(fni) # define categories ...


0

So, it was a ssl certificate validation problem. The python used by QGIS didn't recognize the organism that had signed my API's ssl certificate. There were a possible work around here (telling urllib2 to ignore certificate validation) but it calls urllib2.HTTPSHandler() which has been implemented in a python version posterior to the one QGIS uses. The ...


0

I'm not 100% sure, but I think you may have to set the coordinate system of the canvas as well. There is a post here that indicates this: http://gis.stackexchange.com/a/151867 For example, the answer there shows code like the following: mycrs = QgsCoordinateReferenceSystem(32611) iface.mapCanvas().mapRenderer().setDestinationCrs(mycrs) I would suggest ...


1

If you do not have qgis installed, still you can do it online. Point2Poly You need to browse your csv file and select the latitude and longitude fields, then generate the shapefile.


0

The Digitizing Tools plugin has to amend line function https://github.com/bstroebl/DigitizingTools/wiki/Usage Prolong line applies to: line layer (multi or single part) Continue editing existing online features. Just click any end point of an existing line and digitize new vertices as if you would digitize the new feature.


0

Sample code snippet is given below uri = QgsDataSourceURI() uri.setConnection("xxx.xxx.xxx.xxx", "port", "dbname", "username", "password") uri.setDataSource("public","tablename","geom") uri.setWkbType(QGis.WKBPolygon) #geometry type has to be mentioned uri.setSrid('4326') vlay=QgsVectorLayer(uri.uri(),"test_poly","postgres") ...


2

In the next release (8 july 2016) this wil be fixed. Have a look at http://changelog.linfiniti.com/en/qgis/version/2.16.0/ There you can read: Feature: Extend linestring geometries with reshape tool The reshape tool now allows you to extend linestrings, by starting a reshape at either a line's start or end point. This feature was developed ...


1

Boundless Geo maintains a repository for plugins that they have created: https://qgis.boundlessgeo.com/ It has some useful tools that are not in the official repository.


0

You could use ArcGIS if you access to it. This is an example of what i did with ArcMap and excel(sorry for the language, old map). You can create the graph in excel and insert it as an object. The thing with this method is, that if you want to use a large pallet of colors and you want them synchronized with those one the map, you'll have to do it manually. A ...


2

The answer provided by @UjeIndo seems to be the correct one although I am also unsure how to exactly use the Creation Options. But if you have loaded your shapefiles into QGIS, you could loop through each one and save it as a .kml file specifying the datasourceOptions by using the following in the Python Console: result_path = "path/to/directory/" for layer ...


0

To answer your question: no, there is no other plugin needed. The "Oracle Spatial GeoRaster" plugin is all you need. But then again, there are so many things that can go wrong ... A lot can depend on where you got the GDAL build from and how the Georaster plugin was built. As a separate dynamic library ? In the GDAL core ? Then also you are using Windows ...


3

Yes, there is. its called "Convert format". Go to processing toolbox and run it from there by right click then run as batch processing. UPDATE : put as follow in creation option column: -dsco AltitudeMode=absolute -dsco NameField=Name -dsco DescriptionField=Description For example, in my case will be -dsco AltitudeMode=clampToGround -dsco ...


1

This is a another method is given below: for a in iface.attributesToolBar().actions(): if a.objectName() == 'mActionDeselectAll': a.trigger() break


1

If you still didn't fix your problem, then maybe this might help you: Try to check if all data stores you have are valid (so their sources are available). I had data stores added via Geoserver Web Interface to which I had manually deleted source shp files from the server hdd. So the Geoserver data stores were invalid and the source destinations were ...


3

The widgets which you are referring to are leftovers from Qt3. QGIS at the moment is based on Qt4 (which exists since 2005 and has seen end of life in December 2015) and is soon to be updated to Qt5 (2016/2017). Ten years ago, when it was about moving applications from Qt3 to Qt4, a Qt3Support module has been introduced to ease the migration. However, ...


2

I now found a solution to my problem, although it's not the most elegant one. I got access to the elements by calling the actions() method of the view menu: vm = iface.viewMenu() panels = [i for i in vm.actions() if i.title() == 'Panels'][0] toolbars = [i for i in vm.actions() if i.title() == 'Toolbars'][0] Unfortunately the plugin will be used in ...


1

When a canvas changes its extent a extentsChanged signal is emitted. When you connect this signal to a method (called slot), then you are able to run this method whenever the extent changes. To deploy this mechanism I altered your code in the following way. # Declare a global variable to hold the reference to QGIS canvas canv = None # here comes your ...


1

It's a core plugin, so, it's already installed. You just need to look for it using the translated name.... Your QGIS is in Spanish, use the spanish translation of "Shortest" to find it.


0

Not sure about connecting your plugin to the Python Console but you could just incorporate your script inside your plugin so that it can be executed from the interface. For example, if you have a push button with the objectName pushButton, you could add the following to your plugin_name.py file: def script(): # your_code self.dockwidget.pushButton....



Top 50 recent answers are included