basemap not working with GEOS 3.1

Hi,

I get a Topology Exception with GEOS 3.1:

import mpl_toolkits.basemap as bm
print "GEOS version: ", bm._geoslib.__geos_version__
print "basemap version: ", bm.__version__

m = bm.Basemap(width=12000000,height=8000000, \
            resolution='l',projection='laea',\
            lat_0=55,lon_0=175.)

output:

GEOS version: 3.1.0-CAPI-1.5.0
basemap version: 0.99.3
GEOS_ERROR: TopologyException: found non-noded intersection between
3.03025e+06 1.45852e+07, 3.02518e+06 1.45831e+07 and 3.02379e+06
1.45823e+07, 3.02937e+06 1.45857e+07 3.02519e+06 1.45831e+07
Segmentation fault

Any solutions?
cheers

Chris

Chris Petrich wrote:

Hi,

I get a Topology Exception with GEOS 3.1:

import mpl_toolkits.basemap as bm
print "GEOS version: ", bm._geoslib.__geos_version__
print "basemap version: ", bm.__version__

m = bm.Basemap(width=12000000,height=8000000, \
            resolution='l',projection='laea',\
            lat_0=55,lon_0=175.)

output:

GEOS version: 3.1.0-CAPI-1.5.0
basemap version: 0.99.3
GEOS_ERROR: TopologyException: found non-noded intersection between
3.03025e+06 1.45852e+07, 3.02518e+06 1.45831e+07 and 3.02379e+06
1.45823e+07, 3.02937e+06 1.45857e+07 3.02519e+06 1.45831e+07
Segmentation fault

Any solutions?
cheers

Chris

Chris: This usually happens when you build mix different versions of geos, i.e. build with the 3.1 lib but the 2.2.3 headers, or link with the 3.1 shared lib and then have it pick up the 2.2.3 shared lib at run time. Do you have two versions of geos on your system? If so, make sure basemap is only finding one of them, both at build time and run time.

-Jeff

Thanks, Jeff,

that was it.
I had both geos 3.1 and 2.2.3 installed in /usr. basemap found 3.1
during build/installation while _libgeos tried to import 2.2.3 at run
time (this became obvious after I removed the 2.2.3 libraries).
Removed libgeos 2.2.3 and "python setup.py install"-ed basemap 0.99.3
from a fresh tar ball, works like a charm now!

I appreciate the effort you put into developing basemap. The result is awesome.
cheers

Chris

···

On Mon, Jul 27, 2009 at 8:14 PM, Jeff Whitaker<jswhit@...196...> wrote:

Chris Petrich wrote:

Hi,

I get a Topology Exception with GEOS 3.1:

import mpl_toolkits.basemap as bm
print "GEOS version: ", bm._geoslib.__geos_version__
print "basemap version: ", bm.__version__

m = bm.Basemap(width=12000000,height=8000000, \
resolution='l',projection='laea',\
lat_0=55,lon_0=175.)

output:

GEOS version: 3.1.0-CAPI-1.5.0
basemap version: 0.99.3
GEOS_ERROR: TopologyException: found non-noded intersection between
3.03025e+06 1.45852e+07, 3.02518e+06 1.45831e+07 and 3.02379e+06
1.45823e+07, 3.02937e+06 1.45857e+07 3.02519e+06 1.45831e+07
Segmentation fault

Any solutions?
cheers

Chris

Chris: This usually happens when you build mix different versions of geos,
i.e. build with the 3.1 lib but the 2.2.3 headers, or link with the 3.1
shared lib and then have it pick up the 2.2.3 shared lib at run time. Do
you have two versions of geos on your system? If so, make sure basemap is
only finding one of them, both at build time and run time.

-Jeff

So does basemap support GEOS-3.1 now? I thought that it only worked
with 2.2.3? If so this is great news.

Cheers

Adam

···

On Tue, Jul 28, 2009 at 05:14, Jeff Whitaker<jswhit@...196...> wrote:

Chris: This usually happens when you build mix different versions of
geos, i.e. build with the 3.1 lib but the 2.2.3 headers, or link with
the 3.1 shared lib and then have it pick up the 2.2.3 shared lib at run
time. Do you have two versions of geos on your system? If so, make
sure basemap is only finding one of them, both at build time and run time.

Adam Mercer wrote:

Chris: This usually happens when you build mix different versions of
geos, i.e. build with the 3.1 lib but the 2.2.3 headers, or link with
the 3.1 shared lib and then have it pick up the 2.2.3 shared lib at run
time. Do you have two versions of geos on your system? If so, make
sure basemap is only finding one of them, both at build time and run time.
    
So does basemap support GEOS-3.1 now?

Yes.

···

On Tue, Jul 28, 2009 at 05:14, Jeff Whitaker<jswhit@...196...> wrote:
I thought that it only worked
with 2.2.3? If so this is great news.

Cheers

Adam
  
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...236...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg