1.绘制兰勃脱投影的中国区域(包含南海子图):
import numpy as npimport xarray as xrimport matplotlib.pyplot as pltimport cartopy.crs as ccrsimport cartopy.feature as cfeaturefrom copy import copyfrom cartopy.mpl.gridliner import LATITUDE_FORMATTER, LONGITUDE_FORMATTERimport shapely.geometry as sgeom
def find_side(ls, side): """ Given a shapely LineString which is assumed to be rectangular, return the line corresponding to a given side of the rectangle.
""" minx, miny, maxx, maxy = ls.bounds points = {'left': [(minx, miny), (minx, maxy)], 'right': [(maxx, miny), (maxx, maxy)], 'bottom': [(minx, miny), (maxx, miny)], 'top': [(minx, max