Thanks for tips.
But yesterday, after many hours of searching for a solution on the internet, I tried to install another version of Linux, 16.04 instead of 18.04, and followed the recipy on switch2osm.org for that version. But without any luck. Then I reformatted the disk and installed Python, Mapnik, osm2pgsql, and PostGis on Windows. Now I’m able to generate at least some tiles, but generate_tiles.py, but python report runtime error and exception in thread, and after some tiles are generated the command window freeze (hang) every time.
When I look at the generated tiles for the selected zoom-levels it should generate tiles for, in this case 6 - 11, then I can see name of Torshavn, and main roads, but most land area except for some tiny area in Torshavn have the same color as the ocean. I have imported the faroe-islands-latest.osm into the PostGis DB. I’m using the osm.xml that came with Mapnik as the MAPNIK_MAP_FILE.
So now I have to figure out why:
a) generate_tiles.py freeze after generating 274 tiles, as well as report exception in thread and runtime error
Some tiles generated
Exception in thread Thread-1
[…]
Runtime error: bad allocation
Some more tiles generated
Then windows command window freeze
Similar exception and error when NUM_THREADS = 1, but then fewer tiles are generated before the command window freeze.
When NUM_THREADS = 4 then allways 274 tiles are generated.
When NUM_THREADS = 1 then allways 26 tiles are generated.
b) why most land area get same color as the ocean
Is someone has some tips on how to fix those issues, or what procedure I should follow to find out the cause for it…
I looked at CPU and memory usage when generating tiles the last time, and both CPU and memory usage stayed very low. And the tiles that where generated was generated very fast.
Using Intel® Core i7-960 Processor, Socket-LGA1366, Quad Core, 3.2Ghz,
12 GB RAM
Samsung 860 EVO 500GB SSD for the PostGis database and storage for the generated tiles.
Windows 7
Here is how the output look (extract) when NUM_THREADS = 4:
FAREO-ISLANDS : 9 244 143 Empty Tile
FAREO-ISLANDS : 9 244 142
FAREO-ISLANDS : 8 123 71
FAREO-ISLANDS : 9 245 144
FAREO-ISLANDS : 9 245 141
FAREO-ISLANDS : 9 245 143
FAREO-ISLANDS : 9 245 142
FAREO-ISLANDS : 9 246 141
FAREO-ISLANDS : 9 247 141
FAREO-ISLANDS : 9 246 144
FAREO-ISLANDS : 9 246 142
FAREO-ISLANDS : 9 247 143
Exception in thread Thread-1:
Traceback (most recent call last):
File “C:\Python27\lib\threading.py”, line 801, in __bootstrap_inner
self.run()
File “C:\Python27\lib\threading.py”, line 754, in run
self.__target(*self.__args, **self.__kwargs)
File “generate_tiles.py”, line 118, in loop
self.render_tile(tile_uri, x, y, z)
File “generate_tiles.py”, line 100, in render_tile
mapnik.render(self.m, im)
RuntimeError: bad allocation
FAREO-ISLANDS : 9 247 142
FAREO-ISLANDS : 9 247 144 Empty Tile
Exception in thread Thread-4:
Traceback (most recent call last):
File “C:\Python27\lib\threading.py”, line 801, in __bootstrap_inner
self.run()
File “C:\Python27\lib\threading.py”, line 754, in run
self.__target(*self.__args, **self.__kwargs)
File “generate_tiles.py”, line 118, in loop
self.render_tile(tile_uri, x, y, z)
File “generate_tiles.py”, line 100, in render_tile
mapnik.render(self.m, im)
RuntimeError: bad allocation
FAREO-ISLANDS : 10 489 284
FAREO-ISLANDS : 9 246 143
FAREO-ISLANDS : 10 489 285
Exception in thread Thread-3:
Traceback (most recent call last):
File “C:\Python27\lib\threading.py”, line 801, in __bootstrap_inner
self.run()
File “C:\Python27\lib\threading.py”, line 754, in run
self.__target(*self.__args, **self.__kwargs)
File “generate_tiles.py”, line 118, in loop
self.render_tile(tile_uri, x, y, z)
File “generate_tiles.py”, line 100, in render_tile
mapnik.render(self.m, im)
RuntimeError: bad allocation
FAREO-ISLANDS : 10 489 287 Empty Tile
FAREO-ISLANDS : 10 489 288 Empty Tile
FAREO-ISLANDS : 10 489 289 Empty Tile
FAREO-ISLANDS : 10 490 282
FAREO-ISLANDS : 10 490 283
then it keeps on doing many more tiles, without any more exeptions and errors reported,
then it just stop, produce an empty line where the cursor blink,
then I can only copy text from the command window or close it.
Here is the output when NUM_THREADS = 1
N:\mapnik>testgen.cmd
N:\mapnik>set MAPNIK_MAP_FILE=osm.xml
N:\mapnik>set MAPNIK_TILE_DIR=N:\tiles
N:\mapnik>set HOME=C:\Users
N:\mapnik>python generate_tiles.py
render_tiles( (-7.8, 61.3, -5.8, 62.5) osm.xml N:\tiles/ 6 11 FAREO-ISLANDS )
FAREO-ISLANDS : 6 30 17
FAREO-ISLANDS : 6 30 18
FAREO-ISLANDS : 7 61 35
FAREO-ISLANDS : 7 61 36
FAREO-ISLANDS : 8 122 70
FAREO-ISLANDS : 8 122 71
FAREO-ISLANDS : 8 122 72
FAREO-ISLANDS : 8 123 70
FAREO-ISLANDS : 8 123 71
FAREO-ISLANDS : 8 123 72
FAREO-ISLANDS : 9 244 141 Empty Tile
FAREO-ISLANDS : 9 244 142
FAREO-ISLANDS : 9 244 143 Empty Tile
FAREO-ISLANDS : 9 244 144 Empty Tile
FAREO-ISLANDS : 9 245 141
FAREO-ISLANDS : 9 245 142
FAREO-ISLANDS : 9 245 143
FAREO-ISLANDS : 9 245 144
FAREO-ISLANDS : 9 246 141
FAREO-ISLANDS : 9 246 142
FAREO-ISLANDS : 9 246 143
FAREO-ISLANDS : 9 246 144
FAREO-ISLANDS : 9 247 141
FAREO-ISLANDS : 9 247 142
FAREO-ISLANDS : 9 247 143
FAREO-ISLANDS : 9 247 144 Empty Tile
Exception in thread Thread-1:
Traceback (most recent call last):
File “C:\Python27\lib\threading.py”, line 801, in __bootstrap_inner
self.run()
File “C:\Python27\lib\threading.py”, line 754, in run
self.__target(*self.__args, **self.__kwargs)
File “generate_tiles.py”, line 118, in loop
self.render_tile(tile_uri, x, y, z)
File “generate_tiles.py”, line 100, in render_tile
mapnik.render(self.m, im)
RuntimeError: bad allocation