我试图自己解决问题,但我无法解决,我试图以您可以想象的每种格式运行此代码,而在ArcGIS Pro软件中,我同样无法在其他任何错误消息中找到此错误消息问题。从类似的问题来看,似乎有些数据文件可能丢失了?

import geopandas as gpd
import json
import numpy as np
from shapely.geometry import LineString, Point, box
import ast
from pyproj import Proj
paths = road_features.SHAPE.map(lambda x: np.array(ast.literal_eval(x)["paths"][0]))
pathLineStrings = paths.map(LineString)
gdf = gpd.GeoDataFrame(road_features,geometry=pathLineStrings)
#gdf.crs = {'init': 'epsg:3857'}
gdf.crs = {'init': 'epsg:4326'}
gdf = gdf.to_crs({'init': 'epsg:4326'})

我得到这个错误
RuntimeError: b'no arguments in initialization list'

我也在arcgis pro中尝试过
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\geopandas\geodataframe.py", line 443, in to_crs
    geom = df.geometry.to_crs(crs=crs, epsg=epsg)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\geopandas\geoseries.py", line 304, in to_crs
    proj_in = pyproj.Proj(self.crs, preserve_units=True)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\pyproj\__init__.py", line 362, in __new__
    return _proj.Proj.__new__(self, projstring)
  File "_proj.pyx", line 129, in _proj.Proj.__cinit__
RuntimeError: b'no arguments in initialization list'

最佳答案

是否定义了初始crs
仅当我仅传递epsg命令gdf.to_crs('epsg:4326')时,我才遇到相同的问题。
如你所展示my_geoseries.crs = {'init' :'epsg:3857'}应该是第一步,然后转变为gdf = gdf.to_crs({'init': 'epsg:4326'})如果您在ArcGIS中工作,则还可以在属性中检查是否定义了初始epsg?

10-06 02:45