Here is my question:
- 2 num num array data represents some property of each grid space
- shapefile as the administrative division of the field of study (for example, city).
For example:
http://i4.tietuku.com/84ea2afa5841517a.png
The whole area has a 40x40 mesh grid, and I want to extract the data inside the purple area. In other words, I want to mask data outside the administrative border in np.nan.
My early attempt
I put the grid number and select the specific array data in np.nan.
http://i4.tietuku.com/523df4783bea00e2.png
value[0,:] = np.nan
value[1,:] = np.nan
.
.
.
.
Can someone show me an easier way to achieve my goal?
Add
An answer is found here that can display raster data in a shapefile, but the data itself does not change.
-2016-01-16
, .
-, , , :
1. /
2. Baseemap
/ , shapely.polygon.