[geos-devel] [GEOS] #250: geos_contains(multipolygon, polygon) returns false when it should return true

GEOS geos-trac at osgeo.org
Wed Apr 29 18:49:26 EDT 2009


#250: geos_contains(multipolygon, polygon) returns false when it should return
true
------------------------+---------------------------------------------------
 Reporter:  cdestigter  |       Owner:  geos-devel at lists.osgeo.org
     Type:  defect      |      Status:  new                       
 Priority:  major       |   Milestone:  3.1.1                     
Component:  Default     |     Version:  3.0.0                     
 Severity:  Unassigned  |    Keywords:                            
------------------------+---------------------------------------------------
 In geodjango:

 {{{
 #!python
 from django.contrib.gis import geos
 g1 = geos.GEOSGeometry('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))')
 g2 = geos.GEOSGeometry('POLYGON((1 1,1 2,2 2,2 1,1 1))')

 g1.contains(g2)
  => False

 g2.within(g1)
  => False
 }}}

 Both of the above should return True. The following combinations work fine
 though:
 polygon.contains(polygon)
 multipolygon.contains(multipolygon)
 polygon.contains(multipolygon)

 It's possible this has been fixed in a more recent version, though I
 couldn't find any existing tickets on it. Feel free to close if that's the
 case, stating when it was fixed.

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


More information about the geos-devel mailing list