itacart.interop.cells_to_geojson

itacart.interop.cells_to_geojson(index, properties=None, include_metadata=True)[source]

Export a compositional index as a GeoJSON FeatureCollection.

One cell becomes one Feature, always, and a Feature carries a Polygon or a MultiPolygon rather than being split into two Features. The index goes into the Feature id member, which RFC 7946 section 3.2 reserves for an identifier already in common use, and is repeated in properties when metadata is asked for, because some consumers drop id on import. Coordinates are WGS84 decimal degrees and nothing else: section 4 fixes the coordinate reference system and records that alternatives were removed from the specification for interoperability reasons.

Parameters:
  • index (str) – Compositional index; every cell it names becomes a Feature.

  • properties (dict[str, Any] | None, default: None) – Extra members merged into every Feature’s properties.

  • include_metadata (bool, default: True) – Whether to add the ITACaRT metadata block.

Return type:

dict[str, Any]

Returns:

A FeatureCollection dictionary.

Raises:

NonExistentCellError – If a named cell does not exist.