<p dir="ltr">You misunderstood me Andrea. I've never said that :) <br>
I said that when geometry collections need to be treated within QGIS, you have to work at the GEOS level. </p>
<p dir="ltr">giovanni</p>
<div class="gmail_quote">Il 05/lug/2014 21:40 "Andrea Peri" <<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Larry,<br>
<br>
probably I don't understand well the concept of "at geos level".<br>
<br>
My english is worsened ultimately.<br>
:(<br>
<br>
<br>
I understand that Giovanni say to add some change to geos library , to<br>
change the methods or adding some new method in the geos.<br>
:)<br>
<br>
I agree that the solution is to add to qgis the capability to receive<br>
a collection and extract a basic type (simple o multi<br>
point,line,poly) from it.<br>
<br>
Regards,<br>
<br>
A.<br>
<br>
<br>
<br>
2014-07-05 20:52 GMT+02:00 Larry Shaffer <<a href="mailto:larrys@dakotacarto.com">larrys@dakotacarto.com</a>>:<br>
> HI,<br>
><br>
><br>
> On Sat, Jul 5, 2014 at 12:10 PM, Andrea Peri <<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a>> wrote:<br>
>><br>
>> 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>
><br>
><br>
> I fail to see how Giovanni is 'wrong' here. Unless I am incorrect, he is<br>
> suggesting that QGIS do exactly the same thing, i.e. implement something<br>
> like ExtractFromCollection() where needed, when the geometry is converted<br>
> from GEOS to QgsGeometry.<br>
><br>
> This seems like a very reasonable interim solution until such time that a<br>
> type of 'collection' can be supported (no small feat, I am guessing).<br>
><br>
><br>
> Regards,<br>
><br>
> Larry<br>
><br>
><br>
>><br>
>><br>
>> If this capability is not available in qgis is a problem of qgis not of<br>
>> 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>
>> > (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<br>
>> > 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<br>
>> >> > 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<br>
>> >> >> 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<br>
>> >> >> >> 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<br>
>> >> >> >> 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>
>> >> >> >> ><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<br>
>> >> >> >> >> > in<br>
>> >> >> >> >> > linear<br>
>> >> >> >> >> > time.<br>
>> >> >> >> >><br>
>> >> >> >> >> > Shouldn't we offer the opportunity to turn QgsLogger off?<br>
>> >> >> >> >> > This<br>
>> >> >> >> >> > would<br>
>> >> >> >> >> > let<br>
>> >> >> >> >> > the user/developer to switch it off whenever he already<br>
>> >> >> >> >> > 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<br>
>> >> >> >> >> kill<br>
>> >> >> >> >> them<br>
>> >> >> >> >> where it<br>
>> >> >> >> >> origins or to issue a final "%n empty geometries skipped"<br>
>> >> >> >> >> instead<br>
>> >> >> >> >> of<br>
>> >> >> >> >> logging<br>
>> >> >> >> >> individual errors.<br>
>> >> >> >> >><br>
>> >> >> >> >> Alternatively we could issue a "last message repeated %n<br>
>> >> >> >> >> 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:<br>
>> >> >> >> >> 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>
>> _______________________________________________<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>
--<br>
-----------------<br>
Andrea Peri<br>
. . . . . . . . .<br>
qwerty àèìòù<br>
-----------------<br>
</blockquote></div>