我有一个包含GeoJSON对象的列表,如下所示:

{
    "type": "Feature",
    "properties": {
        "ListEntry": 1440052.000000,
        "Name": "Edmonton War Memorial",
        "Location": "Enfield, London, N9",
        "Grade": "II",
        "ListDate": "2017\/01\/13",
        "AmendDate": null,
        "LegacyUID": null,
        "NGR": "TQ3435693567",
        "CaptureSca": "1:1250",
        "Easting": 534356.190450,
        "Northing": 193567.535720
    },
    "geometry": {
        "type": "Point",
         "coordinates": [
             534356.190499999560416,
             193567.535700000822544
          ]
    }
}


重新输入geometry键,如何将coordinates转换为传统的纬度和经度,最好是在Python中?

非常感谢。

最佳答案

看起来仅此一项中没有足够的信息来转换为纬度和经度。为此,您还需要这些点的坐标参考系统。但是,假设geojson保存在文件“ points.json”中,并且您知道与坐标参考系统相对应的epsg代码,则可以执行以下操作:

import geopandas as gp
gdf = gp.read_file("points.json")
epsg_code = 32630              # my guess based on a quick search, but evidently wrong
gdf.crs = {"init": "epsg:{}".format(epsg_code)}
gdf_reprojected = gdf.to_crs({"init": "epsg:4326"})


gdf_reprojected中的点为经度/纬度。

10-06 06:17