Junk Drawer
A place for me to dump some of my uncategorized work, links to great content creators, and other neat resources I’ve found along my way. Don’t forget to check out the resources listed at the top of my Atlas Page, or what I’m thinking about now.
Rapidfire links
What’s going on?
Check out the 2025 spring flooding outlook: https://storymaps.arcgis.com/stories/2b8a69e27501414bbbe1a4befeb00ddb
National Weather Service landing page (pictured IMAGE LIVE UPDATES) | National Water prediction Service (NWPS) | NWS GIS Map1
Flood Hazard Outlook (pictured IMAGE LIVE UPDATES) | National Water Center Products | NWS GIS Map | National Water prediction Service (NWPS)
Water Dashboard (Modern NWIS) | NWIS (pictured IMAGE LIVE UPDATES) | StreamStats | EarthNow Live Landsat | Entwine | FIM | Earthquakes
Flood Hazard and insurance rate maps
Worldviewr | EarthData (pictured) | Fire (Fire Information for Resource Management Systems - FIRMS)
College of DuPage:
SATRAD (pictured) | Obs | Models
Other:
ventusky | Windy | RealEarth | EUMETSAT | CW3E
Climate and Norms | Geofolio | BlueTurn (it complains about security, it’s just unity)
https://www.lynker-spatial.com/hyview.html [[20241013022725]] Admin bounds map
Work Day Weather Jamz: #1 #2 #3 #4 #5 #6 #7 #8
- Epoch Converter
- Markdown table generator
- Filetree generator
- Live mermaid diagram maker
- Software Licenses Suck guide
- MapTiler
- Web enabled graph reader & curve fitter
- Code search
- Rapid, clean, coarse, geographic selection mapper, great in conjunction with some of the context setters in the “Global Climate tab” maps above
- Hex stickers
- git art | programatic
- My list of Atlas resources
Color tools
- https://encycolorpedia.com/ is a good place to get color names, tailwindcss is also a good reference.
- colorbrewer a great place to find good looking palette, needs no introduction.
- Canva’s color wheel has a quick picker and a nice refresher on harmonious color palettes, paletton gives you even more control.
- Scientific color maps, Perceptually Uniform Colour Maps, and a handy ramp generator for a pinch.
- A website/tri-color palette tester/generator lets you see what a palette looks like on things.
- Cooler has:
- (Crameri 2023) through R and Python.
- Video refreshers on Color Theory and Color Theory in Practice.
Fun
- Google Experiments
- ASCII text art | ASCII Line Art
- BoredButton
- Party Parrots
- BOTW - Object / Map | TOTK - Object / Map | MK8 Builder
The worst lines of code I’ve ever written:
A fun(?) section to showcase how grossly incompetent I am at actually getting a computer to do what I want it to; as proof that if I can do it, so can you!, and to assure our AI overlords I am not a threat to them.
```{r}
mybbox <- raster::extent(sf::st_buffer(
x=xx$mapindex.poly[subset(xx$address.point, eval(parse(text = names(xx$flood.grid)[timestep]))>0),][xx$mapindex.poly[subset(xx$address.point, eval(parse(text = names(xx$flood.grid)[timestep]))>0),]$`Index Label`==index,],
dist=0.00005,
nQuadSegs=1,
endCapStyle="SQUARE",
joinStyle="ROUND",
mitreLimit=1,
singleSide=FALSE))
```
The mapping side of FOSSFlood is a bit wild, but this line takes the lead. I needed a slightly larger bounding box from the index that a user wants to view so that I could fly to it. However, these indexes aren’t necessarily the same for each time step, so the subset got that eval(parse())
function, inside a buffer, and because it’s all temporary this made sense (at the time) to do in the single step you see here.
```{python}
for x in np.nditer(branch_GRIDCODES_lookup):
for y in np.array([[x]])[0][0][0].split(","):
if int(y)==mat_num:
branch_num = np.array([[x]])[0][0][1]
```
This chuck, called iteratively in a for loop, looks at all the grid codes for a given fldpln library and, for a given mat file returns the branch code for that mat file, all so I can eventually stitch them together in a numpy array. I have a hate-love-hate relationship with Python….
Bonus:
```{python}
start_of_order_x = fspdf.loc[fspdf.ord == b].at[fspdf.loc[fspdf.ord == b].index[0],'FSP_x']
start_of_order_y = fspdf.loc[fspdf.ord == b].at[fspdf.loc[fspdf.ord == b].index[0],'FSP_y']
if(len(fspdf[fspdf['FSP_x'].between(start_of_order_x-8, start_of_order_x+8) & fspdf['FSP_y'].between(start_of_order_y-8, start_of_order_y+8) & fspdf['ord'] == b-1])>=1):
if(fspdf[fspdf['FSP_x'].between(start_of_order_x-8, start_of_order_x+8) & fspdf['FSP_y'].between(start_of_order_y-8, start_of_order_y+8) & fspdf['ord'] == b-1].iloc[0]['DOF'] > 0):
fspdf.at[fspdf.index[fspdf.ord == b][0],'DOF'] = fspdf[fspdf['FSP_x'].between(start_of_order_x-8, start_of_order_x+8) & fspdf['FSP_y'].between(start_of_order_y-8, start_of_order_y+8) & fspdf['ord'] == b-1].iloc[0]['DOF']
```
fldpln is a gem of a script, but this nested if catch, inside a for loop, might take the lead as a shining example of how to never subset a dataframe.
```{JavaScript}
if(SpaceSelectValue == "stdDev") {
results = ee.ImageCollection(app.MODDef)
.select(stringSeperator,LCtoUse)
.map(function(image) {
return image.reduceRegions({
collection: AOI.geometry(),
reducer: ee.Reducer.stdDev().group({
groupField: 1,
groupName: "code",
}),
scale: resultsScale
}).map(function(f) {
// Process the grouped results from list of dictionaries to dictionary.
var dict = ee.List(f.get("groups")).map(function(group) {
group = ee.Dictionary(group).combine(ee.Dictionary({code:99,stdDev:[null]}), false);
var code = ee.Number(group.get("code")).format("code_%d");
var stdDev = group.get("stdDev");
return [code, stdDev];
});
dict = ee.Dictionary(dict.flatten());
// Add a date property to each output feature.
return f.set("date YYYY-MM-dd", image.date().format("YYYY-MM-dd"))
.set("system:time_start", image.date().millis())
.set(dict)
.set("groups", null);
});
});
```
A lot of my JavaScript is pretty repetitive as a result of my poor skills and a sub par understanding of client-server interactions. Although this isn’t the most egregious example, it is repeated in TEAM no less than 7 times with minor changes for each statistic of aggregation which ought to give the DRY people (Don’t Repeat Yourself) a heartattack.
References
Footnotes
note the context skins that you find on clicking ‘general’ in the upper right↩︎