Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/320.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何有效地更改geopandas数据帧中几何体的crs?_Python_Performance_Gis_Shapefile_Geopandas - Fatal编程技术网

Python 如何有效地更改geopandas数据帧中几何体的crs?

Python 如何有效地更改geopandas数据帧中几何体的crs?,python,performance,gis,shapefile,geopandas,Python,Performance,Gis,Shapefile,Geopandas,我有一个形状文件,我正在将其转换为geopandas数据帧。这个形状文件的crs是epsg:4326,我想把它转换成epsg:3857 import geopandas as gp file_path = 'zip_poly.shp' sf = gp.read_file(file_path) sf = sf[['ZIP_CODE','PO_NAME','STATE','geometry']] sf = sf.to_crs(epsg=3857) 您可以找到shapefile shapefile

我有一个形状文件,我正在将其转换为geopandas数据帧。这个形状文件的crs是epsg:4326,我想把它转换成epsg:3857

import geopandas as gp

file_path = 'zip_poly.shp'
sf = gp.read_file(file_path)
sf = sf[['ZIP_CODE','PO_NAME','STATE','geometry']]
sf = sf.to_crs(epsg=3857)
您可以找到shapefile


shapefile大约有33K个zipcodes,转换时间太长。有更好的快速转换方法吗?

我认为您显示的代码是目前最好的选择(多长时间太长?)。使用pyproj的最新版本(>2.1)可能会有所改进,GeoPandas中正在进行改进性能的工作,但尚未发布。的副本