Skip to main content
Returns a GeoJSON representation of the GeoDataFrame as a string.

Signature

Parameters

Literal['null', 'drop', 'keep']
default:"'null'"
Dictates how to represent missing (NaN) values in the output.
  • null: Outputs missing entries as JSON null.
  • drop: Removes the entire property from a feature if its value is missing.
  • keep: Outputs missing entries as NaN.
bool
default:"False"
If True, the bbox (bounds) of the geometries is included in the output.
bool
default:"False"
If True, the GeoDataFrame index is not written to the ‘id’ field of each GeoJSON Feature.
bool
default:"False"
If True, all geometries are transformed to WGS84 (EPSG:4326) to meet the 2016 GeoJSON specification. When False, the current CRS is exported if it’s set.
Additional keyword arguments passed to json.dumps().

Returns

str
A GeoJSON representation of the GeoDataFrame.
See also
  • GeoDataFrame.to_file: Write a GeoDataFrame to a file, which can be
  • used for GeoJSON format.
See also
  • GeoDataFrame.to_file: write GeoDataFrame to file

Examples