> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GeoSeries.to_json

> Returns a GeoJSON string representation of the GeoSeries.

Returns a GeoJSON string representation of the GeoSeries.

## Signature

```python theme={"system"}
to_json(
    show_bbox: bool = True,
    drop_id: bool = False,
    to_wgs84: bool = False,
    **kwargs,
) -> str
```

## Parameters

<ParamField path="show_bbox" type="bool" default="True">
  Include bbox (bounds) in the geojson
</ParamField>

<ParamField path="drop_id" type="bool" default="False">
  Whether to retain the index of the GeoSeries as the id property
  in the generated GeoJSON. Default is False, but may want True
  if the index is just arbitrary row numbers.
</ParamField>

<ParamField path="to_wgs84" type="bool" default="False">
  If the CRS is set on the active geometry column it is exported as
  WGS84 (EPSG:4326) to meet the [2016 GeoJSON specification](https://tools.ietf.org/html/rfc7946).
  Set to True to force re-projection and set to False to ignore CRS. False by
  default.
</ParamField>

<ParamField path="Note" />

<ParamField path="with" />

<ParamField path="kwargs" />

## Returns

<ResponseField name="return" type="JSON string" />

**See also**

* `GeoSeries.to_file`: write GeoSeries to file

## Examples

```python theme={"system"}
>>> from sedona.spark.geopandas import GeoSeries
>>> from shapely.geometry import Point
>>> s = GeoSeries([Point(1, 1), Point(2, 2), Point(3, 3)])
>>> s
0    POINT (1 1)
1    POINT (2 2)
2    POINT (3 3)
dtype: geometry
```

```python theme={"system"}
>>> s.to_json()
'{"type": "FeatureCollection", "features": [{"id": "0", "type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [1.0, 1.0]}, "bbox": [1.0, 1.0, 1.0, 1.0]}, {"id": "1", "type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [2.0, 2.0]}, "bbox": [2.0, 2.0, 2.0, 2.0]}, {"id": "2", "type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [3.0, 3.0]}, "bbox": [3.0, 3.0, 3.0, 3.0]}], "bbox": [1.0, 1.0, 3.0, 3.0]}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.