DRAFT - export EJAM results as shapefile/geojson/kml for use in ArcPro, EJScreen, etc.
Source:R/ejam2shapefile.R
ejam2shapefile.Rd
DRAFT - export EJAM results as shapefile/geojson/kml for use in ArcPro, EJScreen, etc.
Usage
ejam2shapefile(
ejamitout,
fname = "EJAM_results_bysite_date_time.geojson",
folder = tempdir(),
save = TRUE,
crs = 4269,
shortcolnames = TRUE,
varnames = "basic250",
sf_data.frame = NULL
)
Arguments
- ejamitout
output of EJAM such as from
ejamit()
- fname
optional filename with no path, with extension one of "geojson"/"json", "shp", "kml" Ignored if save=F.
- folder
optional - If omitted (and not running in shiny and if interactive() mode), this function prompts you to specify the folder where the file should be saved. If omitted and not running in shiny or not interactive() mode, it uses tempdir(). Ignored if save=F.
- save
whether to save file - if FALSE, it returns the object not the file path
- crs
optional coord ref system
- shortcolnames
Whether to cut colnames to 10 characters only if using .shp format
- varnames
optional vector of which colnames of ejamitout$results_bysite to include in shapefile. DJefault is all other than averages, ratios, and raw EJ scores. Can be "all" or NULL to include all columns.
- sf_data.frame
data.frame that is also "sf" class, with "geometry" column for mapping, rows exactly corresponding to those in ejamitout$results_bysite
Details
FIELD NAMES (indicator names) CURRENTLY ARE TRUNCATED AND NUMBERED TO BE ONLY 10 CHARACTERS MAX.
Examples
if (FALSE) { # \dontrun{
# folder = getwd()
# out <- ejamit(testpoints_100 , radius = 3.1)
# fname <- ejam2shapefile(out, "test100_3miles.geojson", folder = folder)
out <- testoutput_ejamit_10pts_1miles
fname <- ejam2shapefile(out)
shp <- shapefile_from_any(fname)
map_shapes_leaflet(shp)
} # }