2

I am using Anaconda 2.1.0 and Basemap installation is successful

conda install basemap

However, I keep getting the following error when I try to project lat,lon to a planar:

Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 286.

My code looks like this:

import shapely.geometry as sg
from pymongo import MongoClient
from mpl_toolkits.basemap import Basemap

p = Basemap(projection='sinu',lon_0=0,resolution='c') #fails here

projected_xy = p([24.4,45.1])

The code fails even before attempting to project.

3
  • Which version of geos are you using? The assertion error line says : "unsupported childBoundable type". The path to that assertion from your code isn't obvious, but either one of the parameters is wrong or there is a bug somewhere in the stack. Commented Dec 27, 2014 at 4:43
  • Also, do you definitely have proj4 installed? Commented Dec 27, 2014 at 4:52
  • I have geos version 3.3.3 and proj4 4.8.0-0 for sure. Commented Dec 27, 2014 at 15:34

1 Answer 1

0

For some reason, Basemap has to be imported before shapely.

from mpl_toolkits.basemap import Basemap
import shapely.geometry as sg

Doing the import the other way around will cause the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.