geopandas
Python library for working with geospatial vector data including shapefiles, GeoJSON, and GeoPackage files. Use when working with geographic data for spatial analysis, geometric operations, coordinate transformations, spatial joins, overlay operations, choropleth mapping, or any
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Python library for working with geospatial vector data including shapefiles, GeoJSON, and GeoPackage files. Use when working with geographic data for spatial analysis, geometric operations, coordinate transformations, spatial joins, overlay operations, choropleth mapping, or any task involving reading/writing/analyzing vector geographic data. Supports PostGIS databases, interactive maps, and integration with matplotlib/folium/cartopy. Use for tasks like buffer analysis, spatial joins between datasets, dissolving boundaries, clipping data, calculating areas/distances, reprojecting coordinate systems, creating maps, or converting between spatial file formats.
How to use
Zainstaluj GeoPandas za pomocą polecenia
uv pip install geopandas. W zależności od potrzeb dodaj opcjonalne zależności:foliumdo map interaktywnych,psycopg2igeoalchemy2do baz PostGIS,cartopydo projekcji kartograficznych, lubcontextilydo map bazowych.Wczytaj dane geograficzne z pliku GeoJSON, shapefile lub GeoPackage używając
gpd.read_file("ścieżka_do_pliku"). Funkcja automatycznie rozpoznaje format i zwraca GeoDataFrame — tabelę z kolumną geometrii.Zbadaj strukturę danych: wyświetl pierwsze wiersze za pomocą
.head(), sprawdź system współrzędnych (CRS) metodą.crs, lub zobacz typy geometrii przez.geometry.geom_type.Wykonaj operacje przestrzenne: zmień system współrzędnych za pomocą
.to_crs()(niezbędne do dokładnych obliczeń powierzchni), oblicz pola geometrii przez.geometry.area, wykonaj spatial joiny lub operacje nakładania się danych, lub utwórz mapę wywołując.plot().Zapisz wyniki do pliku za pomocą
.to_file()— obsługuje GeoPackage, shapefile, GeoJSON i inne formaty wektorowe.