[Qgis-developer] SVG as attribute?
Hi, is it possible to store an plain svg in the attribute table for styling or is it just possible to save the path to the svg? Greetings ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Problem with rendering when units are millimeters
Hi, I tried to do a simple rendering of a few layers. Raster, Polygon and Linelayers always work like expected, just the points will not get rendered.I found an older simlar thread: http://osgeo-org.1560.x6.nabble.com/Problem-with-rendering-iwhen-units-are-millimeters-td5023073.html. If I change layers style units to map unit its working, but not with millimeter. Do I missed something? from PyQt4.QtCore import * from PyQt4.QtGui import * canvas = qgis.utils.iface.mapCanvas() render = QgsMapRenderer() crsDestination = QgsCoordinateReferenceSystem() crsDestination.createFromString(EPSG:4326) render.setDestinationCrs(crsDestination) render.setMapUnits(crsDestination.mapUnits()) render.setProjectionsEnabled(True) extent = canvas.extent() layers = [] for l in canvas.layers(): layers.append(l.id()) img = QImage(QSize(800, 600), QImage.Format_ARGB32_Premultiplied) color = QColor(255, 255, 255) img.fill(color.rgb()) p = QPainter() p.begin(img) #render = QgsMapRenderer() render.setLayerSet(layers) render.setExtent(extent) render.setOutputSize(img.size(), img.logicalDpiX()) render.render(p) p.end() img.save(/tmp/render_issue.png,png) ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Software development usig QGis API and Qt
Iam have no experiences with writin C++ apps but on the python side you have to set the prefix paths and init qgis at app start. Otherwise youll get strange errors, like yours. QgsApplication.prefixPath() -- get your path from a working QGIS python console QgsApplication.setPrefixPath(path, True) QgsApplication.initQgis() Hope this helps. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] QGIS with up to date package versions
Hi, has someone a ready to use version of QGIS (Windows) with more up to date packages? Or a windows specific description on how to build one? The used versions are very old. For the moment I try to use this description, but compiling on Windows isyesfar from being comfortable...http://www.webalice.it/marco.pasetti/qgis+grass/BuildFromSource.html ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Creating fully isolated python environment (virtualenv) on Linux
Hi,Iam writing a python standalone application, which should later run on windows (not my choice...). All the development is done on Ubuntu 12.04. I managed to run the application with a standard QGIS 2.2 Windows installer package. The problem is, that it starts but crashes unexpectedly without any python error messages. And the error doent appear on every start. Windows just says that python crashed...not very helpful. I think the problem is related to different software versions, especially Qt, PyQt, SIP, GDAL and maybe something else. This are the Linux versions running: QGIS-Version 2.2.0-Valmiera QGIS-Codeversionexported Kompiliert gegen Qt 4.8.1 Laufendes Qt 4.8.1 Kompiliert mit GDAL/OGR 1.10.0 Luft mit GDAL/OGR 1.11dev Kompiliert mit GEOS 3.3.8-CAPI-1.7.8 Luft mit GEOS 3.4.2-CAPI-1.8.2 r3921 PostgreSQL-Client-Version9.1.11 SpatiaLite-Version 4.1.1 QWT-Version 5.2.2 PROJ.4-Version 480 QScintilla2-Version SIP 4.13.2 PyQt 4.9.1 On Windows I got the following versions: QGIS-Version 2.2.0-Valmiera QGIS-Codeversionc3a2817 Kompiliert gegen Qt 4.7.1 Laufendes Qt 4.7.1 Kompiliert mit GDAL/OGR 1.10.1 Luft mit GDAL/OGR 1.10.1 Kompiliert mit GEOS 3.4.2-CAPI-1.8.2 Luft mit GEOS 3.4.2-CAPI-1.8.2 r3921 PostgreSQL-Client-Version8.3.10 SpatiaLite-Version 4.1.1 QWT-Version 5.2.1 PROJ.4-Version 480 QScintilla2-Version 2.6.2 SIP 4.12.1 PyQt 4.8.3 Cause I dont like to bother with compiling the complete Windows stack from souce, I tryed to do this on Linux. I tried to create a virtualenv with all the packages I need. The python packages are no problem, but the c packages are (GDAL, QGIS, etc.) are. Has someone tips, a more or less detailed description, a working virtualenv, or a zc.buildout script to ease this work? Maybe a windows installation with more up to date packages will be helpful. Matthias ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] QGIS standalone app - layer tree, legend and co.
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. Regards ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Access count and center point from QgsPointDisplacementRenderer
Hi Martin, I hope you will find some time to do the improvements. :) My wishlist would be: - set the tolerance fixed or in relation to the scale so it can update while zooming - ability to calculate sum(), min(), max(), avg() of numerical values of group members, at least the count of points in each group - using the same renderer (single symbol, categorized, graduated, rule based) for the cluster point Gesendet:Dienstag, 24. Juni 2014 um 19:00 Uhr Von:Martin Dobias wonder...@gmail.com An:Matthias Ludwig kaot...@gmx.de Cc:qgis-dev qgis-developer@lists.osgeo.org Betreff:Re: [Qgis-developer] Access count and center point from QgsPointDisplacementRenderer Hi Matthias On Tue, Jun 24, 2014 at 10:07 PM, Matthias Ludwig kaot...@gmx.de wrote: Hi, for a project (python standalone) I try to display points in clusters (like the Leaflet-marker-Cluster http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html, or Openlayers, etc. just a simple distance based solution). As far as I understand the PointDisplacementRenderer more or less it does the same: group all points in a radius into a cluster and show the center point. If the tolerance is set depending on the scale the center points are displayed properly. I looked into the docs and the source code and didnt found a way to access the list of displacementGroups (to get the count and the center point) or just the count of points in each group. After that I tried to modify the source code of the renderer. I made the mDisplacementGroups publicly accessable (or i tried to do so) and moved the: typedef QMapQgsFeatureId, QgsFeature DisplacementGroup; /**Groups of features that have the same position*/ QListDisplacementGroup mDisplacementGroups; /**Mapping from feature ID to its group index*/ above the private section but it didnt worked. Is this completly wrong or do I have to change something else to get access with the python bindings? Is there any way to get the center point of each group and the count from the current implementation? Those members variables are just temporary and not meant to be used publicly. I dont think there is a way to retrieve these groupings. I didnt found something in the mailing list or somewhere else: is someone working on a visual clustering solution? If the time will allow, I would like to do few improvements to the point displacement renderer. It would probably make sense to actually take the clustering out of the renderer and have a class just for the clustering algorithm that will return the groups. Regards Martin ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Access count and center point from QgsPointDisplacementRenderer
- using the same renderer (single symbol, categorized, graduated, rule based) for the cluster point Not sure what this means... At the moment you cant use different symbols as center symbol. I like to see this changed and the ability to use categorized or graduated renderer (based on the count, sum/min/max/avg of one group attribute, etc.). Example (i added a screenshot for this): - sample points with nitrat, pH-Value and moisture concentration - show the count of measurements in each cluster vizualized in 3 classes (graduated) (dark green green light green) - show the avg concentration of each value per goup with graduated symbols (the layer could be imported three times and each new information is shifted from the center) I hope its clear now. Regards___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Access count and center point from QgsPointDisplacementRenderer
Hi, for a project (python standalone) I try to display points in clusters (like the Leaflet-marker-Clusterhttp://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html, or Openlayers, etc. just a simple distance based solution). As far as I understand the PointDisplacementRenderer more or lessit does the same: group all points in a radius into a cluster and show the center point. If the tolerance is set depending on the scale the center points are displayed properly. I looked into the docs and the source code and didnt found a way to access the list of displacementGroups (to get the count and the center point) or just the count of points in each group. After thatI tried to modify the source code of the renderer. I made themDisplacementGroups publicly accessable (or i tried to do so)and moved the: typedef QMapQgsFeatureId, QgsFeature DisplacementGroup; /**Groups of features that have the same position*/ QListDisplacementGroup mDisplacementGroups; /**Mapping from feature ID to its group index*/ above the private section but it didnt worked. Is this completly wrong or do I have to change something else to get access with the python bindings? Is there any way to get the center point of each group and the count from the current implementation? I didnt found something in the mailing list or somewhere else: is someone working on a visual clustering solution? Greetings ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Tile Map Scale Levels Plugin - syntax error installing with plugin manager
I created and uploaded the Tile Map Scale Levels Plugin (http://plugins.qgis.org/plugins/TileMapScaleLevels-master/) During the installation the plugin manager just shows the error message: The plugin is broken: Python said: invalid syntax. But: the plugin is working as intended. Any idea, where to look for the error? ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] QGIS, Python and Threads
Hello, I try to write a plugin in python. The plugin will be part of a complex plugin and will make a longer running numpy calculation. I want the GUI to be responsive during the calculation. As a basis I used Aaron Racicots(http://svn.reprojected.com/qgisplugins/trunk/threading_demo/) threading example and modified the run code (the calculation is only an example). Unfortunately it does not what I want it to do...it hangs during calculation. Did I missed a thing? import numpy class TestThread(QThread): def __init__(self, parentThread,parentObject): QThread.__init__(self, parentThread) self.parent = parentObject self.running = False self.total = 0 self.currentCount = 0 def __del__(self): self.running = False self.wait() def run(self): self.running = True A = numpy.random.random((2000,2000)) b = numpy.random.random((2000,1)) x = numpy.linalg.solve(A, b) print x.trace() self.emit(SIGNAL(runFinished(PyQt_PyObject)),Pass) self.stop() def stop(self): self.running = False def getUpdate(self): return self.currentCount ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer