首页 > 解决方案 > 地理绘图英国(ONS)县形状文件(shp)的问题

问题描述

我正在尝试绘制从 UK ONS 下载的多边形 shapefile,而我的脚本在使用 geoplot 和 geopandas 时只会产生一个空白。我认为这是来自 ONS 的 shp 文件的问题,因为当从单独的数据源尝试美国各州时,它似乎工作正常。

这是我的脚本,非常简单:

import geopandas as gpd
import geoplot as gplt

nb = r'C:\Users\XX\Downloads\[![Counties_and_Unitary_Authorities_(December_2017)_Boundaries_UK.shp][1]][1]'
regions = gpd.read_file(nb)
regions.sample(5)
gplt.polyplot(regions)

该文件可以在这里下载:https ://geoportal.statistics.gov.uk/datasets/counties-and-unitary-authorities-december-2017-full-clipped-boundaries-in-uk/explore?location=54.650000%2C -3.250000%2C5.86

读取 shapefile 时,数据似乎可以通过几何列进行地理绘图(见图),但也许我遗漏了一些东西?

在此处输入图像描述

标签: shapefilegeopandasgeoplot

解决方案


推荐阅读