Hi Mike, Matthias,

We could rewrite the affinity module as a C extension using Cython like in
shapely/speedups/_speedups.pyx. It would certainly be faster.

Can one of you create an issue at
https://github.com/Toblerity/Shapely/issues if you're seriously interested?


On Thu, Dec 5, 2013 at 1:00 PM, Mike Toews <mwto...@gmail.com> wrote:

> Hi Matthias,
>
> The bottleneck is due to reading coordinates from a geometry, doing
> the transform on each vertex/point, then re-creating a new geometry.
> This is done in Python.
>
> A faster approach would be to do an in-place geometry edit, where the
> coordinate sequences are modified without requiring the geometry to be
> re-created. One way to do this is to implement this with GEOS, but
> that development won't happen quickly or easily (requires lots of C++
> and C-API patching).
>
> There might be a way to use the existing GEOSGeom_getCoordSeq then
> GEOSCoordSeq_setX/Y/Z to modify coordinates of geometries in-place. I
> have no idea if this could work, or if it would be faster.
>
> -Mike
>
> On 4 December 2013 03:07, Matthias Blaicher <matth...@blaicher.com> wrote:
> > Hello,
> >
> > I'm currently using Shapely for optical computer chip design and the
> > first prototypes work great. The only thing I am not satisfied with is
> > the speed. I first assumed this to be caused by all the geometry
> > operations I do, but after profiling it looks like most of the time is
> > spent doing simple affine transformations, especially in
> affine_transform.
> >
> > Is this just my own impression or is it a known area which needs
> > performance improvements?
> >
> > Best,
> > Matthias
> > _______________________________________________
> > Community mailing list
> > Community@lists.gispython.org
> > http://lists.gispython.org/mailman/listinfo/community
> _______________________________________________
> Community mailing list
> Community@lists.gispython.org
> http://lists.gispython.org/mailman/listinfo/community
>



-- 
Sean Gillies
_______________________________________________
Community mailing list
Community@lists.gispython.org
http://lists.gispython.org/mailman/listinfo/community

Reply via email to