<div>Hi</div><div><br></div><div>let me share some thoughts...</div><br><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 21, 2012 at 3:34 PM, Mihis <span dir="ltr"><<a href="mailto:mihis.sakh@gmail.com" target="_blank">mihis.sakh@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Marco Hugentobler-4 wrote<br>
<div class="im">> I don't know if AGG would be faster than the Qt raster paint engine and<br>
> how much. It would be very interesting to have the comparison AGG <-> Qt<br>
> raster engine (and maybe libcairo as well).<br>
><br>
> With AGG / cairo, the approach would be to create a new Qt paint engine<br>
> based on these libs (rather than changing the code in qgis core to be Qt<br>
> free). If someone knows of an AGG paint engine implementation or likes<br>
> to create one, that would be very interesting.<br>
<br>
</div>There is point of view (which I consider to be right) that implementation of<br>
traditional<br>
painting engine (like one in Qt, Cairo, GDI+) with one large Painter class<br>
on the top of<br>
AGG is totally inefficient because of the template architecture of this<br>
library. Maybe much<br>
more efficient approach will be implementation of light weighted wrapper of<br>
AGG, which will<br>
look like a system of classes for optimized rendering of spatial data.<br></blockquote><div><br></div><div>It's hard to discuss AGG vs Qt rendering performance without benchmarks on real data. As far as I know, Qt has fairly optimized rendering, see:</div>
<div><br></div><div><a href="http://blog.qt.digia.com/blog/2009/12/18/qt-graphics-and-performance-the-raster-engine/">http://blog.qt.digia.com/blog/2009/12/18/qt-graphics-and-performance-the-raster-engine/</a><br></div><div>
<a href="http://doc.qt.digia.com/qt/qpainter.html">http://doc.qt.digia.com/qt/qpainter.html</a>š- Performance section<br></div><div><br></div><div><br></div><div>š</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

