[geos-devel] 3.1.0rc1

Dane Springmeyer blake at hailmail.net
Wed Jan 28 14:54:53 EST 2009


Hi Paul and Hartmut,

Sean wisely mentioned I should be careful in testing shapefiles with  
invalid polygons, which I definitely forgot to think about since I was  
reading in the shapefile directly.

Nevertheless with both this original shapefile [1] (that does have  
invalid polygons) and a cleaned up version (with the buffer(0) trick)  
that I have posted here [2], the below script results in the "should  
never be reached" assertion.

Perhaps the cleaned up shapefile [2] is still invalid for passing  
directly to the cascaded_union,  just let me know how to test further.

Cheers,

Dane


[1] http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip
[2] http://dbsgeo.com/tmp/test_world_shapefile.zip


### python ###

from shapely.ops import cascaded_union
from osgeo import ogr
from shapely.wkb import loads

ds = ogr.Open('tm_world_buffer_zero.shp')
state = ds.GetLayer(0)
states = []
while 1:
    f = state.GetNextFeature()
    if f is None: break
    g = f.geometry()
    states.append(loads(g.ExportToWkb()))

print len(states) # 246

u = cascaded_union(states)
[....snip...]
cxx type MultiPolygon
cxx type Polygon
cxx type Polygon
cxx type Polygon
cxx type Polygon
cxx type MultiPolygon
cxx type MultiPolygon
cxx type MultiPolygon
cxx type MultiPolygon
Assertion failed: (!"should never be reached"), function itemsTree,  
file AbstractSTRtree.cpp, line 358.
Abort trap







On Jan 28, 2009, at 10:33 AM, Paul Ramsey wrote:

> Dane, can you provide the shapefile? I will see if this reproduces in
> PostGIS and generate a test file for Hartmut if it does.
>
> P.
>
> On Tue, Jan 27, 2009 at 9:40 PM, Dane Springmeyer  
> <blake at hailmail.net> wrote:
>> Hi again,
>>
>> I just did a bit further testing of the new cascaded union goodness  
>> via
>> Shapely. See the linked email below:
>> http://lists.gispython.org/pipermail/community/2009-January/001960.html
>>
>> Seems that I reached where a point that 'should never be reached' ?
>> http://trac.osgeo.org/geos/browser/trunk/source/index/strtree/AbstractSTRtree.cpp#L358
>>
>> I am new to looking at the geos code, so any pointers to help me  
>> test more
>> would be great.
>>
>> Thanks!
>>
>> Dane
>>
>>
>> On Jan 27, 2009, at 9:02 PM, Dane Springmeyer wrote:
>>
>>> Paul,
>>>
>>> I tested on mac 10.5 and ubuntu 8.10 and all configure;make and make
>>> installs went perfectly.
>>>
>>> Just a few compiler warnings that I've pasted here:
>>> http://dpaste.com/hold/113736/
>>>
>>> Dane
>>>
>>> On Jan 27, 2009, at 10:35 AM, Paul Ramsey wrote:
>>>
>>>> This is a pre-warning to PSC members to download and test the first
>>>> 3.1 rc tarball:
>>>>
>>>> http://download.osgeo.org/geos/geos-3.1.0rc1.tar.bz2
>>>>
>>>> If I don't hear any howls of dismay over the next 24 hours, I will
>>>> make a wider announcement for testing.
>>>>
>>>> Paul
>>>> _______________________________________________
>>>> geos-devel mailing list
>>>> geos-devel at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/geos-devel
>>>
>>> _______________________________________________
>>> geos-devel mailing list
>>> geos-devel at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/geos-devel
>>
>> _______________________________________________
>> geos-devel mailing list
>> geos-devel at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/geos-devel
>>
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel



More information about the geos-devel mailing list