我有个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区域有关?(第二个问题)
发布于 2021-11-24 11:05:08
CRS84等同于其标准代码为EPSG:4326的WGS84。CRS84是在旧的geojson规范(2008)中定义的。读取geojson文件会将EPSG:4326作为CRS。
https://stackoverflow.com/questions/58573566
复制相似问题