叠加空间数据集

在 Python 中处理地理空间数据

Joris Van den Bossche

Open source software developer and teacher, GeoPandas maintainer

与多边形相交

countries.intersection(circle)
在 Python 中处理地理空间数据

与多边形相交

countries.intersection(circle) 的局限:

  • 只能将 GeoSeries 与单个多边形相交
  • 不保留属性信息
在 Python 中处理地理空间数据

叠加两个数据集

countries.plot()

geologic_regions.plot()
在 Python 中处理地理空间数据

叠加两个数据集

geopandas.overlay(countries, geologic_regions, 
                  how='intersection')
在 Python 中处理地理空间数据

叠加 vs 相交

相交方法(单个多边形)

countries.intersection(geologic_region_A)
0                            ()
1    POLYGON ((-1.661 48.803...
2    POLYGON ((1.201 51.145,...
dtype: object

叠加方法

geopandas.overlay(countries, geologic_regions,
                  how='intersection')
     name geologic_region              geometry
1  France               C  POLYGON ((2.5 51....
2      UK               C  POLYGON ((0.7 52 ...
3  France               B  POLYGON ((-1.7 46...
..    ...             ...                   ...
在 Python 中处理地理空间数据

Vamos praticar!

在 Python 中处理地理空间数据

Preparing Video For Download...