Upgrade to Pro — share decks privately, control downloads, hide ads and more …

map animations

jamesw05
October 16, 2024
86

map animations

jamesw05

October 16, 2024
Tweet

Transcript

  1. Olympic Cougar Project Makah Tribe, Lower Elwha Klallam Tribe, Jamestown

    S’Klallam Tribe, Quinault Tribe, Skokomish Tribe, Panthera, and other partners
  2. Where we’re going - software 1. QGIS - data/temporal controller/export

    2. Illustrator - Make basemap 3. Ffmpeg - Make animation Why animate?
  3. DATA! (datetime) .shp .gpkg Check field type in attrib expression

    dialogue Use .gpkg or other format that supports datetime Attributes - field calculator hints
  4. Bounding Box extent/clip • Important to have a rectangle clip

    that can be used to precisely align Illustrator basemap and qgis .png export images • Use the QGIS toolbar panels to size the map canvas to have the animation export width divisible by 2 Use the QGIS toolbar panels to size the map canvas to have the animation export width divisible by 2
  5. Bounding Box extent/clip • Make a new, empty, temporary scratch

    layer • Set name, polygon geometry, and desired CRS:
  6. Bounding Box extent/clip • Run code in python console to

    create polygon that is exactly the same as map canvas extent
  7. Bounding Box - create polygon matching canvas extent #create a

    temp polygon layer in the desired crs #make it editable, selected, then open python console # paste and run this: f = QgsFeature() f.setGeometry(QgsGeometry.fromRect(qgis.utils.iface.mapCanvas().extent())) l = qgis.utils.iface.activeLayer() l.startEditing() l.addFeature(f) l.commitChanges()
  8. Bounding Box extent/clip • The polygon is written to the

    temporary scratch layer and can be used to define animation extents in qgis, and exported as a shapefile for use in Adobe Illustrator to define map extent there
  9. Adobe Illustrator with MAPublisher - make matching artboard Export temporary

    memory layer as a shapefile (in projection desired for final animation output)
  10. Adobe Illustrator with MAPublisher - make matching artboard Make a

    new artboard matching the pixel dimensions.
  11. Adobe Illustrator with MAPublisher - make matching artboard Import your

    dataclip shapefile to the new artboard, projection based on imported data. ( Or import the .svg exported from ArcGIS or QGIS if you don’t have MAPublisher )
  12. Adobe Illustrator with MAPublisher - make matching artboard The new

    artboard and clip (extent) shapefile are precisely aligned and ready for the basemap to be created.
  13. ffmpeg - use and installation We will use to: •

    Remove background color from QGIS-generated images • Convert images to a .mp4 video • Convert video to other formats Installation: Mac: • Via homebrew package manager (https://brew.sh) Windows: Via ffmpeg binaries (http://ffmpeg.org)
  14. ffmpeg - remove background color for f in *.png; do

    ffmpeg -hide_banner -loglevel error -i $f -vf colorkey=0x636363:0.1:0.0 trans${f}; done;
  15. ffmpeg - make the animation ffmpeg -framerate 60 -loop 1

    -i bg.png -i transts%04d.png -filter_complex overlay=shortest=1 optransparent.mp4