WikiWatershed / model-my-watershed

The web application front end for Model My Watershed.
https://modelmywatershed.org
Apache License 2.0
56 stars 31 forks source link

AWS 2-5: Style TDX Streams Appropriately #3625

Open rajadain opened 1 week ago

rajadain commented 1 week ago

Currently, the TDX streams look very dense when zoomed out:

image

Compare this with US Medium Resolution Streams, of which only the higher order streams are shown at low zoom levels:

image

This communicates the relationships and importance of streams very clearly.

This information is in the dataset:

ogrinfo TDX_streamnet_7020038340_01.gpkg TDX_streamnet_7020038340_01

OGRFeature(TDX_streamnet_7020038340_01):10744
  LINKNO (Integer) = 49200
  DSLINKNO (Integer) = 106032
  USLINKNO1 (Integer) = 48608
  USLINKNO2 (Integer) = 48016
  DSNODEID (Integer64) = -1
  strmOrder (Integer) = 2
  Length (Real) = 641.6
  Magnitude (Integer) = 2
  DSContArea (Real) = 10775170
  strmDrop (Real) = 6.08
  Slope (Real) = 0.00947399913
  StraightL (Real) = 491.4
  USContArea (Real) = 10652958
  WSNO (Integer) = 49200
  DOUTEND (Real) = 95675
  DOUTSTART (Real) = 96316.5
  DOUTMID (Real) = 95995.8
  LINESTRING (-70.289999999999 44.0646666666665,-70.2901111111101 44.0646666666665,-70.2902222222212 44.0646666666665,-70.2903333333323 44.0645555555554,-70.2904444444435 44.0644444444443,-70.2905555555546 44.0643333333332,-70.2904444444435 44.0642222222221,-70.2904444444435 44.064111111111,-70.2904444444435 44.0639999999999,-70.2905555555546 44.0638888888888,-70.2906666666657 44.0637777777777,-70.2907777777768 44.0636666666665,-70.2908888888879 44.0635555555554,-70.290999999999 44.0634444444443,-70.2911111111101 44.0633333333332,-70.2912222222212 44.0632222222221,-70.2913333333323 44.0632222222221,-70.2914444444435 44.0632222222221,-70.2915555555546 44.063111111111,-70.2916666666657 44.063111111111,-70.2917777777768 44.0629999999999,-70.2918888888879 44.0629999999999,-70.291999999999 44.0629999999999,-70.2921111111101 44.0629999999999,-70.2922222222212 44.063111111111,-70.2923333333324 44.063111111111,-70.2924444444435 44.063111111111,-70.2925555555546 44.063111111111,-70.2926666666657 44.0629999999999,-70.2927777777768 44.0629999999999,-70.2928888888879 44.0628888888888,-70.292999999999 44.0627777777777,-70.2931111111101 44.0626666666666,-70.2932222222212 44.0625555555554,-70.2933333333324 44.0624444444443,-70.2934444444435 44.0624444444443,-70.2935555555546 44.0624444444443,-70.2936666666657 44.0623333333332,-70.2937777777768 44.0622222222221,-70.2938888888879 44.062111111111,-70.293999999999 44.0619999999999,-70.2941111111101 44.0618888888888,-70.2942222222212 44.0617777777777,-70.2943333333323 44.0617777777777,-70.2944444444435 44.0617777777777,-70.2945555555546 44.0617777777777,-70.2946666666657 44.0618888888888,-70.2947777777768 44.0619999999999,-70.2948888888879 44.062111111111,-70.294999999999 44.0622222222221,-70.2951111111101 44.0622222222221)

The strmOrder column has an equivalent in NHD flowlines that is used for styling currently:

https://github.com/WikiWatershed/model-my-watershed/blob/878a4aa53845279a21dd2dcd8bdc8bacaf4d4ebf/src/tiler/styles/streams.mss#L17-L39

Make it so that:

aufdenkampe commented 1 week ago

@rajadain, thanks for creating this issue and highlighting the code with the rendering rules presently used for the NHD flow lines, based on map zoom levels.

We've done some thinking about this and are prepared to help, if you would like, but might need to exchange some info to be most effective. In particular, I'm thinking that we might want a few more levels of rendering than we use for NHD. Also, a TDX-hydro strmOrder=1 is equivalent to NHD stream_order=2, etc., so we'll want to take that into account.

cc: @kieranbartels & @ptomasula

rajadain commented 1 week ago

I was able to use a script like this to bake static vector tiles that are restricted to certain stream orders: ingest-vector-tiles-2.sh. You can see the cutoffs in the file, but they are:

Zoom Levels Stream Orders
0-5 5+
6-8 4+
9-11 3+
12 2+
13 1+

This is what the results look like in MMW:

https://github.com/WikiWatershed/model-my-watershed/assets/1430060/f3639951-601d-4129-88e3-e99e5c7ba504

@aufdenkampe please let me know if I should use different cutoffs.


There is one intermediate zoom with a strange artifact that needs to be addressed, and I don't have zoom-specific stream order specific widths figured out yet, but it seems to be moving in the direction we want.

Also, I'm currently using uncompressed vector tiles, which for this subset is about 400 MB when made upto zoom level 13. We should look into compression as well to reduce hosting costs.