def to_geo_json_geometry(label):
    """Returns a GeoJSON ``geometry`` dict representation for the given
    location.

    Args:
        label: a :class:`fiftyone.core.labels.GeoLocation` o
            :class:`fiftyone.core.labels.GeoLocations` instance

    Returns:
        a GeoJSON dict
    """
    if isinstance(label, fol.GeoLocations):
        return _to_multi_geo_collection(label)

    if not isinstance(label, fol.GeoLocation):
        return None

    num_shapes = (
        int(label.point is not None)
        + int(label.line is not None)
        + int(label.polygon is not None)
    )

    if num_shapes == 0:
        return None

    if num_shapes == 1:
        return _to_geo_primitive(label)

    return _to_geo_collection(label)
Returns a GeoJSON ``geometry`` dict representation for the given
    location.

    Args:
        label: a :class:`fiftyone.core.labels.GeoLocation` o
            :class:`fiftyone.core.labels.GeoLocations` instance

    Returns:
        a GeoJSON dict
    
fiftyone/utils/geojson.py