简体   繁体   English

to_crs 错误 - '从 CRS 创建变压器时出错'

[英]to_crs Error - 'Error creating Transformer from CRS'

I can't figure out how to change a GeoDataFrame into a specific coordinate system.我不知道如何将 GeoDataFrame 更改为特定的坐标系。

My code and error message is below:我的代码和错误信息如下:

import geopandas as gpd
import pandas as pd 
import numpy as np


sfd_subs = pd.read_csv(r'FILE_LOCATION.csv')

sfd_subs = gpd.GeoDataFrame(sfd_subs, geometry=gpd.points_from_xy(sfd_subs.Longitude, sfd_subs.Latitude), crs = 'EPSG:4326')
sfd_subs.to_crs('EPSG:2264')

Error below:以下错误:

 File "pyproj\_transformer.pyx", line 319, in pyproj._transformer._Transformer.from_crs
pyproj.exceptions.ProjError: Error creating Transformer from CRS.: (Internal Proj Error: proj_create_operations: SQLite error on SELECT source_crs_auth_name, source_crs_code, target_crs_auth_name, target_crs_code, cov.auth_name, cov.code, cov.table_name, area.south_lat, area.west_lon, area.north_lat, area.east_lon, ss.replacement_auth_name, ss.replacement_code FROM coordinate_operation_view cov JOIN area ON cov.area_of_use_auth_name = area.auth_name AND cov.area_of_use_code = area.code LEFT JOIN supersession ss ON ss.superseded_table_name = cov.table_name AND ss.superseded_auth_name = cov.auth_name AND ss.superseded_code = cov.code AND ss.superseded_table_name = ss.replacement_table_name AND ss.same_source_target_crs = 1 WHERE ((source_crs_auth_name = ? AND source_crs_code = ? AND target_crs_auth_name = ? AND target_crs_code = ?) OR (source_crs_auth_name = ? AND source_crs_code = ? AND target_crs_auth_name = ? AND target_crs_code = ?)) AND cov.deprecated = 0 AND cov.auth_name = ? ORDER BY pseudo_area_from_swne(south_lat, west_lon, north_lat, east_lon) DESC, (CASE WHEN accuracy is NULL THEN 1 ELSE 0 END), accuracy: no such column: ss.same_source_target_crs)

Can anyone help with a solution?任何人都可以提供解决方案吗?

Thanks!谢谢!

I ended up solving the error simply by upgrading pyproj to the latest version.我最终通过将 pyproj 升级到最新版本来解决该错误。

pip install pyproj --upgrade

I have encountered a new problem, link below:我遇到了一个新问题,链接如下:

TO_CRS not converting TO_CRS 未转换

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM