Skip to content

Another attempt at writing the river flow algorithm focused on visualizations

License

Notifications You must be signed in to change notification settings

andrew-houghton/river-flow-3

Repository files navigation

river-flow-3

Another attempt at writing the river flow algorithm focused on visualizations

Visualization Steps

  1. Pixels with colour for height
  2. Swap to graph
  3. Visualise merging equal height nodes by moving them to the centre point then changing them into one point
  4. Flooding
  5. BFS
  6. Sort
  7. Creation of linked list
  8. Flow simulation

Instructions

  1. Create virtual environment virtualenv -p python3.7 venv
  2. Install required packages pip install -r requirements.txt
  3. cd pygame
  4. python renderer.py
  5. Press right arrow key to advance
  6. During some steps use the mouse to interact
  7. Press ESC at any time to exit

Height map image alignment (hard)

  1. Download sentinel tile.
  2. Download aster dem tile.
  3. Load both datasets in SNAP desktop. They should have enough info to load into the world view. If they don't fix up the source data.
  4. Resample the sentinel image. Raster > Geometric Operations > Resampling
  5. Colocate the images. Make sure the master is the sentinel image. Don't select nearest neighbour. Bicubic interpolation worked well last time.
  6. Subset the image (do this to crop the image and select only the elevation correct band).
  7. Export this as a GeoTiff.
  8. Go back to the sentinel tile. Create an RGB image (with sentinel RGB values) and then export view as image. This should give you accurate colours.
  9. If the images don't overlap correctly you will need to subset when you export probably.

Screenshot

Graph of links between places with different heights

Image processing

  1. Download sentinel 2 tiles. Optimise for complete tiles (no black areas), time of day (no shadows), then cloud cover. Use the EarthExplorer website.
  2. Download dem files from Alaska Satellite Facility.
  3. Load all files in qgis. Use the merge tool to create two large tifs of the area selected. One 1hould be the height map and one should be the true colour image.
  4. Use the align raster tool to align the dem with the sentinel image. Make sure the images have the same pixel size, and same height/width afterwards. If required adjust the area bounds to make sure the height/width are correct.

About

Another attempt at writing the river flow algorithm focused on visualizations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published