Skip to content

GeoJSON

A GeoJSON object represents a Feature or collection of Features.

topojson.GeoJSON

topojson.GeoJSON_FeatureCollection

A collection of features.

features instance-attribute

features: list[GeoJSON_Feature]

write

write(file: str)

Write expression to json.

Parameters:

Name Type Description Default

file

str

Path to a file

required

Raises:

Type Description
RuntimeError

When serialization fails

OsError

When the file cannot be written

topojson.GeoJSON_Feature

A feature represents points, curves, and surfaces in coordinate space.

bbox instance-attribute

bbox: Optional[list[float]]

geometry instance-attribute

id instance-attribute

id: Optional[str]

properties instance-attribute

properties: Optional[str]

write

write(file: str)

Write expression to json.

Parameters:

Name Type Description Default

file

str

Path to a file

required

Raises:

Type Description
RuntimeError

When serialization fails

OsError

When the file cannot be written