Python Base Map Approval Failed

I am using Anaconda 2.1.0 and installing a basemap successfully

conda install basemap conda install gdal 

I have geostatistics version 3.3.3 and proj4 4.8.0-0. However, I keep getting the following error when I try to project (lat, lon) into a plane:

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

My code is as follows:

 import shapely.geometry as sg from pymongo import MongoClient from mpl_toolkits.basemap import Basemap p = Basemap(projection='sinu',lon_0=0,resolution='c') projected_xy = p(24.4,45.1) 
+5
source share
2 answers

I had the same problems working with geodata. Again, the import order was relevant. In this case, I had to import the geodata after Basemap. My import list is as follows:

 from mpl_toolkits.basemap import Basemap import geopandas as gp from shapely.geometry import Point, Polygon, MultiPoint, MultiPolygon from shapely.prepared import prep 

Please note that if you are using a Jupyter laptop, your connection to Kernel will crash and no error information will be provided. After using the python shell, the following error was given:

 Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 285. Abort trap: 6 
+1
source

For some reason, Basemap needs to be imported before construction.

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

Conversely, importing will result in an error.

+2
source

Source: https://habr.com/ru/post/1209984/


All Articles