目标
方法
使用this tutorial on Basemap,上载一个用于映射的shapefile。
#First, we have to import our datasets.
#These datasets include store locations, existing distribution locations, county borders, and real estate by county
walmartStores = pd.read_csv("data/walmart-stores.csv",header=0, encoding='latin1')
propertyValues = pd.read_csv("data/property values.csv")
shp = fiona.open('data/boundaries/Counties.shp')
#We need to create a workable array with Walmart Stores
longitude = walmartStores.longitude
latitude = walmartStores.latitude
stores = np.column_stack((longitude, latitude))
#We also need to load the shape file for county boundaries
extra = 0.1
bds = shp.bounds
shp.close()
#We need to assign the lower-left bound and upper-right bound
ll = (bds[0], bds[1])
ur = (bds[2], bds[3])
#concatenate the lower left and upper right into a variable called coordinates
coords = list(chain(ll, ur))
print(coords)
#define variables for the width and the height of the map
w, h = coords[2] - coords[0], coords[3] - coords[1]
带^{cd1>}=^{cd2>}
到目前为止一切都很好,但是我遇到了以下问题:
^{pr2}$Error: lat_0 must be between -90.000000 and 90.000000
问题
谢谢!
纬度只能在-90到90之间-其他任何东西都没有意义。北极是+90,南极是-90,赤道在0。没有其他可接受的值!在
至于长度,它只能在-180和180之间。0在本初子午线,向-180(向西)和+180(向东)
相关问题 更多 >
编程相关推荐