A Livebook Smart Cell that reads a spatial file into a GeoFrame.GeoDataFrame.
Add it from the Livebook cell menu (Smart > Read spatial file). It is registered
when the :geoframe application starts and Kino is available.
Fields:
- Assign to - the variable that receives the frame (default
gdf). - Path - the file to read; relative paths resolve from the notebook's working directory.
- Driver -
autopicks the format from the extension; otherwise one ofparquet,geojson,flatgeobuf,feather,shapefile,gpkg. SeeGeoFrame.read_file/2. - Layer - for a GeoPackage, chosen from
GeoFrame.list_layers/2once the file exists. - Bounding box - optional
minx, miny, maxx, maxy, passed asbbox:(every format but Feather, which raises on it). - Reproject to - optional target CRS, such as
EPSG:3857or3857. - Show map - ends the cell with
GeoFrame.Kino.deck/2.
The cell generates code such as:
gdf = GeoFrame.read_file!("data/places.gpkg", layer: "places")
gdf = GeoFrame.GeoDataFrame.to_crs(gdf, 3857)
GeoFrame.Kino.deck(gdf)