def world2pixel(x,y,w,h,bbox):
  """Converts world coordinates
  to image pixel coordinates"""
  # Bounding box of the map
  minx,miny,maxx,maxy=bbox
  # world x distance
  xdist=maxx-minx
  # world y distance
  ydist=maxy-miny
  # scaling factors for x,y
  xratio = w/xdist
  yratio = h/ydist
  # Calculate x,y pixel coordinate  
  px = w - ((maxx - x) * xratio)
  py = (maxy-y) * yratio 
  return int(px),int(py)