欧卡2中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

需要三步,才能开始

只需两步,慢速开始

欧卡2入门方向盘选莱仕达V9莱仕达折叠便携游戏方向盘支架欢迎地图Mod入驻
12
返回列表 发新帖
楼主: ets246
收起左侧

[地图] 游戏背景图偏移

[复制链接]
 楼主| ets246 发表于 2022-11-7 22:54 来自手机 | 显示全部楼层
ETS2CN 发表于 2022-10-31 00:25
考虑一下定制服务吧

欧卡2背景地图制作服务

你给的代码会报错啊
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
import sys
plt.box(False)
fig = plt.figure(figsize=(81.92,81.92), frameon=False, dpi=200)
fig.add_axes((0, 0, 1, 1))
m = Basemap(rsphere=(6378137.00,6356752.3142),\
    llcrnrlon=-10,llcrnrlat=-10,urcrnrlon=144.523212256745,urcrnrlat=8.10021320756799,\
    resolution='f',area_thresh=10000,projection='lcc',lat_1=37,lat_2=65,lat_0=50,lon_0=15)
m.drawmapboundary(fill_color='#A6CAE0', linewidth=0)
m.fillcontinents(color='#353535')
m.drawcountries(linewidth=1.5, color="white")
plt.savefig("map.png")

点评

贴报错啊,贴代码干什么  详情 回复 发表于 2022-11-7 23:12
回复 打印

使用道具 举报

ETS2CN 发表于 2022-11-7 23:12 | 显示全部楼层
ets246 发表于 2022-11-7 22:54
你给的代码会报错啊
from mpl_toolkits.basemap import Basemap
import numpy as np

贴报错啊,贴代码干什么
回复 打印

使用道具 举报

 楼主| ets246 发表于 2022-11-9 23:31 | 显示全部楼层
FileNotFoundError                         Traceback (most recent call last)
F:\Anaconda3\lib\site-packages\mpl_toolkits\basemap\__init__.py in _readboundarydata(self, name, as_polygons)
   1234         try:
-> 1235             bdatfile = open(os.path.join(basemap_datadir,name+'_'+self.resolution+'.dat'),'rb')
   1236             bdatmetafile = open(os.path.join(basemap_datadir,name+'meta_'+self.resolution+'.dat'),'r')

FileNotFoundError: [Errno 2] No such file or directory: 'F:\\Anaconda3\\lib\\site-packages\\mpl_toolkits\\basemap_data\\gshhs_f.dat'

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_10252\3713777642.py in <module>
      6 fig = plt.figure(figsize=(81.92,81.92), frameon=False, dpi=200)
      7 fig.add_axes((0, 0, 1, 1))
----> 8 m = Basemap(rsphere=(6378137.00,6356752.3142),\
      9     llcrnrlon=-10,llcrnrlat=-10,urcrnrlon=144.523212256745,urcrnrlat=8.10021320756799,\
     10     resolution='f',area_thresh=10000,projection='lcc',lat_1=37,lat_2=65,lat_0=50,lon_0=15)

F:\Anaconda3\lib\site-packages\mpl_toolkits\basemap\__init__.py in __init__(self, llcrnrlon, llcrnrlat, urcrnrlon, urcrnrlat, llcrnrx, llcrnry, urcrnrx, urcrnry, width, height, projection, resolution, area_thresh, rsphere, ellps, lat_ts, lat_1, lat_2, lat_0, lon_0, lon_1, lon_2, o_lon_p, o_lat_p, k_0, no_rot, suppress_ticks, satellite_height, boundinglat, fix_aspect, anchor, celestial, round, epsg, ax)
   1123         if self.resolution is not None:
   1124             self.coastsegs, self.coastpolygontypes =\
-> 1125             self._readboundarydata('gshhs',as_polygons=True)
   1126             # reformat for use in matplotlib.patches.Polygon.
   1127             self.coastpolygons = []

F:\Anaconda3\lib\site-packages\mpl_toolkits\basemap\__init__.py in _readboundarydata(self, name, as_polygons)
   1236             bdatmetafile = open(os.path.join(basemap_datadir,name+'meta_'+self.resolution+'.dat'),'r')
   1237         except:
-> 1238             raise IOError(msg)
   1239         polygons = []
   1240         polygon_types = []

OSError: Unable to open boundary dataset file. Only the 'crude', 'low' and
'intermediate' resolution datasets are installed by default. If you
are requesting a 'high' or 'full' resolution dataset, you need to
install the `basemap-data-hires` package.

点评

没法看,你自己解决吧  详情 回复 发表于 2022-11-10 00:09
回复 打印

使用道具 举报

 楼主| ets246 发表于 2022-11-9 23:51 | 显示全部楼层
有两张白板图
回复 打印

使用道具 举报

ETS2CN 发表于 2022-11-10 00:09 | 显示全部楼层
ets246 发表于 2022-11-9 23:31
FileNotFoundError                         Traceback (most recent call last)
F:\Anaconda3\lib\site-p ...

没法看,你自己解决吧
回复 打印

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系我们|手机版|欧卡2中国 ( 湘ICP备11020288号-1 )

GMT+8, 2024-12-22 00:44 , Processed in 0.048458 second(s), 12 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表