Re: [Qgis-developer] Poligon coordinates in PyQgis 2
in the same way as before but with layer.getFeatures(): layer = qgis.utils.iface.activeLayer() for elem in layer.getFeatures(): geom= elem.geometry() poly = geom.asPolygon() poly.wkbType() == QGis.WKBPolygon True # coordinates of vertex: print poly [[(232139,110988), (232673,110410), (232311,110090), (231814,110190), (231684,110648), (232139,110988)]]. There are other ways as the result of getFeatures() is now a generator: layer = qgis.utils.iface.activeLayer() elem = layer.getFeatures().next() geom= elem.geometry() geom.exportToGeoJSON() u'{ type: Polygon, coordinates: [ [ [232139.36700053617823869, 110988.40261790754448157], [232672.76215034080087207, 110409.80448930594138801], [232311.13831996478256769, 110090.37010580713103991], [231813.90555319777922705, 110189.81665916054043919], [231684.3236806463683024, 110647.87351097013743129], [232139.36700053617823869, 110988.40261790754448157] ] ] }' -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Poligon-coordinates-in-PyQgis-2-tp5084165p5084343.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] Installing Processing problems
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 18/10/2013 08:43, Paolo Cavallini ha scritto: My OS X package has all the Processing dependencies bundled in the app. With a clean install it should find the bundled GRASS (and SAGA, OTB, TauDEM) automatically. If you have used the 2.0 nightlies before 2.0 release, your preferences may have paths to Processing components that don't work with my build. The Processing prefs are not stored with the QGIS global prefs, but are in the ~/.qgis2/processing folder. But the GRASS path for the GRASS plugin (non-processing), and the flags that say that GRASS and SAGA are installed for Processing ARE stored in the global QGIS prefs (~/Library/Preferences/org.qgis.qgis2.plist), so you might want to try deleting both. Hi William, thanks for clarifying. Apparently the user has a fresh install, so this should not be the problem. GRASS plugin works, it is just Processing plugin that has trouble finding it. All the best. - -- Paolo Cavallini - Faunalia www.faunalia.eu Full contact details at www.faunalia.eu/pc Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iEYEARECAAYFAlJg3ngACgkQ/NedwLUzIr6brgCePjKlyDNURh0P47z6bFeEPxTh V2IAnRhmuuEly82O/tClb88rrtGM/35y =s6CV -END PGP SIGNATURE- ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Poligon coordinates in PyQgis 2
in the same way as before but with layer.getFeatures(): layer = qgis.utils.iface.activeLayer() for elem in layer.getFeatures(): geom= elem.geometry() poly = geom.asPolygon() poly.wkbType() == QGis.WKBPolygon True # coordinates of vertex: print poly [[(232139,110988), (232673,110410), (232311,110090), (231814,110190), (231684,110648), (232139,110988)]]. ...strange, because also using your code, I had this error poly.wkbType() == QGis.WKBPolygon AttributeError: 'list' object has no attribute 'wkbType' What I do not understand is: for what reason getting coordinates is different from Lines and Polygon ? Perhaps, Is this a new of PyQGis 2 ? Thank you Roberto ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Poligon coordinates in PyQgis 2
On Fri, Oct 18, 2013 at 5:13 PM, Geo DrinX geodr...@gmail.com wrote: poly.wkbType() == QGis.WKBPolygon That should be geom.wkbType() == QGis.WKBPolygon poly is a list-of-list. Polygons are list-of-lists-of-points. A list for each ring in the polygon Linestrings are list-of-points. This hasn't changed since 1.8, or in a long time. - Nathan ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Problems with reprojecting to mercator
Ok, how can i set extent to layers extent? QgsApplication a(argc,argv, true); QgsProviderRegistry::instance(/usr/local/lib/qgis/plugins); a.setPkgDataPath(QDir::homePath() + QDir::separator() + .harver/); QgsMapCanvas *canvas = new QgsMapCanvas(0, 0); canvas-enableAntiAliasing(true); canvas-useImageToRender(false); canvas-setCanvasColor(QColor(255, 255, 255)); canvas-freeze(false); canvas-setVisible(true); canvas-refresh(); canvas-show(); QgsCoordinateReferenceSystem pseudo_mercator(3857, QgsCoordinateReferenceSystem::PostgisCrsId); QgsCoordinateReferenceSystem wgs84_4326(4326, QgsCoordinateReferenceSystem::PostgisCrsId); canvas-mapRenderer()-setProjectionsEnabled(true); canvas-mapRenderer()-setDestinationCrs(pseudo_mercator); canvas-mapRenderer()-setMapUnits(pseudo_mercator.mapUnits()); QgsVectorLayer *layer = new QgsVectorLayer(/home/xumuk/shapes/fields_r.SHP, fields, ogr); QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer(layer-geometryType()); layer-setRenderer(renderer); layer-setCrs(wgs84_4326); layer-updateExtents(); QgsMapLayerRegistry::instance()-addMapLayers(QListQgsMapLayer*() layer); QListQgsMapCanvasLayer layerSet; layerSet.append(QgsMapCanvasLayer(layer)); canvas-setExtent(layer-extent()); == here i have degrees, but i need to set extent in pseudo_mercator.mapUnits canvas-setLayerSet(layerSet); canvas-refresh(); -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Problems-with-reprojecting-to-mercator-tp5082191p5084362.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] Poligon coordinates in PyQgis 2
I found a way to have coordinates: layer = qgis.utils.iface.activeLayer() for elem in layer.getFeatures(): geom= elem.geometry() elem = geom.asPolygon() for iii in range (len(elem)): for jjj in range (len(elem[iii])): x1,y1 = elem[iii][jjj][0], elem[iii][jjj][1] Is this the unique way ? Nothing of more elegant ? For what reason, in the linestring case I can write something like this: layer = qgis.utils.iface.activeLayer() for elem in layer.getFeatures(): geom= elem.geometry() poly = geom.asPolyline() for p1 in elem: x1,y1 = p1.x(),p1.y() print ('%lf,%lf \n') % (x1,y1) ...and, instead, in polygon there is not a x() y() method ? :) Thank you Roberto ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Plugin [382] Google Maps Engine Connector approval notification.
Plugin Google Maps Engine Connector approval by NathanW. The plugin version [382] Google Maps Engine Connector 1.0 is now approved Link: http://plugins.qgis.org/plugins/GoogleMapsEngineConnector/ ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] new plugin - review request
Hi, In my opinion, the plugin description should clearly state that the plugin requires a paid google maps engine account. Otherwise we will be flooded with user mails wondering how it works. Best wishes, Anita On Fri, Oct 18, 2013 at 2:52 PM, Ujaval Gandhi uja...@google.com wrote: Hi All, I submitted a new python plugin for the plugin repository yesterday. I wanted to provide some additional clarification to help with the review process. The plugin 'Google Maps Engine Connector' was developed at Google to help the enterprise customers view their maps engine maps in QGIS as well as upload layers to maps engine from QGIS. Testing the full functionality of this plugin will be difficult without a paid google maps engine account. I have ensured the code is sufficiently documented so it should be easy to get an idea of the functionality. If the team has further questions or concerns, please feel free to reach out to me. Github repo: https://github.com/googlemaps/mapsengine-qgis-connector Plugin: http://plugins.qgis.org/plugins/GoogleMapsEngineConnector/ Also, if possible, could someone give an estimate on when can we expect this plugin to be reviewed and listed? Thanks. -- Ujaval Gandhi | Staff Geo Data Strategist | uja...@google.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] Installing Processing problems
On Oct 18, 2013, at 2:08 AM, Paolo Cavallini wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 18/10/2013 08:43, Paolo Cavallini ha scritto: My OS X package has all the Processing dependencies bundled in the app. With a clean install it should find the bundled GRASS (and SAGA, OTB, TauDEM) automatically. If you have used the 2.0 nightlies before 2.0 release, your preferences may have paths to Processing components that don't work with my build. The Processing prefs are not stored with the QGIS global prefs, but are in the ~/.qgis2/processing folder. But the GRASS path for the GRASS plugin (non-processing), and the flags that say that GRASS and SAGA are installed for Processing ARE stored in the global QGIS prefs (~/Library/Preferences/org.qgis.qgis2.plist), so you might want to try deleting both. Hi William, thanks for clarifying. Apparently the user has a fresh install, so this should not be the problem. GRASS plugin works, it is just Processing plugin that has trouble finding it. All the best. Hmm. Runtime errors can cause Processing to say that it can't find it, even when the path is correct. What's in the output log of a Processing GRASS command (not the dialog that pops up when it can't find GRASS). You can keep the algorithm dialog open by setting a Processing general option. - William Kyngesburye kyngchaos*at*kyngchaos*dot*com http://www.kyngchaos.com/ [Trillian] What are you supposed to do WITH a maniacally depressed robot? [Marvin] You think you have problems? What are you supposed to do if you ARE a maniacally depressed robot? No, don't try and answer, I'm 50,000 times more intelligent than you and even I don't know the answer... - HitchHiker's Guide to the Galaxy ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Teaching Processing: notes from the wild
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all. Just finished a course on GIS analyses, following mainly the sextante tutorial; here my notes: * Random selection: the selection does not appear, as the module is not refreshing the view * Split randomly: the % is not exact (e.g. if I select a 20/80 split, I get 22/78 etc.) * Create graticule from extent: with lines, one of the points (first North-West) is left out; with polygons it is ok * In the Log viewer, the button Cancel is misleading, and can lead to loss of important data a bit too easily; better to give a warning before actually deleting * the Field calculator is barely usable without a dropdown list of fields and functions; on win it does not seem to work (most or all calculations end up with all NULLs); unclear if this is due to minor edit issues from users (quite likely without the dropdowns) * it seems impossible to make conditional models (if this value is ... then run this command, else this other one): am I correct? this would be a major improvement IMHO * I cannot have OTB running, neither on Debian nor on Win (osgeo4w 32 bit) * I get a systematic crash when attempting to edit Processing or R scripts, but this may be a local issue warning: no loadable sections found in added symbol-file system-supplied DSO at 0x749fe000 0x7fcb55dc50f7 in __libc_waitpid (pid=optimized out, stat_loc=optimized out, options=optimized out) at ../sysdeps/unix/sysv/linux/waitpid.c:40 40 ../sysdeps/unix/sysv/linux/waitpid.c: File o directory non esistente. [Current thread is 1 (Thread 0x7fcb5d433780 (LWP 14528))] #0 0x7fcb55dc50f7 in __libc_waitpid (pid=optimized out, stat_loc=optimized out, options=optimized out) at ../sysdeps/unix/sysv/linux/waitpid.c:40 resultvar = optimized out oldtype = 0 result = optimized out #1 0x004ec607 in qgisCrash(int) () No symbol table info available. #2 signal handler called No locals. #3 0x7fcb58e32ca7 in QMetaObject::methodOffset() const () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 No symbol table info available. All the best, and thanks. - -- Paolo Cavallini - Faunalia www.faunalia.eu Full contact details at www.faunalia.eu/pc Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iEYEARECAAYFAlJhTT8ACgkQ/NedwLUzIr6mqgCZAf3Ki6Ql+6wg/QAw1439hRNa sJYAn0BR9zNOndp2Xqz/pOKWUzL7zhke =XrM7 -END PGP SIGNATURE- ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Teaching Processing: notes from the wild
Hi, 2013/10/18 Paolo Cavallini cavall...@faunalia.it: * Random selection: the selection does not appear, as the module is not refreshing the view Seems fixed in master. Also similar bug was closed about 5 days ago, see https://hub.qgis.org/issues/8127#change-45578 * Split randomly: the % is not exact (e.g. if I select a 20/80 split, I get 22/78 etc.) I can see only SAGA algorithm with this name. Not sure, but seems this is upstream (SAGA) bug. * Create graticule from extent: with lines, one of the points (first North-West) is left out; with polygons it is ok Seems same as previous. * In the Log viewer, the button Cancel is misleading, and can lead to loss of important data a bit too easily; better to give a warning before actually deleting I suppose you mean Clear button, right? Added in master just now. * the Field calculator is barely usable without a dropdown list of fields and functions; on win it does not seem to work (most or all calculations end up with all NULLs); unclear if this is due to minor edit issues from users (quite likely without the dropdowns) Maybe I'm wrong, but currently there is no way to create such widgets and use them in Processing algorithms. * it seems impossible to make conditional models (if this value is ... then run this command, else this other one): am I correct? this would be a major improvement IMHO Yes, there are no support for conditional expressions and loops in modeler. I don't remember exactly, but this is a complex issue and adding such feature will require a lot of work. -- Alexander Bruy ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Microsoft Visual C++ Crash when build qgis 1.8.0 on Windows 7 64bit
Hello Qgis developers I have a problem building the source of qgis1.8.0 in Windows 7 64bit. i am trying to follow this instructions in this page: http://hub.qgis.org/wiki/17/Building_QGIS_from_Source?version=2#Building-on- Windows the dependencys are all installed succesfully and the generation of qgis1.8.0.sln is succesful too. but in the release solution configuration build, always Microsoft Visual C++ crash without problem report. Anybody know how to fix the problem with Microsoft Visual C++? Thank you. Thank You. Mohamed fkili GIS Programmer Global Solutions Group 12801 Auburn St., Detroit, MI 48223 Bus: 313.544.7117 ext. 306 -or- 313.397.8311 Fax: 313.397.8312 moham...@globalsolgroup.com http://www.globalsolgroup.com/ www.globalsolgroup.com Attention: The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy any copies. image001.png___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] QGIS inconsistency
Hello, I have been doing a project to calculate mountain viewsheds, basically where a mountain summits can be seen from. I have calculated the viewsheds and polygonized to Vector. So far so good, but then I wanted to show which mountains could be seen from the summit of other mountains I appear to have 2 problems. 1. I ran a spacial query to show how many mountains (Munros) are Within my polgonized viewshed. This returns the Munros. Unfortunately I get a different number in QGIS 1.8 to QGIS 2.0.1, I don't know which is true 2. I had saved my Viewshed originally as a shapefile with a CRS of 27700 (British National Grid), I saved a version as GeoJSON with CRS of 4326. If I run the same spacial query on this file I get a different number of Munros again. So I now have 4 different figures from what I would have expected to be identical. Is data lost when a shapefile is saved as a GeoJSON file in a different CRS? and which should I beleive 1.8 or 2.0.1 or neither? If anyone wants to test this you can download the files here: Viewshed Shapefilehttps://dl.dropboxusercontent.com/u/2657852/AmBodach_shp.zip- CRS of 27700 Viewshed GeoJSONhttps://dl.dropboxusercontent.com/u/2657852/AmBodach_geojson.zip- Converted fromthe above but with CRS of 4326 Munros Shapefile https://dl.dropboxusercontent.com/u/2657852/Munros.zip - CRS of 27700 Wish I had realised there was something wrong before I had calculated 200 of these. Thanks, Steven ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Plugin approval request
Hi, I uploaded new Lat/Lon grid plugin to http://plugins.qgis.org/plugins/latlongrid/ last Tuesday. I would appreciate if someone could find a time to approve it. Thank you very much, Best Regards Mikhail ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Teaching Processing: notes from the wild
Hi, first tests for me, and I found that using selection or not should be an option in every tool dialog. Having to go in general options to use selection or not in input is not natural, and is different from other qgis tools. Cheers, Régis -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Teaching-Processing-notes-from-the-wild-tp5084452p5084532.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] Plugin [311] GeopapaTile approval notification.
Plugin GeopapaTile approval by rduivenvoorde. The plugin version [311] GeopapaTile 0.1.3 is now approved Link: http://plugins.qgis.org/plugins/GeopapaTile/ ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] [OT] - politically correct question
On 16-10-13 12:46, Richard Duivenvoorde wrote: On 16-10-13 12:29, Ing. Pierluigi De Rosa wrote: Since QGIS was at 1.8 version I used a plugin very useful for me but now the same is to updated to the 2.0 version. I write to the developer asking for un update for version 2.0 and telling him I'm are available to the the necessary work to do that. Unfortunately I didn’t receive any reply from him. ... Then maybe ask via this list if the developer is around, or if somebody knows this developer personally, and try to contact him again (or via the person who knows him). ... In short: please be gentle to a plugin dev. He invested his free time into the developing the initial version(s) of the plugin. FYI: done and plugin updated Thanks all :-) ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Teaching Processing: notes from the wild
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 18/10/2013 21:54, Régis Haubourg ha scritto: first tests for me, and I found that using selection or not should be an option in every tool dialog. Having to go in general options to use selection or not in input is not natural, and is different from other qgis tools. this makes sense, but it may then be more difficult to incorporate in models. all the best. - -- Paolo Cavallini - Faunalia www.faunalia.eu Full contact details at www.faunalia.eu/pc Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iEYEARECAAYFAlJiHU0ACgkQ/NedwLUzIr5DLACgn0SU/CyoqdwNHVDyMkMbPDb9 vUQAn0zMl8bxJK8o76Y56yBWGZxF5Eq0 =k2yK -END PGP SIGNATURE- ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Teaching Processing: notes from the wild
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Alex, thanks for your replies - notes below. Il 18/10/2013 19:43, Alexander Bruy ha scritto: Hi, 2013/10/18 Paolo Cavallini cavall...@faunalia.it: * Random selection: the selection does not appear, as the module is not refreshing the view Seems fixed in master. Also similar bug was closed about 5 days ago, see https://hub.qgis.org/issues/8127#change-45578 so, why not releasing a new version right now? This could also incorporate the many improvements to modules that Giovanni did recently. * Split randomly: the % is not exact (e.g. if I select a 20/80 split, I get 22/78 etc.) I can see only SAGA algorithm with this name. Not sure, but seems this is upstream (SAGA) bug. * Create graticule from extent: with lines, one of the points (first North-West) is left out; with polygons it is ok Seems same as previous. could anyone confirm and open a ticket upstream then, for both? * In the Log viewer, the button Cancel is misleading, and can lead to loss of important data a bit too easily; better to give a warning before actually deleting I suppose you mean Clear button, right? Added in master just now. one more reason for the upgrade ;) * the Field calculator is barely usable without a dropdown list of fields and functions; on win it does not seem to work (most or all calculations end up with all NULLs); unclear if this is due to minor edit issues from users (quite likely without the dropdowns) Maybe I'm wrong, but currently there is no way to create such widgets and use them in Processing algorithms. this is also what I understand * it seems impossible to make conditional models (if this value is ... then run this command, else this other one): am I correct? this would be a major improvement IMHO Yes, there are no support for conditional expressions and loops in modeler. I don't remember exactly, but this is a complex issue and adding such feature will require a lot of work. ok - should I open tickets then, not to forget for future implementation? thanks. - -- Paolo Cavallini - Faunalia www.faunalia.eu Full contact details at www.faunalia.eu/pc Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iEYEARECAAYFAlJiHtgACgkQ/NedwLUzIr462gCglWrXgOWeVC3QeEUp0FTWNnRX PgYAnA997jTRslU1JH1ZM+fQbe/AtxKJ =j/B2 -END PGP SIGNATURE- ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer