1

Trying to use kivy.garden.mapview, obviously this is still a work in progress, but was wondering if the problem might be in kivy/core/image/img_pygame.py

Do kivy/pygame support .png images?

-B

   [DEBUG             ] [ImagePygame ] Load <cache\osm_18_131070.5_131070.0.png>
   [WARNING           ] [Image       ] Unable to load image <cache\osm_18_131070.5_131070.0.png>
   [INFO              ] [Base        ] Leaving application in progress...
 Traceback (most recent call last):
   File "C:\Users\Brendan\Documents\oldfiles\ShorePark.py", line 306, in <module>
     ShorePark().run()
   File "C:\Python34\lib\site-packages\kivy\app.py", line 792, in run
     runTouchApp()
   File "C:\Python34\lib\site-packages\kivy\base.py", line 481, in runTouchApp
     EventLoop.window.mainloop()
   File "C:\Python34\lib\site-packages\kivy\core\window\window_pygame.py", line 381, in mainloop
     self._mainloop()
   File "C:\Python34\lib\site-packages\kivy\core\window\window_pygame.py", line 287, in _mainloop
     EventLoop.idle()
   File "C:\Python34\lib\site-packages\kivy\base.py", line 321, in idle
     Clock.tick()
   File "C:\Python34\lib\site-packages\kivy\clock.py", line 422, in tick
     self._process_events()
   File "C:\Python34\lib\site-packages\kivy\clock.py", line 537, in _process_events
     if event.tick(self._last_tick) is False:
   File "C:\Python34\lib\site-packages\kivy\clock.py", line 309, in tick
     ret = callback(self._dt)
   File "C:\Python34\lib\site-packages\gardenMapView\mapview\downloader.py", line 79, in _check_executor
     callback(*args)
   File "C:\Python34\lib\site-packages\gardenMapView\mapview\view.py", line 83, in set_source
     self.source = cache_fn
   File "instructions.pyx", line 337, in kivy.graphics.instructions.VertexInstruction.source.__set__ (kivy\graphics\instructions.c:6497)
   File "context_instructions.pyx", line 360, in kivy.graphics.context_instructions.BindTexture.source.__set__ (kivy\graphics\context_instructions.c:7150)
   File "C:\Python34\lib\site-packages\kivy\core\image\__init__.py", line 442, in __init__
     self.filename = arg
   File "C:\Python34\lib\site-packages\kivy\core\image\__init__.py", line 631, in _set_filename
     mipmap=self._mipmap, nocache=self._nocache)
   File "C:\Python34\lib\site-packages\kivy\core\image\__init__.py", line 371, in load
     im = loader(filename, **kwargs)
   File "C:\Python34\lib\site-packages\kivy\core\image\__init__.py", line 150, in __init__
     self._data = self.load(filename)
   File "C:\Python34\lib\site-packages\kivy\core\image\img_pygame.py", line 42, in load
     im = pygame.image.load(filename)
 pygame.error: Unsupported image format

edit:

Used my own Python distribution, finally got it to work.

It seems the problem was the mscv compiler was looking for vcvarsamd64.bat, but it didn't exist.

Used the following solution: Errors while building/installing C module for Python 2.7

Then I just copied all the glew headers and libs into the appropriate include file, and I finally got kivy to install correctly using pip install kivy

Community
  • 1
  • 1

2 Answers2

0

png should be supported fine, I'm not sure what the problem is. It might be that the pygame provider can't do png and you lack a better provider, but that seems unlikely.

Are you able to run the examples that come with the mapview? e.g. simple_map.py in the examples directory of its github repo.

inclement
  • 29,124
  • 4
  • 48
  • 60
0

What it turned out I was trying to load vector mbtiles into Mapview, which it doesn't support. It does support raster mbtiles such as https://github.com/klokantech/vector-tiles-sample/releases/download/v1.0/countries-raster.mbtiles

TimSC
  • 1,459
  • 16
  • 20