-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Easy Map Generator for VWP Projects #369
Comments
Stashing pre-5/4/23 items below: Scripts:
Example:source("https://raw.githubusercontent.com/HARPgroup/hydro-tools/master/GIS_functions/mapgen.R")
# User Inputs:
export_path <- "C:/Users/nrf46657/Desktop/VWP Modeling/Magnolia Green"
filename <- paste0("MagnoliaGreen_nhdplus_map.png")
# specify start point (typically intake location), map buffer is based on this point
start_point <- data.frame(lat = 37.415128974720155, lon = -77.7271085761693, label = "Intake")
# specify additional points to plot
points <- data.frame(lat=double(),lon=double(),label=character())
points <- rbind(points,data.frame(lat = 37.40402068694781, lon = -77.74288001411728, label = "12MG Pond"))
points <- rbind(points,data.frame(lat = 37.402823839033694, lon = -77.74452198900777, label = "7MG Pond"))
# specify usgs gage to plot
gageid <- "02036500"
# specify which rsegs to plot
segswhere <- "hydrocode LIKE 'vahydrosw_wshed_J%'"
# generate map gg object (simple example, using defaults)
# map_gg <- mapgen()
# generate map gg object (simple example, overriding defaults)
map_gg <- mapgen(start_point=start_point,
points=points,
gageid=gageid,
segswhere=segswhere)
# output map as png file
png(file=paste(export_path,filename,sep="/"), width=1500, height=1500)
map_gg
dev.off() Magnolia Green Example:Salem WTP Example:map_gg <- mapgen(start_point=data.frame(lat = 37.286388888900, lon = -80.075833333300, label = "Intake")) |
Hey - the new model_geoprocessor function looks very good. I propose the following: (Not really proposing that you do it, just proposing that we do it some time :) )
|
@jdkleiner I have done some more dev here. Bringing in the points with existing tools (facilities can ALSO be retrieved with Also, I updated the bounding box to use the riersegments that are included, not the starting point with a zoom. The only rub is that in a HUC8 size watershed things start to get kinda busy, though perhaps they wouldn't look so bad if I could figure out why my color scheme is lacking your earthtones? Any ideas on this? Surely you all conquered this during WSP. The only real obstacle I see is that the labels overlap, which is a bit of a pain: |
@rburghol This is great, glad to see you pushing this forward. Taking a look at some of this now, is your latest code housed here?: https://github.com/HARPgroup/vahydro/blob/master/R/mapping/EasyMapGen.R Also, running into a snag, where is the function |
@jdkleiner yup that's the one (it's linked at the top of the issue below your original to trace the source). The Line 174 in d6ee090
Thanks for taking a look!!! |
@jdkleiner If you can verify your original version gets all those colors, my first B&W troubles happened with that one which makes me wonder if there is some config that I may lack? |
Thanks, looked like cia_utils.R got updated recently, needed to do a pull. Just did a test of my earlier map version and your new version, both have color in the terrain layer. Maybe you need to update one of the spatial packages? (ggmap, ggsn, ggspatial)
|
Doesn't setting the extents eliminate the need to think about scale and zoom? The extent becomes the scale... no? |
Still no colors. I did a |
Easiest Map Generation (Rev. 5/4/23):
Everything needed to generate a "fig.location_map_.png" is housed in this file:
mapgen()
andmodel_geoprocessor()
as updates were needed during development and I didn't want to update those functions located inhydro-tools/GIS_functions/
just yet in case you needed themResult:
The text was updated successfully, but these errors were encountered: