python - 不了解如何在 geopandas 中使用 "urn:ogc:def:crs:OGC:1.3:CRS84"

标签 python geopandas

我有这个 geojason 文件

{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "visit_date": "2013-03-27Z", "name": "Mayi-Tatu", "n_workers": 150.0, "mineral": "Gold" }, "geometry": { "type": "Point", "coordinates": [ 29.66033, 1.01089 ] } },
{ "type": "Feature", "properties": { "visit_date": "2013-03-27Z", "name": "Mabanga", "n_workers": 115.0, "mineral": "Gold" }, "geometry": { "type": "Point", "coordinates": [ 29.65862, 1.00308 ] } },
{ "type": "Feature", "properties": { "visit_date": "2013-03-27Z", "name": "Molende", "n_workers": 130.0, "mineral": "Gold" }, "geometry": { "type": "Point", "coordinates": [ 29.65629, 0.98563 ] } },
...
{ "type": "Feature", "properties": { "visit_date": "2017-08-31Z", "name": "Kambasha", "n_workers": 37.0, "mineral": "Cassiterite" }, "geometry": { "type": "Point", "coordinates": [ 29.05973167, -2.25938167 ] } }
]
}

我读了这个文件,下面是代码:

filename = "ipis_cod_mines.geojson"
df_congomines_crs84_geo = gpd.read_file(filename)

但是当我检查 df_congomines_crs84_geo 的 crs 属性时,

df_congomines_crs84_geo.crs

我得到“{'init': 'epsg:4326'}”,我不明白为什么我没有得到正确的 crs。 (第一个问题)

之后,我读取了同一地区的另一个数据集(两个数据都属于刚果)

df_countries_4326_geo = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))

此数据集的 crs 等于 {'init': 'epsg:4326'}。 当我绘制两个数据集时(不更改 crs),

ax = congo_df.plot(alpha=0.5, color='brown', figsize=(11,4))
df_congomines_crs84_geo.plot(ax=ax, column='mineral')
plt.show()

我得到了下一张图片: Image result

为什么两个图像属于同一区域却不重叠???我该如何解决???这个问题和UTM带有关吗???(第二个问题)

最佳答案

CRS84 等同于 WGS84,其标准 EPSG 代码为 EPSG:4326。 CRS84 是在旧的 geojson 规范 (2008) 中定义的。读取 geojson 文件给出 EPSG:4326 作为 CRS。

关于python - 不了解如何在 geopandas 中使用 "urn:ogc:def:crs:OGC:1.3:CRS84",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58573566/

相关文章:

python - 没有名为 'folium.plugins' 的模块,Python 3.6

python-3.x - geopandas 没有找到多边形中的点,即使它应该找到?

geopandas - 在 GeoPandas 中更改 CRS

python - 如何从 Python 中的字符串中提取字符?

python - 创建新实例时如何分配ForeignKey字段

python - 将 Pandas 数据框转换为不同的格式

python - Windows cookies index.dat 解析器

python - django导入错误

legend - Geopandas 减少图例大小(并删除 map 下方的空白区域)

python - 如何解决 "GeoDataFrame object has not attribute..."错误