我有一个名为eq的地震数据的数据框,其中包含列出纬度和经度的列 . 使用geopandas我创建了一个点列,其中包含以下内容:
from geopandas import GeoSeries, GeoDataFrame
from shapely.geometry import Point
s = GeoSeries([Point(x,y) for x, y in zip(df['longitude'], df['latitude'])])
eq['geometry'] = s
eq.crs = {'init': 'epsg:4326', 'no_defs': True}
eq
现在我有一个带有lat lon坐标的几何列,但我想将投影更改为UTM . 任何人都可以帮助改造吗?
1 回答
纬度/经度不是真正的投影,而是一种默认的"unprojection" . 请参阅this page for more details,但这可能意味着您的数据使用
WGS84
或epsg:4326
.设's build a dataset and, before we do any reprojection, we' ll将
crs
定义为epsg:4326
我不确定你的意思"UTM projection" . 从wikipedia page我看到有60种不同的UTM投影取决于世界的面积 . 你可以在网上找到合适的
epsg
代码,但我只想给你一个随机epsg
代码的例子 . This is the one for zone 33N for example怎么做重投影?您可以轻松地从the geopandas docs on projection获取此信息 . 这只是一行:
并且几何体不再编码为纬度/经度: