Re: [geos-devel] RE: [GEOS] #468: Geometry breaks valid() and buffer(): Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 286

2011-08-22 Thread Christopher DeMars
I'm thinking that there must be some sort of conflict between the GEOS
and geodjango. Has the API changed significantly lately?

After installing the latest SVN release (3.4.0dev-CAPI-1.8.0), things
got worse, not better. Now no geometry will buffer, even super simple
example geometries from wikipedia's wkt entry.

Using two geometries from my dataset (attached as wkt), I ran through
the geodjango geos api.

Operations that seemed to work:
.empty
.geom_type
.num_coords
.num_geom
.hasz
.ring
.simple
.srid
.json
.ewkt
.hex
.hexewkb
.geojson
.ogr
.ewkb
.wkb
.contains(w2)
.crosses(w2)
.disjoint(w2)
.equals(w2)
.equals_exact(w2)
.intersects(w2)
.overlaps(w2)
.touches(w2)
.within(w2)
.relate(w2)
.boundary
.centroid
.convex_hull
.envelope
.area
.clone
.length
.prepared
.srs


Worked, but returned a bogus answer
In [17]: w1.distance(w2)
Out[17]: 1.7976931348623157e+308


Type errors:
.kml
GEOS_ERROR: Argument is not a Polygon
GEOS_ERROR: Argument is not a Polygon
w1.difference(w2)
GEOS_ERROR: UnsupportedOperationException: GeometryGraph::add(Geometry
*): unknown geometry type: N4geos4geom12MultiPolygonE
 w1.intersection(w2)
GEOS_ERROR: UnsupportedOperationException: GeometryGraph::add(Geometry
*): unknown geometry type: N4geos4geom12MultiPolygonE
w1.sym_difference(w2)
GEOS_ERROR: UnsupportedOperationException: GeometryGraph::add(Geometry
*): unknown geometry type: N4geos4geom12MultiPolygonE
 w1.union(w2)
GEOS_ERROR: UnsupportedOperationException: GeometryGraph::add(Geometry
*): unknown geometry type: N4geos4geom12MultiPolygonE
w1.point_on_surface
GEOS_ERROR: UnsupportedOperationException: GeometryGraph::add(Geometry
*): unknown geometry type: N4geos4geom10LineStringE
GEOS_ERROR: UnsupportedOperationException: GeometryGraph::add(Geometry
*): unknown geometry type: N4geos4geom10LineStringE
w1.extent
GEOS_ERROR: Geometry must be a Point or LineString
GEOS_ERROR: Geometry must be a Point or LineString
w1.coords
GEOS_ERROR: Argument is not a Polygon
GEOS_ERROR: Argument is not a Polygon


Segfault:
w1.simplify()
Segmentation fault
w1.valid
Segmentation fault
w1.valid_reason
Segmentation fault
w1.buffer(20)
Segmentation fault


I guess I'll go bitch at the GeoDjango folks for a while until I can
get an exact reason why things are going fubar when translating from
django to geos.

Thanks for your time,
--Christopher


w1fubar.wkt
Description: Binary data


w2fubar.wkt
Description: Binary data
___
geos-devel mailing list
geos-devel@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/geos-devel

Re: [geos-devel] RE: [GEOS] #468: Geometry breaks valid() and buffer(): Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 286

2011-08-19 Thread Christopher DeMars
Thank you Mr. Davis for your attention,

I tried your suggestion of buffering elements individually then
merging the buffers. I buffered several elements without issue, then
got the same program stopping error message as before. On the plus
side, I did isolate a polygon that was crashing things. Attached is
the wkt and wkb of that polygon.

--Christopher


