不理解如何在geopandas中使用"urn:ogc:def:crs:OGC:1.3:CRS84"。

3

我有这个GeoJSON文件

{
"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()

我得到了下面的图片: 图片结果 如果它们属于同一区域,为什么两张图片没有重叠?我该如何解决它?这个问题与UTM区有关吗?(第二个问题)

可能是The plotting differs in x axis in a geopandas的重复问题。 - martinfleis
1个回答

0

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接