However the absolute majority<br>
of cases when you need really fast spatial data rendering is when you need<br>
to display set of<br>
large vector layers like rivers, lakes, elevation contours, coastline and so<br>
on. Such kind of features<br>
in cartography are expected to be displayed on the map by identical graphics<br>
symbols (lines of the same width and color, polygons withe same outline and<br>
the same fill color and so on).<br>
In such situation the most efficient approach is to minimize the number of<br>
calls of rasterisation<br>
algorithm (rasterize all identical graphics symbols at a time). This<br>
definitely can be easily implemented<br>
with the help of AGG. And what about Qt? I can mistake but it seems to me<br>
that such classes<br>
as QPainter are often hardcoded things (Cairo's painter class is hardcoded).<br>
So does Qt painting engine<br>
have enough potential for optimized usage to be used for efficient spatial<br>
data rendering?<br></blockquote><div><br></div><div>Qt has modular painting system, so you could try give it a try and implement a paint engine based on AGG, but I do not believe that would make a difference - there are other areas that need more attention.</div>
<div><br></div><div>š</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
However in my opinion (but I may mistake) rendering of spatial data is not<br>
the main issue<br>
in the terms of QGIS performance problem. It seems that main problem lies in<br>
usage of GDAL/OGR,<br>
which tendency to support great number of vector and raster data formats may<br>
have negative influence<br>
on its performance. Of course, it's possible to give users opportunity to<br>
switch to another memory usage model (store all data in memory), furthermore<br>
as I know QGIS Engine already has implementation of such technique for<br>
vector data (QgsMemoryProvider). That will lead to significant improvement<br>
of performance,<br>
but in my opinion to make QGIS be competitive with proprietary GIS systems,<br>
fast spatial data rendering system with efficient memory usage should be<br>
implemented. So, are there any ideas about implementation of own QGIS<br>
spatial data formats, or other possible ways to speed up process of reading<br>
data from files?<br></blockquote><div><br></div><div>Currently I see the greatest bottleneck in access to data. First of all, we do not have in-memory caching, so the data are fetched from data source everytime we render a map. Efficiency of GDAL/OGR could also be improved in some cases, but it really depends on what data format you are going to use. Apart from GDAL/OGR, QGIS has native data providers for PostGIS, SpatiaLite and other sources which is supposed to give us more flexibility, faster access and better control since there is one layer less.</div>
<div><br></div><div>I have been measuring the performance of vector layer rendering some time ago and it varies greatly on three levels:<br></div><div>- data source type (shapefile / database layer / ...)</div><div>- layer type (geometry type, number of vertices per geometry, number of attributes, ...)</div>
<div>- renderer type (using attributes? antialiasing? thick lines?)</div><div><br></div><div><div>Of course there are some areas worth improving also in QGIS to lower the amount of time spent in QGIS libraries while rendering and to make life easier to the rendering engine (e.g. simplify polygons with lots of vertices before rendering them).</div>
</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I apologize in advance for my posts, because they may sound like criticism<br>
of QGIS. Indeed I haven't used QGIS much. I work in commercial company,<br>
which is planning to build its own GIS system only for internal work. The<br>
key problem is that this system must be able to work fast with really large<br>
raster and vector files. My boss doesn't want the system to be created from<br>
scratch, he wants me to use some open source GIS platform. That's why I am<br>
very interested in the real temps of QGIS Engine development, who and how<br>
many developers really work on these problems? I also have investigated<br>
situation around more fast gvSIG, but it is Java-based and unlike QGIS seems<br>
not to have API for development of standalone GIS applications.<br></blockquote><div><br></div><div>Building an own GIS system on top of QGIS is something that is perfectly possible and may result in fruitful cooperation: your company can save large amount of money that would be spent on initial development and may focus just to specific areas important for your company.</div>
<div><br></div><div>š</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Also I would not pay attention for QGIS performance problems if I hadn't<br>
keep in mind an example of one university experimental GIS development<br>
project. It resulted in the development by one person of simple GIS<br>
application with own vector data format and AGG based rendering, without<br>
some complex systems of data caching or tricky techniques of reading data<br>
from files, without thread support, built with old Borland ó++ compiler.<br>
Some time ago I tested it and was really surprised to find that it worked a<br>
bit slower the multithreaded gvSIG and much faster then QGIS.<br></blockquote><div><br></div><div>We would be very happy to see any patches that would improve the performance :-)</div><div>š</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
I apologize for my post again, I have no aim to criticize QGIS. I believe it<br>
to have great potential in improving of performance. I am only trying to<br>
investigate the real situation. Are there real detailed<br>
plans for improvement of QGIS Engine?</blockquote><div><br></div><div><div>I'm currently working on getting some changes in libraries done in preparation for version 2.0 which hopefully will bring also rendering in threads (I have worked on that during GSoC 2010, but did not get it merged). See my reports from GSoC:<br>
</div><div><br></div><div><a href="http://hub.qgis.org/wiki/quantum-gis/QGIS_on_steroids_GSoC_2010">http://hub.qgis.org/wiki/quantum-gis/QGIS_on_steroids_GSoC_2010</a><br></div></div><div><br></div><div>Otherwise, there are no detailed plans for improvements of rendering speed - I encourage you to give QGIS a try, evaluate where the speed is lacking your needs and tell us your findings - you could even find some sponsors willing to invest money into some performance improvements (or share the development costs)!</div>
<div>š</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> And what are the real opportunities of<br>
QGIS community to implement these plans in program codes?<br></blockquote><div><br></div><div>Of course everyone is welcome to suggest improvements and provide patches, so there are lots of opportunities. QGIS core team is receptive to patches from other community members. When starting a greater development that should be merged to QGIS source code, it is a good idea to let the team know - we can help with design decisions and it also lowers the probability that more people work independently on the same thing.</div>
<div><br></div><div>Regards</div><div>Martin</div><div><br></div></div></div>