On Thu, Aug 18, 2011 at 8:53 PM, Martin Davis mtncl...@telus.net wrote:
 Incidentally, this is one of those cases where buffering by unioning the
 buffers of the components far outperforms the straight buffer (for distance
 = 100, 10 s vs 70 s).

 This is something you might be able to try, if your data model permits it.
 Split the geometry into its components, and process them all separately.
 This should give better performance, and may avoid the GEOS issues.

 On 8/18/2011 8:43 PM, Martin Davis wrote:

 I have tested this in JTS 1.12, and can confirm that both isValid and buffer
 work correctly.  The buffer operation does take quite a while and requires a
 significant amount of memory.

 So the geometry is fine.  There may be some issues with GEOS.

 On 8/18/2011 3:44 PM, Christopher DeMars wrote:

 Since the ticket upload function is limited to 256Kb, I thought I
 would try to send an example file via this list.

 Attached is water1.wkb, a multipolygon that fubars GEOS buffer or
 valid functions. I can supply water2 and/or either file as wkt.

 Thank you for any help you can offer,
 --Christopher


 -- Forwarded message --
 From: GEOS geos-t...@osgeo.org
 Date: Thu, Aug 18, 2011 at 3:08 PM
 Subject: [GEOS] #468: Geometry breaks valid() and buffer(): Assertion
 failed: (0), function query, file AbstractSTRtree.cpp, line 286
 To:


 #468: Geometry breaks valid() and buffer(): Assertion failed: (0), function
 query, file AbstractSTRtree.cpp, line 286
 +---
  Reporter:  chdemars    |       Owner:  strk
     Type:  defect      |      Status:  new
  Priority:  major       |   Milestone:  3.3.1
 Component:  Core        |     Version:  3.3.0
  Severity:  Unassigned  |    Keywords:
 +---
  GEOS is pretty far down in the software stack I'm using, but it looks like
  my program stopping error lies there.

  Software being used:
  geos-config --version 3.3.0
  I'm using GeoDjango and PostGIS on top of GEOS with development taking
  place on Mac OSX

  Geometry source:
  original source is:
  http://www.water.ca.gov/landwateruse/docs/landusedata/shapes/04bu.zip

  After loading that (and the other DWR land use files) into my
  PostGIS/GeoDjango database I extracted all the water features using:
  water = DWRlanduse.objects.filter(class1__contains='NW',
  survey_area__contains='BUTTE COUNTY').collect()

  I have attached the wkb and wkt output of the above with water1 using
  .unionagg() and water2 using .collect() to produce a MultiPolygon and
  GeometryCollection respectively. Both produce failure.

  If I try to use .buffer() or .valid() functions on either water1 or water2
  I get the same failure:
  Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 286
  which says one of the 'childBoundables' is of an unsupported type.
  Functions like area or centroid work fine.

  I would like to know if the error is a problem with GEOS and/or a problem
  with the geometry. Regardless of the source of error, I would also like to
  know how to go about fixing it.

  Thank you for your time and efforts,
  --Christopher

 --
 Ticket URL: http://trac.osgeo.org/geos/ticket/468
 GEOS http://geos.refractions.net/
 GEOS (Geometry Engine - Open Source) is a C++ port of the Java
 Topology Suite (JTS).


 ___
 geos-devel mailing list
 geos-devel@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/geos-devel

 -
 No virus found in this message.
 Checked by AVG - www.avg.com
 Version: 10.0.1392 / Virus Database: 1520/3842 - Release Date: 08/18/11


 ___
 geos-devel mailing list
 geos-devel@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/geos-devel

 No virus found in this message.
 Checked by AVG - www.avg.com
 Version: 10.0.1392 / Virus Database: 1520/3842 - Release Date: 08/18/11

 ___
 geos-devel mailing list
 geos-devel@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/geos-devel



fubargeom.wkb
Description: Binary data


fubargeom.wkt
Description: Binary data
___
geos-devel mailing list
geos-devel@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/geos-devel

Re: [geos-devel] RE: [GEOS] #468: Geometry breaks valid() and buffer(): Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 286

2011-08-19 Thread Christopher DeMars
I initially wasn't sure if the failure was caused by a particular
geometry formation or due to the size of the dataset. I have since
tried other county layers from the same source (California Department
of Water Resources) and got the same error after processing a small
number of polygons, so whatever the polygon encoding issue, it is
fairly common in this dataset. I can extract other example polygons if
anyone is interested.

--Christopher

