0

I'm following the accepted answer from here: https://gis.stackexchange.com/questions/198530/get-lat-long-of-us-cities-and-plot-them-on-a-map-using-matplotlib-and-basemap

Those 2 lines:

map = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,
        projection='lcc',lat_1=32,lat_2=45,lon_0=-95)
map.readshapefile('st99_d00', name='states', drawbounds=True)

Yilded this error:

OSError: cannot locate st99_d00.shp

I tried to understand how to add the .shp file - without success.

Any help will be appreciated!

Binyamin Even
  • 3,318
  • 1
  • 18
  • 45

1 Answers1

0

The files st99_d00.dbf, st99_d00.shp and st99_d00.shx are part of the examples available within the basemap project:

https://github.com/matplotlib/basemap/tree/v1.3.0/examples

Since the examples folder is not included in a normal basemap installation, you will need to download these files manually from the basemap repository if you want to use them. Once downloaded, you need to adjust your map.readshapefile call based on the location where you downloaded the files.

molinav
  • 322
  • 2
  • 9