[Qgis-developer] QgsGeometry

Martin Dobias wonder.sk at gmail.com
Sat Sep 8 11:19:32 EDT 2007


On 9/8/07, Marco Hugentobler <marco.hugentobler at karto.baug.ethz.ch> wrote:
> Dear qgis devs,
>
> I'm currently doing some development in the geometry class (in the advanced
> editing branch). qgsgeometry.cpp now has about 5000 lines of code. Clearly
> too much for one class.
> I therefore plan to move some code that modifies the current geometry to other
> classes. For instance there could be a class 'QgsSplitGeometry' which has a
> pointer to a geometry object and a method that splits this geometry using the
> interface methods fromPolyline(), asPolyline(), etc. Like this, we could move
> much code away from qgsgeometry.cpp. The interface methods make copies of the
> geometry, but I think that this is no problem for manipulation methods, which
> are not performance critical. And the fromPolyline(), asPolyline(),...
> methods provide a proper interface that separates manipulation code from
> internal geometry representation (which is wkb).

Hi Marco,

you're right, that class is really HUGE and hard to maintain. My big
wish about it is to stop completely doing the operations on geometries
with WKB and start fully using GEOS for geometry manipulations. It
will not only make the code much smaller, it will be also less
volnurable to bugs and with the same performance (I guess we can trust
GEOS devs that the library is efficient). In my opinion, we should
only support WKB import and export, but represent the geometries as a
GEOS geometry. If the class would be still too huge, I'm for splitting
it into some smaller ones.

What do you think?

Martin

P.S. I'm still without a proper internet connection, so my replies
might take longer time :-/



More information about the Qgis-developer mailing list