-
Notifications
You must be signed in to change notification settings - Fork 14
Interactive session in a docker container
F.Moser edited this page Oct 20, 2022
·
2 revisions
It's possible to have an interactive accessmod session from a docker container
docker run -ti --rm fredmoser/accessmod:latest R
# Load dependencies an configuration
source('global.R')
# Start namespace session on the project demo. expr is required – for now. ls() is enough.
amGrassNS(mapset='demo',location='demo',expr=quote(ls()))
# Execute any GRASS commands. E.g. v.what.rast
execGRASS("g.list",type="raster")
execGRASS("g.list",type="vector")
dfResult <- execGRASS("v.what.rast",raster="rLandCover__demo",map="vFacility__demo",flags="p",intern=T) %>% amCleanTableFromGrass()
names(dfResult) <- c("cat","value")
head(dfResult)
docker compose exec am_main R
> source('global')
...