[Qgis-developer] QgisLogger can be a serious bottleneck
As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time. Debugging pointed me to the problem: QgsVectoFileWriter was logging tons of empty geometres with an incompatible type which will be discarded. After commenting the line of logging the process completed in linear time. Shouldn't we offer the opportunity to turn QgsLogger off? This would let the user/developer to switch it off whenever he already knows what's happening. Is it already there and I missed it? giovanni ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] QgisLogger can be a serious bottleneck
I meant QgsMessageLog, not QgsLogger... 2014-07-05 10:27 GMT+02:00 G. Allegri gioha...@gmail.com: As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time. Debugging pointed me to the problem: QgsVectoFileWriter was logging tons of empty geometres with an incompatible type which will be discarded. After commenting the line of logging the process completed in linear time. Shouldn't we offer the opportunity to turn QgsLogger off? This would let the user/developer to switch it off whenever he already knows what's happening. Is it already there and I missed it? giovanni -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] QgisLogger can be a serious bottleneck
I've added a pull request about this https://github.com/qgis/QGIS/pull/1499 giovanni 2014-07-05 11:15 GMT+02:00 G. Allegri gioha...@gmail.com: I meant QgsMessageLog, not QgsLogger... 2014-07-05 10:27 GMT+02:00 G. Allegri gioha...@gmail.com: As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time. Debugging pointed me to the problem: QgsVectoFileWriter was logging tons of empty geometres with an incompatible type which will be discarded. After commenting the line of logging the process completed in linear time. Shouldn't we offer the opportunity to turn QgsLogger off? This would let the user/developer to switch it off whenever he already knows what's happening. Is it already there and I missed it? giovanni -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] QgisLogger can be a serious bottleneck
Hi Giovanni, On Sat, 05. Jul 2014 at 10:27:24 +0200, G. Allegri wrote: As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time. Debugging pointed me to the problem: QgsVectoFileWriter was logging tons of empty geometres with an incompatible type which will be discarded. After commenting the line of logging the process completed in linear time. Shouldn't we offer the opportunity to turn QgsLogger off? This would let the user/developer to switch it off whenever he already knows what's happening. Is it already there and I missed it? What error message did you get and wouldn't it be better to kill them where it origins or to issue a final %n empty geometries skipped instead of logging individual errors. Alternatively we could issue a last message repeated %n times in message log to make it behave better - although that only works the error message are identical. Jürgen -- Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31 Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50 Software Engineer D-26506 Norden http://www.norbit.de QGIS release manager (PSC) GermanyIRC: jef on FreeNode -- norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH Rheinstrasse 13, 26506 Norden GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] QgisLogger can be a serious bottleneck
Hi Jurgen, I wouldn't call them errors. GEOSDIfference returned a lot of empty geomcollections, which the QgsVectorFileWriter couldn't manage. Consequently it wrote a log message for each geometry it couldn't write [1]. Surely the logging should be improved in this specific case. Anyway, I think the option to turn QgsMessageLog off could be useful anyway... giovanni [1] https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1718 2014-07-05 12:31 GMT+02:00 Jürgen E. j...@norbit.de: Hi Giovanni, On Sat, 05. Jul 2014 at 10:27:24 +0200, G. Allegri wrote: As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time. Debugging pointed me to the problem: QgsVectoFileWriter was logging tons of empty geometres with an incompatible type which will be discarded. After commenting the line of logging the process completed in linear time. Shouldn't we offer the opportunity to turn QgsLogger off? This would let the user/developer to switch it off whenever he already knows what's happening. Is it already there and I missed it? What error message did you get and wouldn't it be better to kill them where it origins or to issue a final %n empty geometries skipped instead of logging individual errors. Alternatively we could issue a last message repeated %n times in message log to make it behave better - although that only works the error message are identical. Jürgen -- Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31 Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50 Software Engineer D-26506 Norden http://www.norbit.de QGIS release manager (PSC) GermanyIRC: jef on FreeNode -- norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH Rheinstrasse 13, 26506 Norden GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Working with the new Legend
On 28-06-14 08:11, Martin Dobias wrote: Let me paste some example code. Let's prepare few things to begin with: # add few layers at the beginning so the legend is not completely empty v1 = iface.addVectorLayer(Point, Layer 1, memory) v2 = iface.addVectorLayer(Point, Layer 2, memory) v3 = iface.addVectorLayer(Point, Layer 3, memory) # create a layer and add it to registry, saying it should not be immediately added to legend v4 = QgsVectorLayer(Point, Layer X, memory) QgsMapLayerRegistry.instance().addMapLayer(v4, False) # get reference to the layer tree root=QgsProject.instance().layerTreeRoot() * insert a layer at a give location # add layer to the node at index 0 v4n = QgsLayerTreeLayer(v4) root.insertChildNode(0, v4n) * move a layer to a new position v4n2 = v4n.clone() root.insertChildNode(-1, v4n2) # insert at last position root.removeChildNode(v4n) * remove a layer root.removeChildNode(v4n2) (we could use root.findLayer(v4.id()) to get the node if we didn't have it before) Hi Martin, if I want to insert a new layer below some other one, I need to know the position of that one. I'm trying to find an index or so in Python, but cannot find it? Is there already a way to do this? (I want to put a buffer below the layer it has buffered) Regards, Richard ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] QgisLogger can be a serious bottleneck
Hi GioHappy, the empty-collection is absolutelly not necessarylly a bug. It is the obviously result of an operation on a machine (like the computer) with a binary finite arithmetic. Usually the empty is due to a too low value to be describe with a finite binary arithmetic. If the dataset is small or it is topologically correct (this not mean only to be snapped). the collection results never happened. Instead if the dataset is not topologically correct and is big the probability to have some collection result grow. We tipically have alway an 0.01% of collection on our results. I suggest you to use directly postgis or spatialite to do this kind of operations. In these products you have the useful tools to resolve the collections correctly. Regard, Andrea. 2014-07-05 12:40 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Jurgen, I wouldn't call them errors. GEOSDIfference returned a lot of empty geomcollections, which the QgsVectorFileWriter couldn't manage. Consequently it wrote a log message for each geometry it couldn't write [1]. Surely the logging should be improved in this specific case. Anyway, I think the option to turn QgsMessageLog off could be useful anyway... giovanni [1] https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1718 2014-07-05 12:31 GMT+02:00 Jürgen E. j...@norbit.de: Hi Giovanni, On Sat, 05. Jul 2014 at 10:27:24 +0200, G. Allegri wrote: As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time. Debugging pointed me to the problem: QgsVectoFileWriter was logging tons of empty geometres with an incompatible type which will be discarded. After commenting the line of logging the process completed in linear time. Shouldn't we offer the opportunity to turn QgsLogger off? This would let the user/developer to switch it off whenever he already knows what's happening. Is it already there and I missed it? What error message did you get and wouldn't it be better to kill them where it origins or to issue a final %n empty geometries skipped instead of logging individual errors. Alternatively we could issue a last message repeated %n times in message log to make it behave better - although that only works the error message are identical. Jürgen -- Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31 Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50 Software Engineer D-26506 Norden http://www.norbit.de QGIS release manager (PSC) GermanyIRC: jef on FreeNode -- norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH Rheinstrasse 13, 26506 Norden GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- - Andrea Peri . . . . . . . . . qwerty àèìòù - ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] QgisLogger can be a serious bottleneck
Hi Andrea, as I said above I'm not considering it an error. The topic of this post is QGIS message logging. The processing completes as expected, with the same results as Spatialite and PostGIS. These simply do it silently :) giovanni 2014-07-05 15:59 GMT+02:00 Andrea Peri aperi2...@gmail.com: Hi GioHappy, the empty-collection is absolutelly not necessarylly a bug. It is the obviously result of an operation on a machine (like the computer) with a binary finite arithmetic. Usually the empty is due to a too low value to be describe with a finite binary arithmetic. If the dataset is small or it is topologically correct (this not mean only to be snapped). the collection results never happened. Instead if the dataset is not topologically correct and is big the probability to have some collection result grow. We tipically have alway an 0.01% of collection on our results. I suggest you to use directly postgis or spatialite to do this kind of operations. In these products you have the useful tools to resolve the collections correctly. Regard, Andrea. 2014-07-05 12:40 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Jurgen, I wouldn't call them errors. GEOSDIfference returned a lot of empty geomcollections, which the QgsVectorFileWriter couldn't manage. Consequently it wrote a log message for each geometry it couldn't write [1]. Surely the logging should be improved in this specific case. Anyway, I think the option to turn QgsMessageLog off could be useful anyway... giovanni [1] https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1718 2014-07-05 12:31 GMT+02:00 Jürgen E. j...@norbit.de: Hi Giovanni, On Sat, 05. Jul 2014 at 10:27:24 +0200, G. Allegri wrote: As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time. Debugging pointed me to the problem: QgsVectoFileWriter was logging tons of empty geometres with an incompatible type which will be discarded. After commenting the line of logging the process completed in linear time. Shouldn't we offer the opportunity to turn QgsLogger off? This would let the user/developer to switch it off whenever he already knows what's happening. Is it already there and I missed it? What error message did you get and wouldn't it be better to kill them where it origins or to issue a final %n empty geometries skipped instead of logging individual errors. Alternatively we could issue a last message repeated %n times in message log to make it behave better - although that only works the error message are identical. Jürgen -- Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31 Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50 Software Engineer D-26506 Norden http://www.norbit.de QGIS release manager (PSC) GermanyIRC: jef on FreeNode -- norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH Rheinstrasse 13, 26506 Norden GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- - Andrea Peri . . . . . . . . . qwerty àèìòù - -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] QgisLogger can be a serious bottleneck
AFAICS whenever a new feature needs to be created, geom collections are discarded, because QGIS cannot manage them. giovanni 2014-07-05 16:40 GMT+02:00 Andrea Peri aperi2...@gmail.com: Ok, sorry. Just a my personal curiosity: The difference could give also a collection not empty. If the difference of two polygons is a collection with some polygons, some lines and some points. What happened to this collection in QGIS ? Thx, A. 2014-07-05 16:03 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Andrea, as I said above I'm not considering it an error. The topic of this post is QGIS message logging. The processing completes as expected, with the same results as Spatialite and PostGIS. These simply do it silently :) giovanni 2014-07-05 15:59 GMT+02:00 Andrea Peri aperi2...@gmail.com: Hi GioHappy, the empty-collection is absolutelly not necessarylly a bug. It is the obviously result of an operation on a machine (like the computer) with a binary finite arithmetic. Usually the empty is due to a too low value to be describe with a finite binary arithmetic. If the dataset is small or it is topologically correct (this not mean only to be snapped). the collection results never happened. Instead if the dataset is not topologically correct and is big the probability to have some collection result grow. We tipically have alway an 0.01% of collection on our results. I suggest you to use directly postgis or spatialite to do this kind of operations. In these products you have the useful tools to resolve the collections correctly. Regard, Andrea. 2014-07-05 12:40 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Jurgen, I wouldn't call them errors. GEOSDIfference returned a lot of empty geomcollections, which the QgsVectorFileWriter couldn't manage. Consequently it wrote a log message for each geometry it couldn't write [1]. Surely the logging should be improved in this specific case. Anyway, I think the option to turn QgsMessageLog off could be useful anyway... giovanni [1] https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1718 2014-07-05 12:31 GMT+02:00 Jürgen E. j...@norbit.de: Hi Giovanni, On Sat, 05. Jul 2014 at 10:27:24 +0200, G. Allegri wrote: As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time. Debugging pointed me to the problem: QgsVectoFileWriter was logging tons of empty geometres with an incompatible type which will be discarded. After commenting the line of logging the process completed in linear time. Shouldn't we offer the opportunity to turn QgsLogger off? This would let the user/developer to switch it off whenever he already knows what's happening. Is it already there and I missed it? What error message did you get and wouldn't it be better to kill them where it origins or to issue a final %n empty geometries skipped instead of logging individual errors. Alternatively we could issue a last message repeated %n times in message log to make it behave better - although that only works the error message are identical. Jürgen -- Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31 Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50 Software Engineer D-26506 Norden http://www.norbit.de QGIS release manager (PSC) GermanyIRC: jef on FreeNode -- norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH Rheinstrasse 13, 26506 Norden GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- - Andrea Peri . . . . . . . . . qwerty àèìòù - -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus -- - Andrea Peri . . . . . . . . . qwerty àèìòù - -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus
[Qgis-developer] RasterFileWriter creates 5 times bigger geotiff then gdal_translate
Causally I hit the save as raster dialog, and I tried to export a raster to layer (coming from an ASCII Grid source) to Geotiff, with no creation options set. The result was a file 3 times bigger then the original ASCII, and 5 times bigger then the Geotiff created by gdal_translate. gdalinfo on the files give same results (except statistics missing from the one created by RasterFileWriter). Does gdal_translate do some optimizations that RFW doesn't? I wasn't aware that two Geotiffs, apparently with the same properties, could be so different in size... giovanni -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] QgisLogger can be a serious bottleneck
Thx GioHappy, this is imprtant for me to know. So is surely better to use the postgis or spatialite because it allow you to extract from the collection the section with the right type. If you do a difference beetwen two polygons is the result is a collection with a polygon section and a point section. You should extract the polygon and discard the point. If the strategu is discard all the collection this mean that on qgis the difference could lost domething of important and so potentially the difference do a wrong result. Regards, Andrea. 2014-07-05 16:47 GMT+02:00 G. Allegri gioha...@gmail.com: AFAICS whenever a new feature needs to be created, geom collections are discarded, because QGIS cannot manage them. giovanni 2014-07-05 16:40 GMT+02:00 Andrea Peri aperi2...@gmail.com: Ok, sorry. Just a my personal curiosity: The difference could give also a collection not empty. If the difference of two polygons is a collection with some polygons, some lines and some points. What happened to this collection in QGIS ? Thx, A. 2014-07-05 16:03 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Andrea, as I said above I'm not considering it an error. The topic of this post is QGIS message logging. The processing completes as expected, with the same results as Spatialite and PostGIS. These simply do it silently :) giovanni 2014-07-05 15:59 GMT+02:00 Andrea Peri aperi2...@gmail.com: Hi GioHappy, the empty-collection is absolutelly not necessarylly a bug. It is the obviously result of an operation on a machine (like the computer) with a binary finite arithmetic. Usually the empty is due to a too low value to be describe with a finite binary arithmetic. If the dataset is small or it is topologically correct (this not mean only to be snapped). the collection results never happened. Instead if the dataset is not topologically correct and is big the probability to have some collection result grow. We tipically have alway an 0.01% of collection on our results. I suggest you to use directly postgis or spatialite to do this kind of operations. In these products you have the useful tools to resolve the collections correctly. Regard, Andrea. 2014-07-05 12:40 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Jurgen, I wouldn't call them errors. GEOSDIfference returned a lot of empty geomcollections, which the QgsVectorFileWriter couldn't manage. Consequently it wrote a log message for each geometry it couldn't write [1]. Surely the logging should be improved in this specific case. Anyway, I think the option to turn QgsMessageLog off could be useful anyway... giovanni [1] https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1718 2014-07-05 12:31 GMT+02:00 Jürgen E. j...@norbit.de: Hi Giovanni, On Sat, 05. Jul 2014 at 10:27:24 +0200, G. Allegri wrote: As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time. Debugging pointed me to the problem: QgsVectoFileWriter was logging tons of empty geometres with an incompatible type which will be discarded. After commenting the line of logging the process completed in linear time. Shouldn't we offer the opportunity to turn QgsLogger off? This would let the user/developer to switch it off whenever he already knows what's happening. Is it already there and I missed it? What error message did you get and wouldn't it be better to kill them where it origins or to issue a final %n empty geometries skipped instead of logging individual errors. Alternatively we could issue a last message repeated %n times in message log to make it behave better - although that only works the error message are identical. Jürgen -- Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31 Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50 Software Engineer D-26506 Norden http://www.norbit.de QGIS release manager (PSC) GermanyIRC: jef on FreeNode -- norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH Rheinstrasse 13, 26506 Norden GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org
Re: [Qgis-developer] Geom collection and QGIS (was QgisLogger can be a serious bottleneck)
(I changed the topic) Geometry collections in QGIS must be treated at the GEOS level. There isnt a QGIS::wkbType for geometry collections, so if GEOS return a collection they must be managed as GEOS geometries, before moving them up to QgsGeometry. Correct me if I'm wrong. giovanni 2014-07-05 17:17 GMT+02:00 Andrea Peri aperi2...@gmail.com: Thx GioHappy, this is imprtant for me to know. So is surely better to use the postgis or spatialite because it allow you to extract from the collection the section with the right type. If you do a difference beetwen two polygons is the result is a collection with a polygon section and a point section. You should extract the polygon and discard the point. If the strategu is discard all the collection this mean that on qgis the difference could lost domething of important and so potentially the difference do a wrong result. Regards, Andrea. 2014-07-05 16:47 GMT+02:00 G. Allegri gioha...@gmail.com: AFAICS whenever a new feature needs to be created, geom collections are discarded, because QGIS cannot manage them. giovanni 2014-07-05 16:40 GMT+02:00 Andrea Peri aperi2...@gmail.com: Ok, sorry. Just a my personal curiosity: The difference could give also a collection not empty. If the difference of two polygons is a collection with some polygons, some lines and some points. What happened to this collection in QGIS ? Thx, A. 2014-07-05 16:03 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Andrea, as I said above I'm not considering it an error. The topic of this post is QGIS message logging. The processing completes as expected, with the same results as Spatialite and PostGIS. These simply do it silently :) giovanni 2014-07-05 15:59 GMT+02:00 Andrea Peri aperi2...@gmail.com: Hi GioHappy, the empty-collection is absolutelly not necessarylly a bug. It is the obviously result of an operation on a machine (like the computer) with a binary finite arithmetic. Usually the empty is due to a too low value to be describe with a finite binary arithmetic. If the dataset is small or it is topologically correct (this not mean only to be snapped). the collection results never happened. Instead if the dataset is not topologically correct and is big the probability to have some collection result grow. We tipically have alway an 0.01% of collection on our results. I suggest you to use directly postgis or spatialite to do this kind of operations. In these products you have the useful tools to resolve the collections correctly. Regard, Andrea. 2014-07-05 12:40 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Jurgen, I wouldn't call them errors. GEOSDIfference returned a lot of empty geomcollections, which the QgsVectorFileWriter couldn't manage. Consequently it wrote a log message for each geometry it couldn't write [1]. Surely the logging should be improved in this specific case. Anyway, I think the option to turn QgsMessageLog off could be useful anyway... giovanni [1] https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1718 2014-07-05 12:31 GMT+02:00 Jürgen E. j...@norbit.de: Hi Giovanni, On Sat, 05. Jul 2014 at 10:27:24 +0200, G. Allegri wrote: As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time. Debugging pointed me to the problem: QgsVectoFileWriter was logging tons of empty geometres with an incompatible type which will be discarded. After commenting the line of logging the process completed in linear time. Shouldn't we offer the opportunity to turn QgsLogger off? This would let the user/developer to switch it off whenever he already knows what's happening. Is it already there and I missed it? What error message did you get and wouldn't it be better to kill them where it origins or to issue a final %n empty geometries skipped instead of logging individual errors. Alternatively we could issue a last message repeated %n times in message log to make it behave better - although that only works the error message are identical. Jürgen -- Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31 Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50 Software Engineer D-26506 Norden http://www.norbit.de QGIS release manager (PSC) GermanyIRC: jef on FreeNode -- norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH Rheinstrasse 13, 26506 Norden GF: Jelto Buurman, HR: Amtsgericht Emden,
[Qgis-developer] Selection Within Stacked Geometry
I'm working with conflict data, and because of escalation (e.g., kidnappings, bombings and insurgent attacks can lead to full-scale territorial disputes), temporal point features can become stacked. I was initially trying to figure out a way to highlight a record within a selected set in the attribute table and zoom to that point without loosing the original selection, but the Advanced Filter may be the best way to handle that. As I was panning the map, though, I noticed some locations that should have been selected from my query, and upon inspection, realized they were stacked points. Evidently the points on top prevented me from seeing the selected ones underneath. Even using the point displacement renderer (which is a pretty slick tool, btw) the selection was still hidden in the original point stack. Should I not be able to see my selections on the map canvas in relation to my other point data or is there a setting or trick here that I'm missing? I'm a relatively new QGIS user, so please take that into consideration. I'm sure this has been discussed before, and I did some online searches but came up with very little. I did find this, but nothing related to point selections or how those would be affected by feature request changes. If I missed a solution, I would greatly appreciate a nudge in the right direction, but perhaps the development community is still reviewing how best to handle this... Win 7 x64 SP1 QGIS 2.4.0 (x64 standalone installer) Thanks in advance for any feedback, James ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] RasterFileWriter creates 5 times bigger geotiff then gdal_translate
I haven't spot tha exact point where this happens but QGIS exports Float64, even if the origin was Float32. giovanni 2014-07-05 16:54 GMT+02:00 G. Allegri gioha...@gmail.com: Causally I hit the save as raster dialog, and I tried to export a raster to layer (coming from an ASCII Grid source) to Geotiff, with no creation options set. The result was a file 3 times bigger then the original ASCII, and 5 times bigger then the Geotiff created by gdal_translate. gdalinfo on the files give same results (except statistics missing from the one created by RasterFileWriter). Does gdal_translate do some optimizations that RFW doesn't? I wasn't aware that two Geotiffs, apparently with the same properties, could be so different in size... giovanni -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Geom collection and QGIS (was QgisLogger can be a serious bottleneck)
Is wrong. The geos return a collection when the collectionis the right result. if the result is a collection like: collection (multipolygons, multilinestrings, multipoint) why it should remove the lines and points. It could be useful to the client. The fact that the client is capable to understand only point/line and polgons is a problem of the client , not of the geos. If the invoker is not capable to understand collection, but it want do operation that could return collection. The invoker (the client) should increase him matematics capability , not decrease the capability of geos. :) In postgis and spalite is easy manage this kind of situation even if the table is not a collection. With a ExtractFromCollection(ForceToCollection(geometry)..) you can easily to resolve the problem on postgis/spatialite. If this capability is not available in qgis is a problem of qgis not of geos. :) A. 2014-07-05 17:23 GMT+02:00 G. Allegri gioha...@gmail.com: (I changed the topic) Geometry collections in QGIS must be treated at the GEOS level. There isnt a QGIS::wkbType for geometry collections, so if GEOS return a collection they must be managed as GEOS geometries, before moving them up to QgsGeometry. Correct me if I'm wrong. giovanni 2014-07-05 17:17 GMT+02:00 Andrea Peri aperi2...@gmail.com: Thx GioHappy, this is imprtant for me to know. So is surely better to use the postgis or spatialite because it allow you to extract from the collection the section with the right type. If you do a difference beetwen two polygons is the result is a collection with a polygon section and a point section. You should extract the polygon and discard the point. If the strategu is discard all the collection this mean that on qgis the difference could lost domething of important and so potentially the difference do a wrong result. Regards, Andrea. 2014-07-05 16:47 GMT+02:00 G. Allegri gioha...@gmail.com: AFAICS whenever a new feature needs to be created, geom collections are discarded, because QGIS cannot manage them. giovanni 2014-07-05 16:40 GMT+02:00 Andrea Peri aperi2...@gmail.com: Ok, sorry. Just a my personal curiosity: The difference could give also a collection not empty. If the difference of two polygons is a collection with some polygons, some lines and some points. What happened to this collection in QGIS ? Thx, A. 2014-07-05 16:03 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Andrea, as I said above I'm not considering it an error. The topic of this post is QGIS message logging. The processing completes as expected, with the same results as Spatialite and PostGIS. These simply do it silently :) giovanni 2014-07-05 15:59 GMT+02:00 Andrea Peri aperi2...@gmail.com: Hi GioHappy, the empty-collection is absolutelly not necessarylly a bug. It is the obviously result of an operation on a machine (like the computer) with a binary finite arithmetic. Usually the empty is due to a too low value to be describe with a finite binary arithmetic. If the dataset is small or it is topologically correct (this not mean only to be snapped). the collection results never happened. Instead if the dataset is not topologically correct and is big the probability to have some collection result grow. We tipically have alway an 0.01% of collection on our results. I suggest you to use directly postgis or spatialite to do this kind of operations. In these products you have the useful tools to resolve the collections correctly. Regard, Andrea. 2014-07-05 12:40 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Jurgen, I wouldn't call them errors. GEOSDIfference returned a lot of empty geomcollections, which the QgsVectorFileWriter couldn't manage. Consequently it wrote a log message for each geometry it couldn't write [1]. Surely the logging should be improved in this specific case. Anyway, I think the option to turn QgsMessageLog off could be useful anyway... giovanni [1] https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1718 2014-07-05 12:31 GMT+02:00 Jürgen E. j...@norbit.de: Hi Giovanni, On Sat, 05. Jul 2014 at 10:27:24 +0200, G. Allegri wrote: As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time. Debugging pointed me to the problem: QgsVectoFileWriter was logging tons of empty geometres with an incompatible type which will be discarded. After commenting the line of logging the process completed in linear time. Shouldn't we offer the opportunity to turn QgsLogger off? This would let the user/developer to switch it off whenever he already
Re: [Qgis-developer] Geom collection and QGIS (was QgisLogger can be a serious bottleneck)
Well, Andrea, QGIS adopts GEOS capabilities as far as it can. As you will know it doesn't support Z and M geoms as well. I hope future founders will help extending its capabilities... giovanni 2014-07-05 20:10 GMT+02:00 Andrea Peri aperi2...@gmail.com: Is wrong. The geos return a collection when the collectionis the right result. if the result is a collection like: collection (multipolygons, multilinestrings, multipoint) why it should remove the lines and points. It could be useful to the client. The fact that the client is capable to understand only point/line and polgons is a problem of the client , not of the geos. If the invoker is not capable to understand collection, but it want do operation that could return collection. The invoker (the client) should increase him matematics capability , not decrease the capability of geos. :) In postgis and spalite is easy manage this kind of situation even if the table is not a collection. With a ExtractFromCollection(ForceToCollection(geometry)..) you can easily to resolve the problem on postgis/spatialite. If this capability is not available in qgis is a problem of qgis not of geos. :) A. 2014-07-05 17:23 GMT+02:00 G. Allegri gioha...@gmail.com: (I changed the topic) Geometry collections in QGIS must be treated at the GEOS level. There isnt a QGIS::wkbType for geometry collections, so if GEOS return a collection they must be managed as GEOS geometries, before moving them up to QgsGeometry. Correct me if I'm wrong. giovanni 2014-07-05 17:17 GMT+02:00 Andrea Peri aperi2...@gmail.com: Thx GioHappy, this is imprtant for me to know. So is surely better to use the postgis or spatialite because it allow you to extract from the collection the section with the right type. If you do a difference beetwen two polygons is the result is a collection with a polygon section and a point section. You should extract the polygon and discard the point. If the strategu is discard all the collection this mean that on qgis the difference could lost domething of important and so potentially the difference do a wrong result. Regards, Andrea. 2014-07-05 16:47 GMT+02:00 G. Allegri gioha...@gmail.com: AFAICS whenever a new feature needs to be created, geom collections are discarded, because QGIS cannot manage them. giovanni 2014-07-05 16:40 GMT+02:00 Andrea Peri aperi2...@gmail.com: Ok, sorry. Just a my personal curiosity: The difference could give also a collection not empty. If the difference of two polygons is a collection with some polygons, some lines and some points. What happened to this collection in QGIS ? Thx, A. 2014-07-05 16:03 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Andrea, as I said above I'm not considering it an error. The topic of this post is QGIS message logging. The processing completes as expected, with the same results as Spatialite and PostGIS. These simply do it silently :) giovanni 2014-07-05 15:59 GMT+02:00 Andrea Peri aperi2...@gmail.com: Hi GioHappy, the empty-collection is absolutelly not necessarylly a bug. It is the obviously result of an operation on a machine (like the computer) with a binary finite arithmetic. Usually the empty is due to a too low value to be describe with a finite binary arithmetic. If the dataset is small or it is topologically correct (this not mean only to be snapped). the collection results never happened. Instead if the dataset is not topologically correct and is big the probability to have some collection result grow. We tipically have alway an 0.01% of collection on our results. I suggest you to use directly postgis or spatialite to do this kind of operations. In these products you have the useful tools to resolve the collections correctly. Regard, Andrea. 2014-07-05 12:40 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Jurgen, I wouldn't call them errors. GEOSDIfference returned a lot of empty geomcollections, which the QgsVectorFileWriter couldn't manage. Consequently it wrote a log message for each geometry it couldn't write [1]. Surely the logging should be improved in this specific case. Anyway, I think the option to turn QgsMessageLog off could be useful anyway... giovanni [1] https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1718 2014-07-05 12:31 GMT+02:00 Jürgen E. j...@norbit.de: Hi Giovanni, On Sat, 05. Jul 2014 at 10:27:24 +0200, G. Allegri wrote: As I reported in a previous post, I was unable to conclude a difference operation on a vector because the tool was running in exponential time.
Re: [Qgis-developer] RasterFileWriter creates 5 times bigger geotiff then gdal_translate
Sorry for the buzz. It's not QGIS fault, it's GDAL itself which reads the ASCII Grid as Float64, but I wonder why contrarily gdalinfo and gdal_translate treats it as Float32... 2014-07-05 18:56 GMT+02:00 G. Allegri gioha...@gmail.com: I haven't spot tha exact point where this happens but QGIS exports Float64, even if the origin was Float32. giovanni 2014-07-05 16:54 GMT+02:00 G. Allegri gioha...@gmail.com: Causally I hit the save as raster dialog, and I tried to export a raster to layer (coming from an ASCII Grid source) to Geotiff, with no creation options set. The result was a file 3 times bigger then the original ASCII, and 5 times bigger then the Geotiff created by gdal_translate. gdalinfo on the files give same results (except statistics missing from the one created by RasterFileWriter). Does gdal_translate do some optimizations that RFW doesn't? I wasn't aware that two Geotiffs, apparently with the same properties, could be so different in size... giovanni -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus -- Giovanni Allegri http://about.me/giovanniallegri Twitter: https://twitter.com/_giohappy_ blog: http://blog.spaziogis.it GEO+ geomatica in Italia http://bit.ly/GEOplus ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Geom collection and QGIS (was QgisLogger can be a serious bottleneck)
HI, On Sat, Jul 5, 2014 at 12:10 PM, Andrea Peri aperi2...@gmail.com wrote: Is wrong. The geos return a collection when the collectionis the right result. if the result is a collection like: collection (multipolygons, multilinestrings, multipoint) why it should remove the lines and points. It could be useful to the client. The fact that the client is capable to understand only point/line and polgons is a problem of the client , not of the geos. If the invoker is not capable to understand collection, but it want do operation that could return collection. The invoker (the client) should increase him matematics capability , not decrease the capability of geos. :) In postgis and spalite is easy manage this kind of situation even if the table is not a collection. With a ExtractFromCollection(ForceToCollection(geometry)..) you can easily to resolve the problem on postgis/spatialite. I fail to see how Giovanni is 'wrong' here. Unless I am incorrect, he is suggesting that QGIS do exactly the same thing, i.e. implement something like ExtractFromCollection() where needed, when the geometry is converted from GEOS to QgsGeometry. This seems like a very reasonable interim solution until such time that a type of 'collection' can be supported (no small feat, I am guessing). Regards, Larry If this capability is not available in qgis is a problem of qgis not of geos. :) A. 2014-07-05 17:23 GMT+02:00 G. Allegri gioha...@gmail.com: (I changed the topic) Geometry collections in QGIS must be treated at the GEOS level. There isnt a QGIS::wkbType for geometry collections, so if GEOS return a collection they must be managed as GEOS geometries, before moving them up to QgsGeometry. Correct me if I'm wrong. giovanni 2014-07-05 17:17 GMT+02:00 Andrea Peri aperi2...@gmail.com: Thx GioHappy, this is imprtant for me to know. So is surely better to use the postgis or spatialite because it allow you to extract from the collection the section with the right type. If you do a difference beetwen two polygons is the result is a collection with a polygon section and a point section. You should extract the polygon and discard the point. If the strategu is discard all the collection this mean that on qgis the difference could lost domething of important and so potentially the difference do a wrong result. Regards, Andrea. 2014-07-05 16:47 GMT+02:00 G. Allegri gioha...@gmail.com: AFAICS whenever a new feature needs to be created, geom collections are discarded, because QGIS cannot manage them. giovanni 2014-07-05 16:40 GMT+02:00 Andrea Peri aperi2...@gmail.com: Ok, sorry. Just a my personal curiosity: The difference could give also a collection not empty. If the difference of two polygons is a collection with some polygons, some lines and some points. What happened to this collection in QGIS ? Thx, A. 2014-07-05 16:03 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Andrea, as I said above I'm not considering it an error. The topic of this post is QGIS message logging. The processing completes as expected, with the same results as Spatialite and PostGIS. These simply do it silently :) giovanni 2014-07-05 15:59 GMT+02:00 Andrea Peri aperi2...@gmail.com: Hi GioHappy, the empty-collection is absolutelly not necessarylly a bug. It is the obviously result of an operation on a machine (like the computer) with a binary finite arithmetic. Usually the empty is due to a too low value to be describe with a finite binary arithmetic. If the dataset is small or it is topologically correct (this not mean only to be snapped). the collection results never happened. Instead if the dataset is not topologically correct and is big the probability to have some collection result grow. We tipically have alway an 0.01% of collection on our results. I suggest you to use directly postgis or spatialite to do this kind of operations. In these products you have the useful tools to resolve the collections correctly. Regard, Andrea. 2014-07-05 12:40 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Jurgen, I wouldn't call them errors. GEOSDIfference returned a lot of empty geomcollections, which the QgsVectorFileWriter couldn't manage. Consequently it wrote a log message for each geometry it couldn't write [1]. Surely the logging should be improved in this specific case. Anyway, I think the option to turn QgsMessageLog off could be useful anyway... giovanni [1] https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1718 2014-07-05 12:31 GMT+02:00 Jürgen E. j...@norbit.de: Hi Giovanni, On
Re: [Qgis-developer] Geom collection and QGIS (was QgisLogger can be a serious bottleneck)
Hi Larry, probably I don't understand well the concept of at geos level. My english is worsened ultimately. :( I understand that Giovanni say to add some change to geos library , to change the methods or adding some new method in the geos. :) I agree that the solution is to add to qgis the capability to receive a collection and extract a basic type (simple o multi point,line,poly) from it. Regards, A. 2014-07-05 20:52 GMT+02:00 Larry Shaffer lar...@dakotacarto.com: HI, On Sat, Jul 5, 2014 at 12:10 PM, Andrea Peri aperi2...@gmail.com wrote: Is wrong. The geos return a collection when the collectionis the right result. if the result is a collection like: collection (multipolygons, multilinestrings, multipoint) why it should remove the lines and points. It could be useful to the client. The fact that the client is capable to understand only point/line and polgons is a problem of the client , not of the geos. If the invoker is not capable to understand collection, but it want do operation that could return collection. The invoker (the client) should increase him matematics capability , not decrease the capability of geos. :) In postgis and spalite is easy manage this kind of situation even if the table is not a collection. With a ExtractFromCollection(ForceToCollection(geometry)..) you can easily to resolve the problem on postgis/spatialite. I fail to see how Giovanni is 'wrong' here. Unless I am incorrect, he is suggesting that QGIS do exactly the same thing, i.e. implement something like ExtractFromCollection() where needed, when the geometry is converted from GEOS to QgsGeometry. This seems like a very reasonable interim solution until such time that a type of 'collection' can be supported (no small feat, I am guessing). Regards, Larry If this capability is not available in qgis is a problem of qgis not of geos. :) A. 2014-07-05 17:23 GMT+02:00 G. Allegri gioha...@gmail.com: (I changed the topic) Geometry collections in QGIS must be treated at the GEOS level. There isnt a QGIS::wkbType for geometry collections, so if GEOS return a collection they must be managed as GEOS geometries, before moving them up to QgsGeometry. Correct me if I'm wrong. giovanni 2014-07-05 17:17 GMT+02:00 Andrea Peri aperi2...@gmail.com: Thx GioHappy, this is imprtant for me to know. So is surely better to use the postgis or spatialite because it allow you to extract from the collection the section with the right type. If you do a difference beetwen two polygons is the result is a collection with a polygon section and a point section. You should extract the polygon and discard the point. If the strategu is discard all the collection this mean that on qgis the difference could lost domething of important and so potentially the difference do a wrong result. Regards, Andrea. 2014-07-05 16:47 GMT+02:00 G. Allegri gioha...@gmail.com: AFAICS whenever a new feature needs to be created, geom collections are discarded, because QGIS cannot manage them. giovanni 2014-07-05 16:40 GMT+02:00 Andrea Peri aperi2...@gmail.com: Ok, sorry. Just a my personal curiosity: The difference could give also a collection not empty. If the difference of two polygons is a collection with some polygons, some lines and some points. What happened to this collection in QGIS ? Thx, A. 2014-07-05 16:03 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Andrea, as I said above I'm not considering it an error. The topic of this post is QGIS message logging. The processing completes as expected, with the same results as Spatialite and PostGIS. These simply do it silently :) giovanni 2014-07-05 15:59 GMT+02:00 Andrea Peri aperi2...@gmail.com: Hi GioHappy, the empty-collection is absolutelly not necessarylly a bug. It is the obviously result of an operation on a machine (like the computer) with a binary finite arithmetic. Usually the empty is due to a too low value to be describe with a finite binary arithmetic. If the dataset is small or it is topologically correct (this not mean only to be snapped). the collection results never happened. Instead if the dataset is not topologically correct and is big the probability to have some collection result grow. We tipically have alway an 0.01% of collection on our results. I suggest you to use directly postgis or spatialite to do this kind of operations. In these products you have the useful tools to resolve the collections correctly. Regard, Andrea. 2014-07-05 12:40 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Jurgen, I wouldn't call them errors. GEOSDIfference returned a lot of empty geomcollections, which the QgsVectorFileWriter couldn't
Re: [Qgis-developer] Geom collection and QGIS (was QgisLogger can be a serious bottleneck)
You misunderstood me Andrea. I've never said that :) I said that when geometry collections need to be treated within QGIS, you have to work at the GEOS level. giovanni Il 05/lug/2014 21:40 Andrea Peri aperi2...@gmail.com ha scritto: Hi Larry, probably I don't understand well the concept of at geos level. My english is worsened ultimately. :( I understand that Giovanni say to add some change to geos library , to change the methods or adding some new method in the geos. :) I agree that the solution is to add to qgis the capability to receive a collection and extract a basic type (simple o multi point,line,poly) from it. Regards, A. 2014-07-05 20:52 GMT+02:00 Larry Shaffer lar...@dakotacarto.com: HI, On Sat, Jul 5, 2014 at 12:10 PM, Andrea Peri aperi2...@gmail.com wrote: Is wrong. The geos return a collection when the collectionis the right result. if the result is a collection like: collection (multipolygons, multilinestrings, multipoint) why it should remove the lines and points. It could be useful to the client. The fact that the client is capable to understand only point/line and polgons is a problem of the client , not of the geos. If the invoker is not capable to understand collection, but it want do operation that could return collection. The invoker (the client) should increase him matematics capability , not decrease the capability of geos. :) In postgis and spalite is easy manage this kind of situation even if the table is not a collection. With a ExtractFromCollection(ForceToCollection(geometry)..) you can easily to resolve the problem on postgis/spatialite. I fail to see how Giovanni is 'wrong' here. Unless I am incorrect, he is suggesting that QGIS do exactly the same thing, i.e. implement something like ExtractFromCollection() where needed, when the geometry is converted from GEOS to QgsGeometry. This seems like a very reasonable interim solution until such time that a type of 'collection' can be supported (no small feat, I am guessing). Regards, Larry If this capability is not available in qgis is a problem of qgis not of geos. :) A. 2014-07-05 17:23 GMT+02:00 G. Allegri gioha...@gmail.com: (I changed the topic) Geometry collections in QGIS must be treated at the GEOS level. There isnt a QGIS::wkbType for geometry collections, so if GEOS return a collection they must be managed as GEOS geometries, before moving them up to QgsGeometry. Correct me if I'm wrong. giovanni 2014-07-05 17:17 GMT+02:00 Andrea Peri aperi2...@gmail.com: Thx GioHappy, this is imprtant for me to know. So is surely better to use the postgis or spatialite because it allow you to extract from the collection the section with the right type. If you do a difference beetwen two polygons is the result is a collection with a polygon section and a point section. You should extract the polygon and discard the point. If the strategu is discard all the collection this mean that on qgis the difference could lost domething of important and so potentially the difference do a wrong result. Regards, Andrea. 2014-07-05 16:47 GMT+02:00 G. Allegri gioha...@gmail.com: AFAICS whenever a new feature needs to be created, geom collections are discarded, because QGIS cannot manage them. giovanni 2014-07-05 16:40 GMT+02:00 Andrea Peri aperi2...@gmail.com: Ok, sorry. Just a my personal curiosity: The difference could give also a collection not empty. If the difference of two polygons is a collection with some polygons, some lines and some points. What happened to this collection in QGIS ? Thx, A. 2014-07-05 16:03 GMT+02:00 G. Allegri gioha...@gmail.com: Hi Andrea, as I said above I'm not considering it an error. The topic of this post is QGIS message logging. The processing completes as expected, with the same results as Spatialite and PostGIS. These simply do it silently :) giovanni 2014-07-05 15:59 GMT+02:00 Andrea Peri aperi2...@gmail.com: Hi GioHappy, the empty-collection is absolutelly not necessarylly a bug. It is the obviously result of an operation on a machine (like the computer) with a binary finite arithmetic. Usually the empty is due to a too low value to be describe with a finite binary arithmetic. If the dataset is small or it is topologically correct (this not mean only to be snapped). the collection results never happened. Instead if the dataset is not topologically correct and is big the probability to have some collection result grow. We tipically have alway an 0.01% of collection on our results. I suggest you to use directly postgis or spatialite to
Re: [Qgis-developer] SOSI support in QGIS
Hi again. Some of you have said something about opening sosi-files in QGIS. I myselft haven't found any other place than in the file explorer, but opening from there i get the error message. I have tried to look in the toolbox for gdal but havnet found anything there for sosi. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/SOSI-support-in-QGIS-tp5148046p5149791.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 standalone app - layer tree, legend and co.
Matthias, have a look at the Layer list widget for PyQGIS applications [1], perhaps it could fit your needs. Not sure if it works on recent QGIS versions, though. Regards, Germán - [1] http://geotux.tuxfamily.org/index.php/en/component/k2/item/270-tabla-de-contenido-leyenda-para-aplicaciones-basadas-en-pyqgis/ 2014-07-04 10:07 GMT-05:00 Martin Dobias wonder...@gmail.com: Hi Matthias On Wed, Jul 2, 2014 at 4:17 PM, Matthias Ludwig kaot...@gmx.de wrote: 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. QgisInterface and QgsLegendInterface will not work if you are developing a standalone application. As Andreas suggested, if you base your application on QGIS 2.4, you can use new layer tree classes: QgsLayerTreeView + QgsLayerTreeModel for Qt model/view and QgsLayerTreeGroup + QgsLayerTreeLayer classes for the actual hierarchy that will be used by the model and view classes. There is some doxygen documentation in the header files, but I am in the process of preparing some blog posts about the new classes... stay tuned! Regards Martin ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- --- |\__ (:__)( |/ Soluciones Geoinformáticas Libres http://geotux.tuxfamily.org/ http://twitter.com/GeoTux2 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] SOSI support in QGIS
Am 05.07.2014 23:40, schrieb klausenlie: Hi again. Some of you have said something about opening sosi-files in QGIS. I myselft haven't found any other place than in the file explorer, but opening from there i get the error message. I have tried to look in the toolbox for gdal but havnet found anything there for sosi. The GDAL mentioned is only available if you use the OSGEO4W Shell icon. It is a command line application. Typing ogrinfo --formats lists all available vector data formats. You will find SOSI there if it is correctly installed. The list is not sorted alphabetically. If SOSI is listed, you can transform the file into other formats using ogr2ogr. HTH, André Jooost ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer