简体   繁体   中英

to_crs Error - 'Error creating Transformer from CRS'

I can't figure out how to change a GeoDataFrame into a specific coordinate system.

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.

pip install pyproj --upgrade

I have encountered a new problem, link below:

TO_CRS not converting

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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