# `GeoFrame.GeoDataFrame`
[🔗](https://github.com/CountlinkX-Solutions/geoframe/blob/v0.3.4/lib/geo_frame/geo_data_frame.ex#L1)

A dataframe of attributes paired with a geometry column.

A `%GeoDataFrame{}` holds an `Explorer.DataFrame` with the attribute columns only and a
`GeoFrame.GeoSeries` with the geometries, which live in Rust memory. The geometry column
is *not* part of the Explorer dataframe; it has a name (`:geometry_column`, default
`"geometry"`) that is reserved among the attribute names.

## Several geometry columns

Like a GeoPandas frame with more than one `geometry` dtype column, a frame has one *active*
geometry (`geometry/1`, the one every spatial operation uses) and any number of *secondary*
geometry columns, each a `GeoFrame.GeoSeries` with its own CRS. `put_geometry/3` adds one,
`set_geometry/3` makes another column the active one, `pull/2` returns one by name and
`geometry_columns/1` lists them (active first). Row operations (`take/2`, `filter_with/2`,
`sort_with/2`, `join/3`, `concat_rows/1`, `explode/2`, ...) keep every geometry column
aligned; `to_crs/2` and `set_crs/2` act on the active one, as in GeoPandas. GeoParquet,
Feather and Arrow read and write all of them (`GeoFrame.read_parquet/2`,
`GeoFrame.write_parquet/3`, `GeoFrame.write_feather/3`, `to_arrow/2`), and the formats with
one geometry per feature (GeoPackage, GeoJSON, FlatGeobuf, Shapefile, PostGIS, `to_json/2`)
raise `ArgumentError` for such a frame, as GeoPandas `to_file` raises `ValueError`. `clip/3`, `overlay/3`, `sjoin/3`,
`sjoin_nearest/3` and `dissolve/2` carry them like GeoPandas (other geometry columns are
ordinary columns there): kept with their rows and CRS, suffixed on a name clash, null for
rows without a partner, aggregated by `dissolve/2` with `:first`, `:last` or `:count`.

## Row alignment

Every operation that changes rows computes the row positions once and applies them to
both sides (`GeoSeries.take/2` and `Explorer.DataFrame.slice/2`), so attribute and
geometry rows can never drift apart. `filter_with/2` and `sort_with/2` add a temporary
row-position column to the attributes, let Explorer do the work, read the resulting
positions back, and remove the column again. The temporary column is invisible in the
result, and its name is chosen so that it cannot collide with an existing column.

## Column order

`names/1`, `to_explorer/2`, and the `Table.Reader` view list the attribute columns in
their dataframe order and the geometry column last.

## Example

    iex> data = Explorer.DataFrame.new(id: [1, 2])
    iex> geometry = GeoFrame.GeoSeries.from_wkt!(["POINT (0 0)", "POINT (5 5)"])
    iex> gdf = GeoFrame.GeoDataFrame.new(data, geometry)
    iex> GeoFrame.GeoDataFrame.names(gdf)
    ["id", "geometry"]

# `t`

```elixir
@type t() :: %GeoFrame.GeoDataFrame{
  data: Explorer.DataFrame.t(),
  geometry: GeoFrame.GeoSeries.t(),
  geometry_column: String.t(),
  secondary_geometries: [{String.t(), GeoFrame.GeoSeries.t()}]
}
```

# `area`

```elixir
@spec area(t()) :: Explorer.Series.t()
```

Planar area per row as a series.

# `bounds`

```elixir
@spec bounds(t()) :: Explorer.DataFrame.t()
```

Per-row bounds as a dataframe (`minx`, `miny`, `maxx`, `maxy`).

# `centroid`

```elixir
@spec centroid(t()) :: t()
```

Returns the frame with its geometry replaced by the centroids.

# `clip`

```elixir
@spec clip(t(), term(), keyword()) :: t()
```

Clips to a mask; see `GeoFrame.Overlay.clip/3`.

# `concat_rows`

```elixir
@spec concat_rows([t()]) :: t()
```

Stacks frames row-wise, like `pandas.concat`/`GeoDataFrame` concatenation.

Attribute columns follow `Explorer.DataFrame.concat_rows/1` (same names and compatible
dtypes, else it raises). Every frame must use the same geometry column name and CRS, or
`ArgumentError` is raised. The CRS check runs before any data is copied.

# `crs`

```elixir
@spec crs(t()) :: String.t() | nil
```

The CRS of the geometry, or `nil`.

# `cx`

```elixir
@spec cx(t(), number() | nil, number() | nil, number() | nil, number() | nil) :: t()
```

Rows whose geometry intersects the box, like GeoPandas `gdf.cx[xmin:xmax, ymin:ymax]`.
`nil` bounds are unbounded; see `GeoFrame.GeoSeries.cx/5`. Attributes stay aligned.

# `data`

```elixir
@spec data(t()) :: Explorer.DataFrame.t()
```

The attribute dataframe (without geometry).

# `discard`

```elixir
@spec discard(t(), term()) :: t()
```

Drops attribute columns (anything `Explorer.DataFrame.discard/2` accepts), and the
secondary geometry columns it names. The active geometry is never discarded, and naming it
in `columns` is harmless, like in `select/2`.

# `dissolve`

```elixir
@spec dissolve(t(), keyword()) :: t()
```

Group-wise union with attribute aggregation; see `GeoFrame.Dissolve.dissolve/2`.

# `distinct`

```elixir
@spec distinct(t(), term()) :: t()
```

Keeps the first row of each distinct combination of attribute values, like
`Explorer.DataFrame.distinct/2`; the geometry follows its row.

`columns` (default all attribute columns) selects the columns compared; the geometry is
never compared, and naming it is harmless.

# `drop_nil`

```elixir
@spec drop_nil(t(), term()) :: t()
```

Drops rows with a null in any of `columns` (default all attribute columns), like
`Explorer.DataFrame.drop_nil/2`. A null geometry does not count; check it with
`GeoFrame.GeoSeries.notna/1` with `take/2` if needed.

# `dtypes`

```elixir
@spec dtypes(t()) :: %{required(String.t()) =&gt; atom() | tuple()}
```

Column dtypes by name; the geometry column maps to `:geometry`.

# `estimate_utm_crs`

```elixir
@spec estimate_utm_crs(t(), keyword()) :: String.t()
```

The UTM CRS for the geometry's extent. See `GeoFrame.GeoSeries.estimate_utm_crs/2`.

# `explode`

```elixir
@spec explode(t(), keyword()) :: t()
```

Splits multi-part geometries and collections into one row per part, like
`GeoDataFrame.explode`. The attributes of a row are repeated for each of its parts.

`GeoSeries.explode/2` explains which geometries have parts: rows whose geometry is null or an
empty multi-geometry disappear.

pandas keeps the source row in the index (a MultiIndex of source row and part number when
`index_parts=True`). A frame has no index, so the same information becomes plain columns,
placed first:

  * `index` - the zero-based position of the source row (`s64`); omitted with
    `ignore_index: true`;
  * `part` - the zero-based number of the part within its source row; only with
    `index_parts: true`, whatever `ignore_index` says.

Options: `:index_parts` (default `false`), `:ignore_index` (default `false`). Raises
`ArgumentError` if an attribute is already called `index` or `part` and the column would be
added.

# `filter`
*macro* 

Keeps rows matching a query, like `Explorer.DataFrame.filter/2`.

Expands to `filter_with/2` with `Explorer.Query.query/1`, so `require` this module first.
The query sees the attribute columns only: the geometry is not a column in it. Use `^`
to interpolate Elixir values.

    require GeoFrame.GeoDataFrame
    limit = 10
    GeoFrame.GeoDataFrame.filter(gdf, pop > ^limit)

# `filter_with`

```elixir
@spec filter_with(t(), (Explorer.DataFrame.t() -&gt; Explorer.Series.t())) :: t()
```

Keeps rows for which `fun` is true, like `Explorer.DataFrame.filter_with/2`.

`fun` receives the attribute dataframe (as a lazy dataframe) and returns a boolean
lazy series. The geometry is filtered by the same row positions.

# `from_arrow`

```elixir
@spec from_arrow(binary(), keyword()) :: {:ok, t()} | {:error, String.t()}
```

Decodes an Arrow IPC stream into a frame; see `GeoFrame.GeoSeries.from_arrow/2` for the
accepted geometry encodings. All other columns become attributes.

Options: `:columns` - attribute columns to keep; `:geometry` - the geometry column when it
cannot be detected; `:crs` - a CRS used only when the data carries none.

# `from_arrow!`

```elixir
@spec from_arrow!(binary(), keyword()) :: t()
```

Like `from_arrow/2` but raises `ArgumentError` on failure.

# `from_features`

```elixir
@spec from_features([map()] | map(), keyword()) :: {:ok, t()} | {:error, String.t()}
```

Builds a frame from GeoJSON-like features, like GeoPandas `GeoDataFrame.from_features`.

`features` is a list of feature maps (`%{"type" => "Feature", "properties" => ..,
"geometry" => ..}`) or a `FeatureCollection` map; string or atom keys both work. A bare
geometry map counts as one feature. Property types are inferred over all features exactly
as `GeoFrame.read_geojson/2` does (booleans, `s64`, `f64`, otherwise strings; nested values
as JSON text; a feature `id` becomes a leading `"id"` column when every feature has one).
A `nil` geometry is a null row. Property columns follow their first appearance across the
features (as GeoPandas does) when the properties are *ordered*: a keyword list or a list of
`{key, value}` pairs, or JSON decoded with `Jason.decode!(json, objects: :ordered_objects)`.
Plain Elixir maps have no insertion order, so their columns appear sorted by name; use
`:columns` to choose the order explicitly. (The geometry column comes last, as in every
`GeoDataFrame` here, where GeoPandas puts it first.)

Options:

  * `:crs` - the CRS of the geometries, `nil` by default (GeoPandas default; GeoJSON files
    read with `read_geojson/2` get `"OGC:CRS84"` instead).
  * `:columns` - property columns to keep, in that order; an unknown name is an error.
  * `:geometry_column` - name of the geometry column (default `"geometry"`).

Returns `{:error, message}` for input that is not valid GeoJSON.

# `from_features!`

```elixir
@spec from_features!([map()] | map(), keyword()) :: t()
```

Like `from_features/2` but raises `ArgumentError` on failure.

# `from_postgis`

```elixir
@spec from_postgis(term(), String.t(), keyword()) :: {:ok, t()} | {:error, String.t()}
```

GeoPandas `GeoDataFrame.from_postgis`: alias of `GeoFrame.read_postgis/3`.

# `from_wkb`

```elixir
@spec from_wkb(Explorer.DataFrame.t(), String.t(), keyword()) ::
  {:ok, t()} | {:error, String.t()}
```

Moves a WKB binary column of `df` into the geometry. Same options as `from_wkt/3`.

# `from_wkb!`

```elixir
@spec from_wkb!(Explorer.DataFrame.t(), String.t(), keyword()) :: t()
```

Like `from_wkb/3` but raises `ArgumentError` on failure.

# `from_wkt`

```elixir
@spec from_wkt(Explorer.DataFrame.t(), String.t(), keyword()) ::
  {:ok, t()} | {:error, String.t()}
```

Moves a WKT string column of `df` into the geometry.

The geometry column keeps the source column's name unless `:geometry_column` is given.
Options: `:crs`, `:geometry_column`.

# `from_wkt!`

```elixir
@spec from_wkt!(Explorer.DataFrame.t(), String.t(), keyword()) :: t()
```

Like `from_wkt/3` but raises `ArgumentError` on failure.

# `geometry`

```elixir
@spec geometry(t()) :: GeoFrame.GeoSeries.t()
```

The geometry series.

# `geometry_columns`

```elixir
@spec geometry_columns(t()) :: [String.t()]
```

Names of the geometry columns: the active one first, then the secondary ones.

# `group_by`

```elixir
@spec group_by(t(), term()) :: t()
```

Marks the groups of a frame; see `GeoFrame.GroupBy`.

# `group_map`

```elixir
@spec group_map(t(), term(), (t() -&gt; t() | Explorer.DataFrame.t()), keyword()) ::
  t() | Explorer.DataFrame.t()
```

Applies a function per group and concatenates the results; see `GeoFrame.GroupBy.group_map/4`.

# `groups`

```elixir
@spec groups(t()) :: [String.t()]
```

The names of the grouping columns; see `GeoFrame.GroupBy`.

# `head`

```elixir
@spec head(t(), non_neg_integer()) :: t()
```

The first `n` rows (default 5); on a grouped frame (`group_by/2`) the first `n` rows of each
group, in the original row order (as pandas `groupby.head`).

# `is_geographic`

```elixir
@spec is_geographic(t()) :: boolean() | nil
```

Whether the CRS is geographic. See `GeoFrame.GeoSeries.is_geographic/1`.

# `join`

```elixir
@spec join(t(), Explorer.DataFrame.t() | t(), keyword()) :: t()
```

Joins attributes of `right` onto the rows of `left`, like GeoPandas `GeoDataFrame.merge`.

`right` is an `Explorer.DataFrame` or a `GeoFrame.GeoDataFrame`; for the latter only the
attributes are used and its geometry is dropped (a frame has a single geometry column).
The geometry always comes from `left`: it follows its rows, is repeated for duplicated keys
and is `nil` for rows that exist only on the right (`how: :right` and `:outer`).

Options go to `Explorer.DataFrame.join/3` (`:on`, `:how`, `:suffix`, ...); `:how` is one of
`:inner` (default), `:left`, `:right`, `:outer` or `:cross`. Raises `ArgumentError` when
`:on` names the geometry column or the result would contain a column with its name.

Known deviations from pandas: `:outer` lists left-only rows last (pandas sorts them by
key) and Polars does not coalesce the key, so `:outer` yields `"k"` (nil for right-only
rows) plus `"k_right"`; `:inner`, `:left` and `:right` match pandas row for row. Each row
keeps the geometry of its own left row either way.

# `length`

```elixir
@spec length(t()) :: Explorer.Series.t()
```

Planar length (perimeter for polygons) per row as a series.

# `mutate`
*macro* 

Adds or replaces attribute columns from a query, like `Explorer.DataFrame.mutate/2`.

Expands to `mutate_with/2` with `Explorer.Query.query/1`. The query sees the attribute
columns only. Raises `ArgumentError` if the result would contain the geometry column's name.

# `mutate_with`

```elixir
@spec mutate_with(t(), (Explorer.DataFrame.t() -&gt; keyword() | map())) :: t()
```

Adds or replaces attribute columns via `Explorer.DataFrame.mutate_with/2`.

Raises `ArgumentError` if the result would contain the geometry column's name.

# `n_columns`

```elixir
@spec n_columns(t()) :: non_neg_integer()
```

Number of columns, counting the geometry columns.

# `n_rows`

```elixir
@spec n_rows(t()) :: non_neg_integer()
```

Number of rows.

# `names`

```elixir
@spec names(t()) :: [String.t()]
```

Attribute column names followed by the geometry column names (active first).

# `new`

```elixir
@spec new(Explorer.DataFrame.t(), GeoFrame.GeoSeries.t(), keyword()) :: t()
```

Pairs an attribute dataframe with a geometry series.

Options: `:geometry_column` - the geometry column name (default `"geometry"`).

Raises `ArgumentError` when row counts differ or `data` already has a column with the
geometry column's name. A `data` without columns is accepted for any row count.

# `overlay`

```elixir
@spec overlay(t(), t(), keyword()) :: t()
```

Spatial overlay with another frame; see `GeoFrame.Overlay.overlay/3`.

# `pull`

```elixir
@spec pull(t(), String.t() | atom() | integer()) ::
  Explorer.Series.t() | GeoFrame.GeoSeries.t()
```

An attribute column as a series. The name of a geometry column (active or secondary)
returns its `GeoFrame.GeoSeries` instead.

# `put`

```elixir
@spec put(t(), String.t() | atom(), Explorer.Series.t() | list() | Nx.Tensor.t()) ::
  t()
```

Adds or replaces the attribute column `name` with a series, list, or tensor, like
`Explorer.DataFrame.put/4`. Raises `ArgumentError` for the geometry column's name or a
value whose length differs from the row count.

# `put_geometry`

```elixir
@spec put_geometry(t(), String.t() | atom(), GeoFrame.GeoSeries.t()) :: t()
```

Adds the secondary geometry column `name`, or replaces the one with that name.

Raises `ArgumentError` when `series` does not have one row per frame row or `name` is an
attribute or the active geometry column. A secondary column keeps its own CRS.

# `rename`

```elixir
@spec rename(t(), term()) :: t()
```

Renames attribute columns via `Explorer.DataFrame.rename/2`. Raises `ArgumentError` if a
new name equals the geometry column's name.

# `rename_geometry`

```elixir
@spec rename_geometry(t(), String.t() | atom()) :: t()
```

Renames the active geometry column, like GeoPandas `GeoDataFrame.rename_geometry`.

Raises `ArgumentError` (`"Column named <name> already exists"`) when the frame already has a
column with that name, the geometry column itself included.

# `sample`

```elixir
@spec sample(t(), number(), keyword()) :: t()
```

A random sample of rows, like `Explorer.DataFrame.sample/3`: `n_or_frac` is a row count
or a fraction. Options (`:replace`, `:shuffle`, `:seed`) are passed through. On a grouped
frame (`group_by/2`) each group is sampled (`n_or_frac` per group), as Explorer does; the
order of the groups in the result is unspecified.

# `select`

```elixir
@spec select(t(), term()) :: t()
```

Selects attribute columns (anything `Explorer.DataFrame.select/2` accepts). The active
geometry is always kept, and naming it in `columns` is harmless. A secondary geometry
column is kept only when `columns` names it.

# `set_crs`

```elixir
@spec set_crs(t(), String.t() | pos_integer() | nil, keyword()) :: t()
```

Replaces the CRS metadata without reprojecting; `crs` is a string, an integer EPSG code or
`nil`. A different existing CRS raises unless `allow_override: true`.
See `GeoFrame.GeoSeries.set_crs/3`.

# `set_geometry`

```elixir
@spec set_geometry(t(), String.t() | atom() | GeoFrame.GeoSeries.t(), keyword()) ::
  t()
```

Makes another geometry column the active one, like GeoPandas `set_geometry`.

`column` is the name of a secondary geometry column, or a `GeoFrame.GeoSeries` that becomes
a new column named by the `:geometry_column` option (default `"geometry"`, or the active
name when that is free). The previous active column stays as a secondary one.

Options: `:drop` - `true` removes the previous active geometry column (default `false`);
`:geometry_column` - the name for a series. Raises `ArgumentError` for a name that is not a
geometry column of the frame.

# `shape`

```elixir
@spec shape(t()) :: {non_neg_integer(), non_neg_integer()}
```

`{rows, columns}`, counting the geometry column.

# `shuffle`

```elixir
@spec shuffle(t(), keyword()) :: t()
```

Randomly reorders the rows; `opts` (`:seed`) are passed through.

# `sjoin`

```elixir
@spec sjoin(t(), t(), keyword()) :: t()
```

Spatial join; see `GeoFrame.SpatialJoin.sjoin/3`.

# `sjoin_nearest`

```elixir
@spec sjoin_nearest(t(), t(), keyword()) :: t()
```

Nearest spatial join; see `GeoFrame.SpatialJoin.sjoin_nearest/3`.

# `slice`

```elixir
@spec slice(t(), integer(), non_neg_integer()) :: t()
```

Rows from `offset` for `length` rows, with `Explorer.DataFrame.slice/3` semantics.

On a grouped frame (`group_by/2`) the slice is taken within each group, as Explorer does;
the rows come back in their original order.

# `sort_by`
*macro* 

Sorts rows by a query, like `Explorer.DataFrame.sort_by/3`; `opts` are passed through.

Expands to `sort_with/3` with `Explorer.Query.query/1`. The query sees the attribute
columns only, and the geometry follows its row.

# `sort_with`

```elixir
@spec sort_with(t(), (Explorer.DataFrame.t() -&gt; term()), keyword()) :: t()
```

Sorts rows like `Explorer.DataFrame.sort_with/3`; `opts` are passed through.

# `summarise`

```elixir
@spec summarise(t(), keyword() | map(), keyword()) :: t()
```

Aggregates every group into one row, attributes and geometry; see `GeoFrame.GroupBy`.

# `tail`

```elixir
@spec tail(t(), non_neg_integer()) :: t()
```

The last `n` rows (default 5); on a grouped frame the last `n` rows of each group, in the
original row order (as pandas `groupby.tail`).

# `take`

```elixir
@spec take(t(), [non_neg_integer()]) :: t()
```

Selects rows by zero-based position; repeats and reordering are allowed.

# `to_arrow`

```elixir
@spec to_arrow(t(), keyword()) :: binary()
```

Encodes the frame as an Arrow IPC **stream** (a binary): the attribute columns followed by
the geometry columns (the active one first, then the secondary ones, each with its own CRS),
whose fields carry GeoArrow extension metadata with the CRS as
PROJJSON (and a GeoParquet-style `geo` entry in the schema metadata). GeoPandas reads it
with `GeoDataFrame.from_arrow(pyarrow.ipc.open_stream(bytes).read_all())`.

Options: `:geometry_encoding` - `:wkb` (default) or `:geoarrow`; see
`GeoFrame.GeoSeries.to_arrow/2`; `:record_batch_size` - rows per record batch (positive
integer, default 65 536). Failures raise `ArgumentError`.

# `to_crs`

```elixir
@spec to_crs(t(), String.t() | pos_integer()) :: t()
```

Reprojects the geometry to `target` (`"EPSG:<code>"`, `"OGC:CRS84"` or an integer EPSG
code); attributes are untouched. See `GeoFrame.GeoSeries.to_crs/2`.

# `to_explorer`

```elixir
@spec to_explorer(t(), keyword()) :: Explorer.DataFrame.t()
```

Converts to an `Explorer.DataFrame` with the geometry columns last (active first).

Options: `:encoding` - `:wkb` (default, binary column) or `:wkt` (string column). See
`to_wkb/2` and `to_wkt/2`.

# `to_geo_dict`

```elixir
@spec to_geo_dict(t(), keyword()) :: map()
```

The frame as a GeoJSON-like map, like GeoPandas `GeoDataFrame.to_geo_dict`. It is
`to_geo_interface/1` with options, and its defaults differ: no bboxes.

Options: `:na` - `:null` (default) keeps missing properties as `nil`, `:drop` omits them,
`:keep` leaves values as Explorer yields them (`nil`, `:nan`); `:show_bbox` (default `false`);
`:drop_id` (default `false`). Unknown options raise `ArgumentError`.

# `to_geo_interface`

```elixir
@spec to_geo_interface(t()) :: map()
```

The `__geo_interface__` of the frame: a `FeatureCollection` map (string keys) with `id`,
`properties`, `geometry` and `bbox` per feature, and the collection `bbox`; missing values
are `nil`. Secondary geometry columns are properties holding GeoJSON geometry maps (GeoPandas
keeps the shapely objects there, which Elixir has no equivalent of).

See `to_geo_dict/2` for the variant with options.

# `to_geojson`

```elixir
@spec to_geojson(t()) :: map()
```

The frame as a GeoJSON `FeatureCollection` map (RFC 7946).

Each row is a `Feature`: the geometry (see `GeoFrame.GeoSeries.to_geojson/1`, `nil` for
null or unrepresentable rows) plus the attribute columns as string-keyed `properties`.
Null attributes are kept as `nil`. A secondary geometry column becomes a property holding
its GeoJSON geometry map (GeoPandas keeps the shapely object there). Property values are the Elixir values Explorer yields
(dates, decimals, ...), so they encode with `Jason` for the common column types.

# `to_json`

```elixir
@spec to_json(t(), keyword()) :: String.t()
```

The frame as a GeoJSON `FeatureCollection` string, like GeoPandas `GeoDataFrame.to_json`.

Each row is a `Feature` with a string `id` (the row position), the attribute columns as
`properties`, the `geometry` (`null` for null or unrepresentable rows) and, with
`show_bbox`, its `bbox`. A frame with secondary geometry columns raises `ArgumentError`, as
GeoPandas raises `TypeError` (a shape is not JSON serializable). Missing values (`nil`, NaN) are `null`. A CRS other than EPSG:4326
adds the `crs` member as GeoPandas does; see `GeoFrame.GeoSeries.to_json/2`.

Options: `:na` - `:null` (default) keeps missing properties as `null`, `:drop` omits them
(`:keep` is rejected: it would emit NaN, which is not JSON); `:show_bbox` (default
`false`); `:drop_id` (default `false`); `:to_wgs84` (default `false`).

# `to_postgis`

```elixir
@spec to_postgis(t(), term(), String.t(), keyword()) :: :ok | {:error, String.t()}
```

GeoPandas `GeoDataFrame.to_postgis`: alias of `GeoFrame.to_postgis/4`.

# `to_wkb`

```elixir
@spec to_wkb(t(), keyword()) :: Explorer.DataFrame.t()
```

Every geometry column, the active one and the secondary ones, encoded as WKB in an
`Explorer.DataFrame`; the attribute columns are unchanged and the geometry columns come last
(active first). Like GeoPandas `GeoDataFrame.to_wkb`; null geometries stay `nil`.

Options: `:hex` (default `false`) gives upper-case hexadecimal strings instead of binaries,
and `:srid` (an integer, or `true` for each column's own `EPSG:` CRS) gives PostGIS EWKB; see
`GeoFrame.GeoSeries.to_wkb/2`.

# `to_wkt`

```elixir
@spec to_wkt(t(), keyword()) :: Explorer.DataFrame.t()
```

Every geometry column encoded as WKT strings in an `Explorer.DataFrame`, like GeoPandas
`GeoDataFrame.to_wkt`; see `to_wkb/2` for the layout. Takes no options (GeoPandas passes
its keyword arguments to shapely, such as `rounding_precision`, which are not supported).

# `ungroup`

```elixir
@spec ungroup(t(), term()) :: t()
```

Removes the groups (all, or the named ones); see `GeoFrame.GroupBy`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
