最后,我用地质标准和Basemap管理了所有的事情。首先,我发现
script
将空间部分(在UTM区域31投影中)划分为500 m的等空间网格。然后,我必须将网格坐标转换为Lat/Lon,以使其与我的点相匹配:
import geopandas as gpd
geofile_in = 'UTMgrid.shp'
geofile_out = 'LATLONgrid.shp'
g = gpd.read_file(geofile_in)
originalcrs = {u'units': u'm', u'ellps': u'WGS84', u'datum': u'WGS84', u'proj': u'utm', u'zone': 31}
targetcrs = {u'ellps': u'WGS84', u'datum': u'WGS84', u'proj': u'longlat'}
# Set the original crs (UTM Zone 31 N)
g.crs = originalcrs
# Transform the Grid to the target crs (Lon, Lat)
g.to_crs(crs=targetcrs, inplace=True)
# Save to .shp file
g.to_file(geofile_out)
希望这会有所帮助。