code: def get_tile_properties(self, x, y, layer):
          
          try:
              assert (x >= 0 and y >= 0 and layer >= 0)
          except AssertionError:
              raise ValueError
  
          try:
              gid = self.layers[int(layer)].data[int(y)][int(x)]
          except (IndexError, ValueError):
              msg = "Coords: ({0},{1}) in layer {2} is invalid."
              logger.debug(msg.format(x, y, layer))
              raise Exception
  
          else:
              try:
                  return self.tile_properties[gid]
              except (IndexError, ValueError):
                  msg = "Coords: ({0},{1}) in layer {2} has invalid GID: {3}"
                  logger.debug(msg.format(x, y, layer, gid))
                  raise Exception
              except KeyError:
                  return None
docs: Return the tile image GID for this location
  
          :param x: x coordinate
          :param y: y coordinate
          :param layer: layer number
          :rtype: python dict if found, otherwise None