Menggabungkan (overlay) dataset spasial

Bekerja dengan Data Geospasial di Python

Joris Van den Bossche

Open source software developer and teacher, GeoPandas maintainer

Intersection dengan poligon

countries.intersection(circle)
Bekerja dengan Data Geospasial di Python

Intersection dengan poligon

Keterbatasan countries.intersection(circle):

  • Hanya memotong GeoSeries dengan satu poligon
  • Tidak mempertahankan atribut
Bekerja dengan Data Geospasial di Python

Menggabungkan dua dataset

countries.plot()

geologic_regions.plot()
Bekerja dengan Data Geospasial di Python

Menggabungkan dua dataset

geopandas.overlay(countries, geologic_regions, 
                  how='intersection')
Bekerja dengan Data Geospasial di Python

Overlay vs intersection

Metode intersection (dengan satu poligon)

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

Metode overlay

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...
..    ...             ...                   ...
Bekerja dengan Data Geospasial di Python

Ayo berlatih!

Bekerja dengan Data Geospasial di Python

Preparing Video For Download...