> Is it only to_wkt() that produces an access violation? Are you able to evaluate the area?
to_wkb() also produces the same error although the .area and .length attributes of the object return sensible values. > Could it be the sheer size of the output? Investigating this I think it is the case that the size of the output is causing the problems. The cascaded join, and subsequent return of the wkt string, is being performed inside a wx program and memory usage is at a premium. When I reduced the number of points being processed, it resulted in a shapely object that was able to return its wkt or wkb string. In addition I tested this process outside of the wx program, on the large data set, and it returned the wkt and wkb strings. I think you were correct when you said that the problem is coming from GEOS not checking if the allocation of memory for the WKT string fails. My solution has been to increase the size of the square that has been buffered around each point. This causes more of the polygons to union, thus reducing the complexity of the joined multi polygon and hence the final wkt string. Thanks again for you assistance Darren -----Original Message----- From: community-boun...@lists.gispython.org [mailto:community-boun...@lists.gispython.org] On Behalf Of Sean Gillies Sent: Tuesday, 10 August 2010 2:09 AM To: gispython.org community projects Subject: Re: [Community] Access Violation Error when using to_wkt method I'm not a Windows user these days and unable able to reproduce your issue, but I'll help you as much as I can and try to pull the Windows packager into the discussion. Is it only to_wkt() that produces an access violation? Are you able to evaluate the area? Could it be the sheer size of the output? Your WKT string could be around 1 GB: 6 million squares x 4 corners x 50 bytes per corner (approx). Howard Butler just pointed out to me that the GEOS (the C lib under Shapely) isn't checking whether allocation of memory for the WKT value succeeds. If you're low on memory, it might fail without notice and leave a null pointer. On Sun, Aug 8, 2010 at 7:18 PM, Darren Waters <dar...@omc-international.com> wrote: > Hi Sean, > > Thanks for your reply. My version of Shapely came from the link on > http://trac.gispython.org/lab/wiki/Shapely. My version of python is > 2.5.2 and was from python.org. Also, when I referred to a large set > of point data, I am talking of the order of 6 million points that I am > performing the cascaded union on. > > Thanks in advance for any advice that you can give me. > > Cheers > Darren > > > -----Original Message----- > From: community-boun...@lists.gispython.org > [mailto:community-boun...@lists.gispython.org] On Behalf Of Sean > Gillies > Sent: Saturday, 7 August 2010 1:35 PM > To: gispython.org community projects > Subject: Re: [Community] Access Violation Error when using to_wkt > method > > On Wed, Aug 4, 2010 at 12:02 AM, Darren Waters > <dar...@omc-international.com> wrote: >> Hi All, >> >> I am using shapely 1.2.2 (python 2.5 on a Windows system) to generate >> a coverage polygon for a large set of point data. To achieve this I >> am producing a series of square polygons (buffered around each point) >> and then using a cascaded_union to join overlapping geometries to >> yield a multipolygon object. Unfortunately, when I try and output >> this geometry to a well known text representation, using the to_wkt() >> method, I get an error >> (*** WindowsError: exception: access violation reading 0x00000000). >> Has anyone else experienced this problem and can anyone suggest a > solution. >> This problem seems like it may be related to an issue discussed on >> the geos-devel list >> (http://www.mail-archive.com/geos-de...@lists.osgeo.org/msg00996.html >> ) >> >> Thanks >> Darren > > Hi Darren, > > Aron's patch has been in Shapely for some time. Where did your Windows > Python come from? Python.org? Elsewhere? > -- Sean _______________________________________________ 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