code: def get_allowed_geometries(layer_purpose_key):
      
      preferred_order = [
          'point',
          'line',
          'polygon',
          'raster'
      ]
      allowed_geometries = set()
      all_layer_type = []
      if layer_purpose_key == layer_purpose_hazard['key']:
          all_layer_type = hazard_all
      elif layer_purpose_key == layer_purpose_exposure['key']:
          all_layer_type = exposure_all
  
      for layer in all_layer_type:
          for allowed_geometry in layer['allowed_geometries']:
              allowed_geometries.add(allowed_geometry)
  
      allowed_geometries = list(allowed_geometries)
      allowed_geometries_definition = []
      for allowed_geometry in allowed_geometries:
          allowed_geometries_definition.append(definition(allowed_geometry))
  
      # Adapted from http://stackoverflow.com/a/15650556/1198772
      order_dict = {color: index for index, color in enumerate(preferred_order)}
      allowed_geometries_definition.sort(key=lambda x: order_dict[x["key"]])
  
      return allowed_geometries_definition
docs: Helper function to get all possible geometry
  
      :param layer_purpose_key: A layer purpose key.
      :type layer_purpose_key: str
  
      :returns: List of all allowed geometries.
      :rtype: list