Hello Oliver,

Very nice speedup !

$ sudo apt-get install libgeos-dev
$ virtualenv --no-site-packages venv
$ venv/bin/pip install Shapely
$ venv/bin/pip install http://bogosoft.com/misc/shapely_speedups-0.1dev.tar.gz
$ venv/bin/python
>>> from timeit import Timer
>>> Timer('line = LineString([(x, x+1) for x in xrange(1000)])', 'from 
>>> shapely.geometry import LineString').timeit(1000)
15.625654935836792
>>> Timer('line = LineString([(x, x+1) for x in xrange(1000)])', 'import 
>>> shapely_speedups; shapely_speedups.patch_shapely(); from shapely.geometry 
>>> import LineString').timeit(1000)
0.67491698265075684

python 2.6.5 on ubuntu.

Regards,

fredj


On Mon, Feb 7, 2011 at 1:51 PM, Oliver Tonnhofer <[email protected]> wrote:
> Hi Shapely-Users,
>
> I wrote some speedups for Shapely. It improves the creation of new 
> geometries, e.g. LineString([(x0, y0), (x1, y1)]).
> The speedup depends on the number of coordinates. It goes from 2x for two 
> point linestrings to up to 100x for geometries with thousand or more points 
> and to up to 200x when creating from numpy arrays.
>
> The code and a small readme is at: https://github.com/olt/shapely_speedups
>
> I also made a package and it should be installable with easy_install or pip
> pip install http://bogosoft.com/misc/shapely_speedups-0.1dev.tar.gz
>
> You should try it out if you are dealing with lots of geometries and give me 
> some feedback. Sean and I want to include the speedups into Shapely, if it 
> works well for everyone.
>
> Regards,
> Oliver
>
>
> _______________________________________________
> Community mailing list
> [email protected]
> http://lists.gispython.org/mailman/listinfo/community
>



-- 
Frédéric Junod
Camptocamp SA
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to