from osmviz.manager import PILImageManager, OSMManager
import PIL.Image as Image


def test_pil():
    imgr = PILImageManager("RGB")
    osm = OSMManager(image_manager=imgr)
    image, bnds = osm.createOSMImage((30, 35, -117, -112), 9)
    wh_ratio = float(image.size[0]) / image.size[1]
    image2 = image.resize((int(800 * wh_ratio), 800), Image.ANTIALIAS)
    del image
    image2.show()


if __name__ == "__main__":
    test_pil()

# End of file

from osmviz.manager import PILImageManager, OSMManager
import PIL.Image as Image


def test_pil():
    image_manager = PILImageManager("RGB")
    osm = OSMManager(image_manager=image_manager)
    image, bounds = osm.createOSMImage((30, 31, -117, -116), 9)
    wh_ratio = float(image.size[0]) / image.size[1]
    image2 = image.resize((int(800 * wh_ratio), 800), Image.ANTIALIAS)
    del image
    image2.show()


if __name__ == "__main__":
    test_pil()

# End of file

Reduce number of tiles downloaded
Reduce number of tiles downloaded

  from osmviz.manager import PILImageManager, OSMManager
  import PIL.Image as Image
  
  
  def test_pil():
-     imgr = PILImageManager("RGB")
+     image_manager = PILImageManager("RGB")
-     osm = OSMManager(image_manager=imgr)
+     osm = OSMManager(image_manager=image_manager)
-     image, bnds = osm.createOSMImage((30, 35, -117, -112), 9)
+     image, bounds = osm.createOSMImage((30, 31, -117, -116), 9)
      wh_ratio = float(image.size[0]) / image.size[1]
      image2 = image.resize((int(800 * wh_ratio), 800), Image.ANTIALIAS)
      del image
      image2.show()
  
  
  if __name__ == "__main__":
      test_pil()
  
  # End of file
  
Reduce number of tiles downloaded
## Code Before:
from osmviz.manager import PILImageManager, OSMManager
import PIL.Image as Image


def test_pil():
    imgr = PILImageManager("RGB")
    osm = OSMManager(image_manager=imgr)
    image, bnds = osm.createOSMImage((30, 35, -117, -112), 9)
    wh_ratio = float(image.size[0]) / image.size[1]
    image2 = image.resize((int(800 * wh_ratio), 800), Image.ANTIALIAS)
    del image
    image2.show()


if __name__ == "__main__":
    test_pil()

# End of file

## Instruction:
Reduce number of tiles downloaded
## Code After:
from osmviz.manager import PILImageManager, OSMManager
import PIL.Image as Image


def test_pil():
    image_manager = PILImageManager("RGB")
    osm = OSMManager(image_manager=image_manager)
    image, bounds = osm.createOSMImage((30, 31, -117, -116), 9)
    wh_ratio = float(image.size[0]) / image.size[1]
    image2 = image.resize((int(800 * wh_ratio), 800), Image.ANTIALIAS)
    del image
    image2.show()


if __name__ == "__main__":
    test_pil()

# End of file