On Fri, Aug 19, 2011 at 8:24 AM, Martin Davis mtncl...@telus.net wrote:
 Good to have the problem narrowed down.

 There's nothing obviously wrong with the polygon, at least from the JTS
 perspective.  Perhaps Sandro can shed some light on the issue...

 On 8/19/2011 7:03 AM, Christopher DeMars wrote:

 Thank you Mr. Davis for your attention,

 I tried your suggestion of buffering elements individually then
 merging the buffers. I buffered several elements without issue, then
 got the same program stopping error message as before. On the plus
 side, I did isolate a polygon that was crashing things. Attached is
 the wkt and wkb of that polygon.

 --Christopher


 On Thu, Aug 18, 2011 at 8:53 PM, Martin Davis mtncl...@telus.net wrote:

 Incidentally, this is one of those cases where buffering by unioning the
 buffers of the components far outperforms the straight buffer (for distance
 = 100, 10 s vs 70 s).

 This is something you might be able to try, if your data model permits it.
 Split the geometry into its components, and process them all separately.
 This should give better performance, and may avoid the GEOS issues.

 On 8/18/2011 8:43 PM, Martin Davis wrote:

 I have tested this in JTS 1.12, and can confirm that both isValid and buffer
 work correctly.  The buffer operation does take quite a while and requires a
 significant amount of memory.

 So the geometry is fine.  There may be some issues with GEOS.

 On 8/18/2011 3:44 PM, Christopher DeMars wrote:

 Since the ticket upload function is limited to 256Kb, I thought I
 would try to send an example file via this list.

 Attached is water1.wkb, a multipolygon that fubars GEOS buffer or
 valid functions. I can supply water2 and/or either file as wkt.

 Thank you for any help you can offer,
 --Christopher


 -- Forwarded message --
 From: GEOS geos-t...@osgeo.org
 Date: Thu, Aug 18, 2011 at 3:08 PM
 Subject: [GEOS] #468: Geometry breaks valid() and buffer(): Assertion
 failed: (0), function query, file AbstractSTRtree.cpp, line 286
 To:


 #468: Geometry breaks valid() and buffer(): Assertion failed: (0), function
 query, file AbstractSTRtree.cpp, line 286
 +---
  Reporter:  chdemars    |       Owner:  strk
     Type:  defect      |      Status:  new
  Priority:  major       |   Milestone:  3.3.1
 Component:  Core        |     Version:  3.3.0
  Severity:  Unassigned  |    Keywords:
 +---
  GEOS is pretty far down in the software stack I'm using, but it looks like
  my program stopping error lies there.

  Software being used:
  geos-config --version 3.3.0
  I'm using GeoDjango and PostGIS on top of GEOS with development taking
  place on Mac OSX

  Geometry source:
  original source is:
  http://www.water.ca.gov/landwateruse/docs/landusedata/shapes/04bu.zip

  After loading that (and the other DWR land use files) into my
  PostGIS/GeoDjango database I extracted all the water features using:
  water = DWRlanduse.objects.filter(class1__contains='NW',
  survey_area__contains='BUTTE COUNTY').collect()

  I have attached the wkb and wkt output of the above with water1 using
  .unionagg() and water2 using .collect() to produce a MultiPolygon and
  GeometryCollection respectively. Both produce failure.

  If I try to use .buffer() or .valid() functions on either water1 or water2
  I get the same failure:
  Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 286
  which says one of the 'childBoundables' is of an unsupported type.
  Functions like area or centroid work fine.

  I would like to know if the error is a problem with GEOS and/or a problem
  with the geometry. Regardless of the source of error, I would also like to
  know how to go about fixing it.

  Thank you for your time and efforts,
  --Christopher

 --
 Ticket URL: http://trac.osgeo.org/geos/ticket/468
 GEOS http://geos.refractions.net/
 GEOS (Geometry Engine - Open Source) is a C++ port of the Java
 Topology Suite (JTS).


 ___
 geos-devel mailing list
 geos-devel@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/geos-devel

 -
 No virus found in this message.
 Checked by AVG - www.avg.com
 Version: 10.0.1392 / Virus Database: 1520/3842 - Release Date: 08/18/11


 ___
 geos-devel mailing list
 geos-devel@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/geos-devel

 No virus