MaZderMind / osm-history-renderer

an experimental, work-in-progress history renderer (including supplementary tools like an importer and an animation-tool)
BSD 2-Clause "Simplified" License
79 stars 23 forks source link

OSError: [Errno 17] File exists: animap #16

Closed planemad closed 10 years ago

planemad commented 10 years ago

When I run

osm-history-renderer/renderer/render-animation.py --style osm-mapnik-style/osm.xml --bbox 8.3122,48.9731,8.5139,49.0744

I get the error

Traceback (most recent call last):
  File "osm-history-renderer/renderer/render-animation.py", line 403, in <module>
    main()
  File "osm-history-renderer/renderer/render-animation.py", line 143, in main
    os.mkdir(anifile)
OSError: [Errno 17] File exists: 'animap'

The end result is an empty directory called animap. I tried other filenames and parameters but get the same error, is this a bug?

MaZderMind commented 10 years ago

is this a bug? no, not on its own. the renderer creates a folder "by default: animap" and tries to render files into this. If rendering fails, the folder stays empty. If you restart rendering afterwards, it can't create that folder and stops, because it prevents rendering into an existing folder.

I often run this while I'm developing a style:

rm -rf animap/ && ./render-animation.py --style /var/osm/styles/osm-hist/osm.xml --bbox -180,-80,180,80

I don't see a bug in the renderer here. Feel free to re-open the ticket if you find something.

Regards, Peter

planemad commented 10 years ago

Something's still not right, I cleared the folder ran this again

./osm-history-renderer/renderer/render-animation.py --style osm-mapnik-style/osm.xml      --bbox 72.911183,20.117799,72.925265,20.132359 --anistart=2013-12-01 --zoom 16 --type gif --file talasari      --label "%d.%m.%Y" --label-gravity SouthEast
rendering animation from 2013-12-01 00:00:00 to 2014-05-21 22:21:46.127977 in relativedelta(months=+1) steps from bbox [72.911183, 20.117799, 72.925265, 20.132359] in style osm-mapnik-style/osm.xml to file talasari which is of type gif in size 656x722

2013-12-01 00:00:00
2014-01-01 00:00:00
2014-02-01 00:00:00
2014-03-01 00:00:00
2014-04-01 00:00:00
2014-05-01 00:00:00
assembling animation

But the resulting animation is nowhere to be found. The png option works and I get a folder of png's, but unable to get any other format working nor is a folder generated.

MaZderMind commented 10 years ago

there should be a talasari.html and a talasari-folder in your current working directory.

planemad commented 10 years ago

No folder. Only the png option generates a directory with files. Anyway I can troubleshoot whats going on?

planemad commented 10 years ago

A file search for talasari turns up nothing as well, so its not getting saved.

MaZderMind commented 10 years ago

mhhhmm as it runs through and does things I can't see any issues. For all the world - and without wanting to attack you - it sounds like a mistake on your side.

Are you in the correct folder? Are you looking into the correct place? Are you maybe on a remote-machine doing things there?

To debug it just dig into render-animation.py. It's not that complicated. In Line 397 the html is written and in Line 158 it calls into render.py to paint the map-png.

planemad commented 10 years ago

Pretty sure i'm in the right folder because I see the generated output using the png or html option. Its the gif and mp4 option that gives no output. I'm a newbie and quite excited I even got this far, thanks for a great tool!

MaZderMind commented 10 years ago

Oh sorry, I overlooked that `--type gif``. For gif and mp4 generation the script uses ffmpeg. It may lack appropriate checks for its vailablility. If in doubt, render as png and assemle the animation yourself:

ffmpeg -r 10 -f image2 -i animap/%010d.png -crf 0 lossless.mp4

after all, this is a history renderer - no video-tool. Maybe I should remove all options but html+pngs.