write_geopackage ¶
write_geopackage(
path: str | PathLike[str],
data: PointSet | Polylines,
*,
layer: str | None = None,
) -> None
Writes a PointSet or Polylines as a GeoPackage feature layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
The |
required |
data
|
PointSet or Polylines
|
Points are written as POINT Z, one row each. Polylines are written one row per feature: as MULTILINESTRING Z
when all parts are open, as MULTIPOLYGON Z when all are closed, rings grouped into polygons by nesting,
exteriors counter-clockwise and holes clockwise; split mixed ones by |
required |
layer
|
str
|
Feature table name, the file stem by default. A layer of that name is replaced. |
None
|
Notes
An "EPSG:<code>" CRS is stored as that EPSG spatial reference, any other as a custom one whose definition
is the CRS text, which GIS software expects as WKT. Without a CRS the layer uses the undefined Cartesian
reference (-1).
Raises:
| Type | Description |
|---|---|
InvalidInput
|
When |
used in