[Qgis-developer] QGIS API tutorial
hello all i'm beginner in QGIS Developing API's. where i can found any tutorial about using QGIS gui and core API's? thanks all -- ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] QGIS API tutorial
On 22-03-14 08:22, mohammad mohsen Amiri wrote: > hello all > i'm beginner in QGIS Developing API's. > where i can found any tutorial about using QGIS gui and core API's? http://www.qgis.org/en/docs/ cpp http://qgis.org/api/testing/ http://qgis.org/api/2.2/ plugin/iface http://qgis.org/api/2.2/classQgisInterface.html ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] QGIS API tutorial
I would recommend having a look at the pyqgis cookbook [1] there are some nice hands-on examples that should get you started. -- Matthias [1] http://www.qgis.org/en/docs/pyqgis_developer_cookbook/ ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Possible bug when turning edit mode off and on "too often"
Hi Matthias, Thanks for the pointer - spot on - I am using many of the plugins mentioned.. I did look through the buglist before posting, but didn't notice that one. Thanks again, and keep well, Zoltan On 2014/03/21 18:51, Matthias Kuhn wrote: Hi Zoltan, Please have a look at the following likely related issue: http://hub.qgis.org/issues/9229 Try to start QGIS with --noplugins and see if that helps. If yes, upgrade your plugins and if this doesn't help you can use the issue linked above to find the affected plugin and file a bug for it. Regards, Matthias On Fre 21 Mär 2014 16:27:55 CET, Zoltan Szecsei wrote: Hi Devers, Using 2.2 on Win 7 64 - but this was also evident in 2.01 on the same platform. I'm dealing with a number of shapefiles (2 point layers, 9 line layers and 18 area shape file layers) - the total number of geometry elements is not high (probably less <1000), but there are still a reasonable number of vertices in the mapset. I find that after toggling edit mode a few times (may even less than 10), the time to save the layer edits increases to "minutes", and so does the time taken to toggle edit mode. Last year November I was running around on a field trip with a laptop running QGIS 2.0.1 in the car all day, and occasionally it hung, so we rebooted and redid our most recent edits. I'll bet that that was the same issue as below. Last week, now using v2.2 on my desktop I found that the above slowing down scenario started, and I just left the PC supposedly with a "hanging " QGIS. I came back much later and QGIS was responsive again until I touched the toggle edit button, or saved my edits. I timed it and it took an hour and 5 minutes to be responsive again. The same thing is happening right now, but it is currently only going dizzy for about 3-4 minutes. I'm going to try restarting QGIS to see if that helps, if not then I'll re-boot and if it still does not help then that would suggest that the issue is with the data structure and not necessarily somewhere else. But for now, has anyone else had these "slowing down" issues? Regards & chat soon, Zoltan -- === Zoltan Szecsei PrGISc [PGP0031] Geograph (Pty) Ltd. GIS and Photogrammetric Services P.O. Box 7, Muizenberg 7950, South Africa. Mobile: +27-83-6004028 Fax:+27-86-6115323 www.geograph.co.za === ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Updating qgis2threejs
Am 21.03.2014, 03:52 Uhr, schrieb Minoru Akagi : Hi Anita and all, 2014-03-16 16:58 GMT+09:00 Anita Graser : Does the data-defined size feature for vector features work for you? I tried to create spheres with data-defined radius but they were always gigantic - no matter which factor I tried to use as a multiplier. It works for me. Unit of the value (attribute value * multiplier) should be that of project CRS. If the problem becomes clearer, please report issue to GitHub repository of the plugin. Thanks for your feedback! I paid attention to the CRS but still no luck: https://github.com/minorua/Qgis2threejs/issues/15 Best wishes, Anita -- anitagraser.com ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] QGIS 2.3.0-Master crash after trying to add a shapefile from MSSQL
Hi guys, OS: Win 7 64-bit OSgeo Installer: 32-bit QGIS version: 2.3.0-Master QGIS code revision: ab920ba The MSSQL connection works fine in Valmiera (2.2) when i select and press the add button to add a shape but in the master, i do the same thing and when i click in add button, the QGIS master crash. Can anyone report the same issue? If yes, we need to put a ticket of this subject? I have de .dmp file where i can send it? I Can put into a google drive folder and share. Regards João - __ "A palavra impossível é uma expressão infeliz; nada se pode esperar daqueles que a usam frequentemente" [Carlyle, Thomas] Linkedin: http://pt.linkedin.com/in/joaofiliperodriguesgaspar Transifex: https://www.transifex.com/accounts/profile/jonny_forest/ Github: https://github.com/jonnyforestGIS Osgeo Wiki: http://wiki.osgeo.org/wiki/Jo%C3%A3o_Gaspar -- View this message in context: http://osgeo-org.1560.x6.nabble.com/QGIS-2-3-0-Master-crash-after-trying-to-add-a-shapefile-from-MSSQL-tp5130469.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
Re: [Qgis-developer] QGIS 2.3.0-Master crash after trying to add a shapefile from MSSQL
Yes it's a known issue the MS SQL driver is not updated yet. I have someone working on it and it should be in master soon. - Nathan On Sat, Mar 22, 2014 at 10:26 PM, jonnyforest wrote: > Hi guys, > > OS: Win 7 64-bit > OSgeo Installer: 32-bit > QGIS version: 2.3.0-Master > QGIS code revision: ab920ba > > The MSSQL connection works fine in Valmiera (2.2) when i select and press > the add button to add a shape but in the master, i do the same thing and > when i click in add button, the QGIS master crash. > > > Can anyone report the same issue? > > If yes, we need to put a ticket of this subject? > > I have de .dmp file where i can send it? I Can put into a google drive > folder and share. > > Regards > João > > > > - > __ > "A palavra impossível é uma expressão infeliz; nada se pode esperar > daqueles que a usam frequentemente" [Carlyle, Thomas] > > Linkedin: http://pt.linkedin.com/in/joaofiliperodriguesgaspar > Transifex: https://www.transifex.com/accounts/profile/jonny_forest/ > Github: https://github.com/jonnyforestGIS > Osgeo Wiki: http://wiki.osgeo.org/wiki/Jo%C3%A3o_Gaspar > > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/QGIS-2-3-0-Master-crash-after-trying-to-add-a-shapefile-from-MSSQL-tp5130469.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 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] master slow reading rasters?
I had the same problem on a old version od qgis using large raster with rotation parameter into the tfw file. May be the same issue? Il 21/mar/2014 09:30 "Paolo Cavallini" ha scritto: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Il 20/03/2014 18:28, Giovanni Manghi ha scritto: > > >> yes, apparently it depends on the size of the raster (I'm trying with > pretty large ones) > > > > how much large? I'm testing with 9gb rasters and it is lighting fast > > (just fast wothout overviews). > > <3Gb > Perhaps this has something to do with colour table? > > - -- > Paolo Cavallini - www.faunalia.eu > Corsi QGIS e PostGIS: http://www.faunalia.eu/training.html > -BEGIN PGP SIGNATURE- > Version: GnuPG v1 > Comment: Using GnuPG with Icedove - http://www.enigmail.net/ > > iEYEARECAAYFAlMr+IsACgkQ/NedwLUzIr7SQwCeIghnSuiLMtNInJv1lZ62h8w6 > KscAoKRHNpAaxkldKqxMd/hKmT5pp3Aj > =Nxoj > -END PGP SIGNATURE- > ___ > 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
Re: [Qgis-developer] Add Attributes, Features and Geometries to QgsVectorFileWriter
Hello I found out that it works when I initialize the layer like this: QgsVectorLayer("Point?crs=epsg:21781&field=name:string(255)&field=description:string(255)", "temp", "memory") So my code looks like this: --- layer = QgsVectorLayer("Point?crs=epsg:21781&field=name:string(255)&field=description:string(255)", "temp", "memory") feature = QgsFeature() feature.setGeometry(QgsGeometry.fromPoint(QgsPoint(1, 2))) feature.setAttributes(["namex", "xyz"]) layer.dataProvider().addFeatures([feature]) QgsVectorFileWriter.writeAsVectorFormat(layer, "/path/to/file.geojson", "utf-8", None, "GeoJSON") --- But is there a possibility to directly write it to a file with the QgsVectorFileWriter without using the memory layer? It would be nice if PyQGIS Developer Cookbook (http://www.qgis.org/en/docs/pyqgis_developer_cookbook/vector.html#writing-vector-layers) is updated, the second example still contains QVariant. Thank you very much. Josua From: josh-t...@hotmail.com To: qgis-developer@lists.osgeo.org Date: Sat, 22 Mar 2014 01:09:42 +0100 Subject: [Qgis-developer] Add Attributes, Features and Geometries to QgsVectorFileWriter Hello My goal is to write some features and geometries to a JSON file. I searched for examples however in QGIS 2 (I am using 2.2) something seems to have changed so it does not work. Here is a very simple example of what I want to do: fields = QgsFields()fields.append(QgsField("name"))fields.append(QgsField("description"))writer = QgsVectorFileWriter("/path/to/file.geojson", "utf-8", fields, QGis.WKBPoint, None, "GeoJSON")feature = QgsFeature(fields)feature.setGeometry(QgsGeometry.fromPoint(QgsPoint(1, 2)))feature.setAttributes(["name", "xyz"])writer.addFeature(newFeature)del writer The result is a JSON file with the following content: {"type": "FeatureCollection", "features": [{ "type": "Feature", "properties": { }, "geometry": null }]} So the feature is added but attributes and geometry are ignored. Do you have any idea what I am doing wrong? I also tried to create a memory layer: layer = QgsVectorLayer("Point", "temp", "memory")provider = layer.dataProvider()layer.startEditing()provider.addAttributes([QgsField("name"), QgsField("description")])feature = QgsFeature(fields)feature.setGeometry(QgsGeometry.fromPoint(QgsPoint(1, 2)))feature.setAttributes(["namex", "xyz"])provider.addFeatures([feature])layer.updateFields()QgsVectorFileWriter.writeAsVectorFormat(layer, "/path/to/file.geojson", "utf-8", None, "GeoJSON") The result looks a little bit better: {"type": "FeatureCollection","crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::21781" } }, "features": [{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 1.0, 2.0 ] } }]} But the attributes are still missing. Does anybody know how this is done correctly? Thank you very much! Josua ___ 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
[Qgis-developer] GSoC proposals
Hi all, student application period is over. There are four proposals related to QGIS: - QGis Plugin: Report generator out of spatial data - Schematization Plug-in for QGIS - LiDAR support for QGis - Unified "Add Data" dialog for QGis I would like to ask mentors and other devs review and comment them. Thanks -- Alexander Bruy ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] processing.runalg() issue with grass algorithms
Hello again, Still having issues with processing, QGIS master (942d5da) compiled today. I have a script I wrote for GRASS that i'm trying to port over to QGIS. I'm testing the first step to make sure it is going to work before I write the whole thing; it consists of: 1 ##dem=raster 2 ##radius=number 4 3 ##lrm=output raster 4 5 lpf = processing.runalg("saga:simplefilter", dem, 0, 0, radius, None) If I run this script, I get the following error: Oooops! The following output layers could not be open lrm: /tmp/processing/caa3afc6e3c6437893392b173985697c/lrm.tif The above files could not be opened, which probably indicates that they were not correctly produced by the executed algorithm Checking the log information might help you see why those layers were not created as expected The Log contains: Algorithm local relief starting... Converting outputs Loading resulting layers Algorithm local relief finished If I run the same line in the python console, it works correctly: >>> radius = 4 >>> lpf = processing.runalg("saga:simplefilter", "SR_50M_alaska_nad", 0, 0, >>> radius, None) >>> processing.load(lpf['RESULT']) Results in the map being loaded. Also, if I change the output folder in the processing settings to a different location (in this case, tmp/processing in my home folder) and run another algorithm in the python console, the RESULT key still points to /tmp/processing/... Any pointers on why the script doesn't run would be appreciated. I didn't see an existing issue on hub.qgis.org regarding the output folder issue, so it might be a new bug... Thanks! Eric On Sun, Mar 16, 2014 at 1:21 AM, Eric Goddard wrote: > Hi all, > > I'm using QGIS 2.3-Master 64-bit, fa157b0 with GRASS 6.4.4svn on linux. > > When I pass a grass command to processing.runalg() without specifying > the GRASS_REGION_PARAMETER or GRASS_REGION_CELLSIZE_PARAMETER, I get > an empty output because the region/cell size are invalid. For example, > using the qgis sample data, if I run: > > lpf = processing.runalg("grass:r.neighbors", "SR_50M_alaska_nad", 0, > 9, False, False, None, None, None, None) > > there is an output key in lpf that points to a tif, but that tif > doesnt exist. Looking at the log, the above command is translated to: > > processing.runalg("grass:r.neighbors","/data/GIS/qgis_sample_data/raster/SR_50M_alaska_nad.tif",0,9,False,False,"None","0,1,0,1",0.0,None) > > If one runs the r.neighbors algorithm from the Processing Toolbox, > leaving the region and cell size at the defaults (blank and 0.00) > works correctly. How can a similar behavior be achieved when running > the command through processing.runalg()? > > And on a somewhat related note, when running a grass algorithm from > the toolbox there is an option to select extent on canvas--can this be > used in custom processing scripts? > > Thanks! > Eric ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] processing.runalg() issue with grass algorithms
> If I run the same line in the python console, it works correctly: radius = 4 lpf = processing.runalg("saga:simplefilter", "SR_50M_alaska_nad", 0, 0, radius, None) processing.load(lpf['RESULT']) > > Results in the map being loaded. Not sure why this is happening. I will try to reproduce the error and see if it can be fixed Thanks for the report > > Also, if I change the output folder in the processing settings to a > different location (in this case, tmp/processing in my home folder) > and run another algorithm in the python console, the RESULT key still > points to /tmp/processing/... This is not a bug. If you do not enter a filename, the output will always go to a temporary file. The output folder that yu can set in the settings is the folder to be used when you enter a filename without a path (like "myfile.shp", but not "/home/myuser/myfile.shp"), not the folder to use for temporary files. Thanks again! ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] processing.runalg() issue with grass algorithms
Ah, I didn't know a file could he specified without a path. Thanks for the clarification! On Mar 22, 2014 4:37 PM, "Victor Olaya" wrote: > > If I run the same line in the python console, it works correctly: > radius = 4 > lpf = processing.runalg("saga:simplefilter", "SR_50M_alaska_nad", 0, > 0, radius, None) > processing.load(lpf['RESULT']) > > > > Results in the map being loaded. > > Not sure why this is happening. I will try to reproduce the error and > see if it can be fixed > Thanks for the report > > > > > Also, if I change the output folder in the processing settings to a > > different location (in this case, tmp/processing in my home folder) > > and run another algorithm in the python console, the RESULT key still > > points to /tmp/processing/... > > This is not a bug. If you do not enter a filename, the output will > always go to a temporary file. The output folder that yu can set in > the settings is the folder to be used when you enter a filename > without a path (like "myfile.shp", but not "/home/myuser/myfile.shp"), > not the folder to use for temporary files. > > Thanks again! > ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer