<div dir="ltr">Well, Andrea, QGIS adopts GEOS capabilities as far as it can.<div>As you will know it doesn't support Z and M geoms as well.</div><div>I hope future founders will help extending its capabilities...</div>
<div><br></div><div>giovanni</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-05 20:10 GMT+02:00 Andrea Peri <span dir="ltr"><<a href="mailto:aperi2007@gmail.com" target="_blank">aperi2007@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is wrong.<br>
The geos return a collection when the collectionis the right result.<br>
<br>
if the result is a collection like:<br>
collection (multipolygons, multilinestrings, multipoint)<br>
<br>
why it should remove the lines and points.<br>
<br>
It could be useful to the client.<br>
The fact that the client is capable to understand only point/line and<br>
polgons is a problem of the client , not of the geos.<br>
<br>
If the invoker is not capable to understand collection, but it want do<br>
operation that could return collection.<br>
The invoker (the client) should increase him matematics capability ,<br>
not decrease the capability of geos.<br>
:)<br>
<br>
In postgis and spalite is easy manage this kind of situation even if<br>
the table is not a collection.<br>
<br>
With a  "ExtractFromCollection(ForceToCollection(geometry)..)"<br>
you can easily to resolve the problem on postgis/spatialite.<br>
<br>
If this capability is not available in qgis is a problem of qgis not of geos.<br>
<br>
:)<br>
<br>
A.<br>
<br>
<br>
2014-07-05 17:23 GMT+02:00 G. Allegri <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> (I changed the topic)<br>
><br>
> Geometry collections in QGIS must be treated at the GEOS level.<br>
> There isnt a QGIS::wkbType for geometry collections, so if GEOS return a<br>
> collection they must be managed as GEOS geometries, before "moving them up"<br>
> to QgsGeometry.<br>
><br>
> Correct me if I'm wrong.<br>
><br>
> giovanni<br>
><br>
><br>
> 2014-07-05 17:17 GMT+02:00 Andrea Peri <<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a>>:<br>
>><br>
>> Thx GioHappy, this is imprtant for me to know.<br>
>><br>
>> So is surely better to use the postgis or spatialite<br>
>> because it allow you to extract from the collection the section with<br>
>> the right type.<br>
>><br>
>> If you do a difference beetwen two polygons is the result is a<br>
>> collection with a polygon section and a point section.<br>
>> You should extract the polygon and discard the point.<br>
>> If the strategu is discard all the collection this mean that on qgis<br>
>> the difference could lost domething of important and so potentially<br>
>> the difference do a wrong result.<br>
>><br>
>> Regards,<br>
>> Andrea.<br>
>><br>
>><br>
>> 2014-07-05 16:47 GMT+02:00 G. Allegri <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>>:<br>
>> > AFAICS whenever a new feature needs to be created, geom collections are<br>
>> > discarded, because QGIS cannot manage them.<br>
>> ><br>
>> > giovanni<br>
>> ><br>
>> ><br>
>> > 2014-07-05 16:40 GMT+02:00 Andrea Peri <<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a>>:<br>
>> ><br>
>> >> Ok, sorry.<br>
>> >><br>
>> >> Just a my personal curiosity:<br>
>> >> The difference could give also a collection not empty.<br>
>> >> If the difference of two polygons is a collection with some polygons,<br>
>> >> some lines and some points.<br>
>> >> What happened to this collection in QGIS ?<br>
>> >><br>
>> >> Thx,<br>
>> >> A.<br>
>> >><br>
>> >><br>
>> >> 2014-07-05 16:03 GMT+02:00 G. Allegri <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>>:<br>
>> >> > Hi Andrea, as I said above I'm not considering it an error.<br>
>> >> > The topic of this post is QGIS message logging.<br>
>> >> > The processing completes as expected, with the same results as<br>
>> >> > Spatialite<br>
>> >> > and PostGIS. These simply do it silently :)<br>
>> >> ><br>
>> >> > giovanni<br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > 2014-07-05 15:59 GMT+02:00 Andrea Peri <<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a>>:<br>
>> >> ><br>
>> >> >> Hi GioHappy,<br>
>> >> >><br>
>> >> >> the empty-collection is absolutelly not necessarylly a bug.<br>
>> >> >> It is the obviously result of an operation on a machine (like the<br>
>> >> >> computer) with a binary finite arithmetic.<br>
>> >> >><br>
>> >> >> Usually the empty is due to a too low value to be describe with a<br>
>> >> >> finite binary arithmetic.<br>
>> >> >><br>
>> >> >> If the dataset is small or it is topologically correct (this not<br>
>> >> >> mean<br>
>> >> >> only to be snapped).<br>
>> >> >>  the collection results never happened.<br>
>> >> >> Instead if the dataset is not topologically correct and is big the<br>
>> >> >> probability to have some collection result grow.<br>
>> >> >> We tipically have alway an 0.01% of collection on our results.<br>
>> >> >><br>
>> >> >> I suggest you to use directly postgis or spatialite to do this kind<br>
>> >> >> of<br>
>> >> >> operations.<br>
>> >> >><br>
>> >> >> In these products you have the useful tools to resolve the<br>
>> >> >> collections<br>
>> >> >> correctly.<br>
>> >> >><br>
>> >> >> Regard,<br>
>> >> >><br>
>> >> >> Andrea.<br>
>> >> >><br>
>> >> >><br>
>> >> >> 2014-07-05 12:40 GMT+02:00 G. Allegri <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>>:<br>
>> >> >> > Hi Jurgen,<br>
>> >> >> > I wouldn't call them errors. GEOSDIfference returned a lot of<br>
>> >> >> > empty<br>
>> >> >> > geomcollections, which the QgsVectorFileWriter couldn't manage.<br>
>> >> >> > Consequently<br>
>> >> >> > it wrote a log message for each geometry it couldn't write [1].<br>
>> >> >> ><br>
>> >> >> > Surely the logging should be improved in this specific case.<br>
>> >> >> > Anyway,<br>
>> >> >> > I<br>
>> >> >> > think<br>
>> >> >> > the option to turn QgsMessageLog off could be useful anyway...<br>
>> >> >> ><br>
>> >> >> > giovanni<br>
>> >> >> ><br>
>> >> >> > [1]<br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> > <a href="https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1718" target="_blank">https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1718</a><br>

>> >> >> ><br>
>> >> >> ><br>
>> >> >> > 2014-07-05 12:31 GMT+02:00 Jürgen E. <<a href="mailto:jef@norbit.de">jef@norbit.de</a>>:<br>
>> >> >> ><br>
>> >> >> >> Hi Giovanni,<br>
>> >> >> >><br>
>> >> >> >> On Sat, 05. Jul 2014 at 10:27:24 +0200, G. Allegri wrote:<br>
>> >> >> >> > As I reported in a previous post, I was unable to conclude a<br>
>> >> >> >> > difference<br>
>> >> >> >> > operation on a vector because the tool was running in<br>
>> >> >> >> > exponential<br>
>> >> >> >> > time.<br>
>> >> >> >><br>
>> >> >> >> > Debugging pointed me to the problem: QgsVectoFileWriter was<br>
>> >> >> >> > logging<br>
>> >> >> >> > tons<br>
>> >> >> >> > of<br>
>> >> >> >> > empty geometres with an incompatible type which will be<br>
>> >> >> >> > discarded.<br>
>> >> >> >> > After commenting the line of logging the process completed in<br>
>> >> >> >> > linear<br>
>> >> >> >> > time.<br>
>> >> >> >><br>
>> >> >> >> > Shouldn't we offer the opportunity to turn QgsLogger off? This<br>
>> >> >> >> > would<br>
>> >> >> >> > let<br>
>> >> >> >> > the user/developer to switch it off whenever he already knows<br>
>> >> >> >> > what's<br>
>> >> >> >> > happening.<br>
>> >> >> >> > Is it already there and I missed it?<br>
>> >> >> >><br>
>> >> >> >> What error message did you get and wouldn't it be better to kill<br>
>> >> >> >> them<br>
>> >> >> >> where it<br>
>> >> >> >> origins or to issue a final "%n empty geometries skipped" instead<br>
>> >> >> >> of<br>
>> >> >> >> logging<br>
>> >> >> >> individual errors.<br>
>> >> >> >><br>
>> >> >> >> Alternatively we could issue a "last message repeated %n times"<br>
>> >> >> >> in<br>
>> >> >> >> message<br>
>> >> >> >> log<br>
>> >> >> >> to make it behave better - although that only works the error<br>
>> >> >> >> message<br>
>> >> >> >> are<br>
>> >> >> >> identical.<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> Jürgen<br>
>> >> >> >><br>
>> >> >> >> --<br>
>> >> >> >> Jürgen E. Fischer           norBIT GmbH             Tel.<br>
>> >> >> >> +49-4931-918175-31<br>
>> >> >> >> Dipl.-Inf. (FH)             Rheinstraße 13          Fax.<br>
>> >> >> >> +49-4931-918175-50<br>
>> >> >> >> Software Engineer           D-26506 Norden<br>
>> >> >> >> <a href="http://www.norbit.de" target="_blank">http://www.norbit.de</a><br>
>> >> >> >> QGIS release manager (PSC)  Germany                    IRC: jef<br>
>> >> >> >> on<br>
>> >> >> >> FreeNode<br>
>> >> >> >><br>
>> >> >> >> --<br>
>> >> >> >> norBIT Gesellschaft fuer Unternehmensberatung und<br>
>> >> >> >> Informationssysteme<br>
>> >> >> >> mbH<br>
>> >> >> >> Rheinstrasse 13, 26506 Norden<br>
>> >> >> >> GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502<br>
>> >> >> >><br>
>> >> >> >> _______________________________________________<br>
>> >> >> >> Qgis-developer mailing list<br>
>> >> >> >> <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
>> >> >> >> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> > --<br>
>> >> >> > Giovanni Allegri<br>
>> >> >> > <a href="http://about.me/giovanniallegri" target="_blank">http://about.me/giovanniallegri</a><br>
>> >> >> > Twitter: <a href="https://twitter.com/_giohappy_" target="_blank">https://twitter.com/_giohappy_</a><br>
>> >> >> > blog: <a href="http://blog.spaziogis.it" target="_blank">http://blog.spaziogis.it</a><br>
>> >> >> > GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank">http://bit.ly/GEOplus</a><br>
>> >> >> ><br>
>> >> >> > _______________________________________________<br>
>> >> >> > Qgis-developer mailing list<br>
>> >> >> > <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
>> >> >> > <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>> >> >><br>
>> >> >><br>
>> >> >><br>
>> >> >> --<br>
>> >> >> -----------------<br>
>> >> >> Andrea Peri<br>
>> >> >> . . . . . . . . .<br>
>> >> >> qwerty àèìòù<br>
>> >> >> -----------------<br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > --<br>
>> >> > Giovanni Allegri<br>
>> >> > <a href="http://about.me/giovanniallegri" target="_blank">http://about.me/giovanniallegri</a><br>
>> >> > Twitter: <a href="https://twitter.com/_giohappy_" target="_blank">https://twitter.com/_giohappy_</a><br>
>> >> > blog: <a href="http://blog.spaziogis.it" target="_blank">http://blog.spaziogis.it</a><br>
>> >> > GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank">http://bit.ly/GEOplus</a><br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> -----------------<br>
>> >> Andrea Peri<br>
>> >> . . . . . . . . .<br>
>> >> qwerty àèìòù<br>
>> >> -----------------<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Giovanni Allegri<br>
>> > <a href="http://about.me/giovanniallegri" target="_blank">http://about.me/giovanniallegri</a><br>
>> > Twitter: <a href="https://twitter.com/_giohappy_" target="_blank">https://twitter.com/_giohappy_</a><br>
>> > blog: <a href="http://blog.spaziogis.it" target="_blank">http://blog.spaziogis.it</a><br>
>> > GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank">http://bit.ly/GEOplus</a><br>
>><br>
>><br>
>><br>
>> --<br>
>> -----------------<br>
>> Andrea Peri<br>
>> . . . . . . . . .<br>
>> qwerty àèìòù<br>
>> -----------------<br>
><br>
><br>
><br>
><br>
> --<br>
> Giovanni Allegri<br>
> <a href="http://about.me/giovanniallegri" target="_blank">http://about.me/giovanniallegri</a><br>
> Twitter: <a href="https://twitter.com/_giohappy_" target="_blank">https://twitter.com/_giohappy_</a><br>
> blog: <a href="http://blog.spaziogis.it" target="_blank">http://blog.spaziogis.it</a><br>
> GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank">http://bit.ly/GEOplus</a><br>
<br>
<br>
<br>
--<br>
-----------------<br>
Andrea Peri<br>
. . . . . . . . .<br>
qwerty àèìòù<br>
-----------------<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Giovanni Allegri<br><a href="http://about.me/giovanniallegri" target="_blank">http://about.me/giovanniallegri</a><div>Twitter: <a href="https://twitter.com/_giohappy_" target="_blank">https://twitter.com/_giohappy_</a></div>
<div>blog: <a href="http://blog.spaziogis.it" target="_blank">http://blog.spaziogis.it</a><br>GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank">http://bit.ly/GEOplus</a></div></div>
</div>