Oliver, Kyle,

In Novemeber, I tried a little GEOS hacking to see if I could implement a
coordinate sequence based on Python arrays. The concept: a Shapely geometric
object's coordinate sequence would simply be an instance of array.array, and
GEOS code would get at these values through a new coordinate sequence and
the Python 2.6-3.0 buffer object API. I think this solution would be
effective and fast, but I don't have the time or C++ chops to pull it off
right now. Maybe one of you do, or maybe we should consider pooling
financial resources to hire a GEOS programmer like Sandro or Mateusz to do
it.

http://docs.python.org/release/2.6.5/c-api/buffer.html#bufferobjects

On Jan 27, 2011 3:22 AM, "Kyle Cronan" <[email protected]> wrote:

On Thu, Jan 27, 2011 at 2:29 AM, Oliver Tonnhofer <[email protected]> wrote:
> my observations are th...
I ended up spending a lot of time doing string joins.  However you got
me going on the right track!  I ended up getting about a 10%
improvement with this code that uses WKB instead:

header = '\x01\x03\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00%s'
poly = wkb.loads(header % (struct.pack('8d', point_data),))

Since this is at least forward-compatible, I think I'll stick with it
and call the modest speed improvement good enough.

-Kyle

_______________________________________________
Community mailing list
[email protected]...
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to