blowing up on negative value buffer() call

2 messages Options
Embed this post
Permalink
Leo Shklovskii

blowing up on negative value buffer() call

Reply Threaded More More options
Print post
Permalink
Hi Geos-Devel,

I'm using GeoDjango (which wraps GEOS) to manipulate some polygons
representing states, cities & counties.

We simplify many of the polygons in our original census dataset and as a
result, some of them overlap (when they didn't originally). Because of
this, I need to reduce some of them in size before I run queries on them
to prevent wrong results from 'intersects' queries.

The first thing I tried seems to work fairly well:

location.mpoly.buffer(-.01).buffer(0)

Ideally, the first call shrinks the poly and the second one makes sure
that its valid.

Unfortunately, I've found several polygons that are valid but cause the
first call to buffer() to blow up (memory leak + spiked cpu + doesn't
return).

Should I file this as a GEOS bug? or am I not using buffer() correctly?

If the latter, what would be a better way to shrink a polygon?

Thanks in advance for your time!

--
--Leo
_______________________________________________
geos-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/geos-devel
strk

Re: blowing up on negative value buffer() call

Reply Threaded More More options
Print post
Permalink
On Fri, Oct 30, 2009 at 02:23:17PM -0700, Leo Shklovskii wrote:

> Unfortunately, I've found several polygons that are valid but cause the
> first call to buffer() to blow up (memory leak + spiked cpu + doesn't
> return).
>
> Should I file this as a GEOS bug? or am I not using buffer() correctly?

Negative buffer is supported, so looks like a bug.
The best report would be in the form of an XML test.
See tests/xmltester/tests/TestBufferExternal2.xml
for examples on how to format a testcase for negative buffers.

Or feel free to just report your input polygon WKT.

--strk;

 Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
 http://foo.keybit.net/~strk/services.html  /\  Keep it simple!
_______________________________________________
geos-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/geos-devel