[Qgis-developer] Geom collection and QGIS (was QgisLogger can be a serious bottleneck)

Andrea Peri aperi2007 at gmail.com
Sat Jul 5 12:40:51 PDT 2014


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 <larrys at dakotacarto.com>:
> HI,
>
>
> On Sat, Jul 5, 2014 at 12:10 PM, Andrea Peri <aperi2007 at 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 <giohappy at 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 <aperi2007 at 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 <giohappy at 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 <aperi2007 at 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 <giohappy at 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 <aperi2007 at 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 <giohappy at 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. <jef at 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)  Germany                    IRC:
>> >> >> >> >> 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 at 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 at 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
>> >>
>> >>
>> >>
>> >> --
>> >> -----------------
>> >> 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 àèìòù
>> -----------------
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>



-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------


More information about the Qgis-developer mailing list