def METHOD_NAME(request: pyramid.request.Request, treeitem: TreeGroup) -> Optional[str]:
    """Get the tree item editing URL."""
    if treeitem.item_type is None:
        return None
    table = ITEM_TYPE_ROUTE_MAP.get(treeitem.item_type, None)
    if table is None:
        LOG.warning("%s not found in ITEM_TYPE_ROUTE_MAP", treeitem.item_type)
        return None
    return request.route_url(  # type: ignore
        "c2cgeoform_item",
        table=ITEM_TYPE_ROUTE_MAP[treeitem.item_type],
        id=treeitem.id,
    )