Skip to contents

Get URL(s) for (new) EJSCREEN app with the given place(s) selected on the map

Usage

url_ejscreenmap(
  sitepoints = NULL,
  lat = NULL,
  lon = NULL,
  shapefile = NULL,
  fips = NULL,
  wherestr = NULL,
  as_html = FALSE,
  linktext = "EJSCREEN",
  ifna = "https://pedp-ejscreen.azurewebsites.net/index.html",
  baseurl = "https://pedp-ejscreen.azurewebsites.net/index.html",
  ...,
  zip = NULL,
  radius = NULL,
  combined = FALSE,
  shape = NULL,
  shp = NULL
)

Arguments

sitepoints

data.frame with colnames lat, lon (or lat, lon parameters can be provided separately)

lat, lon

vectors of coordinates, ignored if sitepoints provided, can be used otherwise, if shapefile and fips not used

shapefile

polygon(s) as from shapefile_from_any(). The outline of each polygon (exterior ring, simplified as needed to fit in a URL) is passed via the app's ?polygon= parameter so EJScreen draws and selects it. If an outline is too complex to fit even after simplification, that site falls back to a link centered on the polygon's centroid (no boundary drawn): ?wherestr=lat,lon, or ?lat=&lon=&radius= when radius is provided so the report buffer is still prefilled.

fips

FIPS code(s) of place(s) to select on the map. County (5-digit), tract (11), and blockgroup (12) codes become ?fips= deep links that make the EJScreen app draw and select the boundary. State (2-digit) and city/CDP (7-digit) codes are not supported by the app's boundary services, so those are translated via fips2name() into a ?wherestr= place-name search (map centers there without a boundary).

wherestr

If fips and sitepoints (or lat and lon) are not provided, wherestr should be the street address, zip code, or place name (not FIPS code!).

Note that nearly half of all county fips codes are impossible to distinguish from 5-digit zipcodes because the same numbers are used for both purposes, so a bare 5-digit wherestr is ambiguous. The EJScreen app's deep links resolve the ambiguity the way EJAM does: a bare 5-digit wherestr is tried as a county FIPS first (drawing that county's boundary), and only geocoded as a zip code if no county has that code. So:

For County FIPS code 10001, use url_ejscreenmap(fips = "10001") - unambiguous.

For zipcode 10001, use url_ejscreenmap(zip = "10001") - unambiguous - since a bare wherestr = "10001" would open Kent County, DE (10001 happens to be a county fips as well as a zip code). Adding context also works, like url_ejscreenmap(wherestr = "10001, NY").

(The interactive search box inside the EJScreen app is different from these launch-URL deep links: it still reads a bare 5-digit number as a zip.)

This parameter is passed to the app as wherestr= , if point and fips are not specified.

Can be State abbrev like "NY" or full state name, or city like "New Rochelle, NY" as from fips2name() – using fips2name() works for state, county, or city FIPS code converted to name, but using the fips parameter is probably a better idea.

as_html

Whether to return as just the urls or as html hyperlinks to use in a DT::datatable() for example

linktext

used as text for hyperlinks, if supplied and as_html=TRUE

ifna

URL shown for missing, NA, NULL, bad input values

baseurl

do not change unless endpoint actually changed

...

regid can be provided (used to look up lat,lon as a last resort if no sites provided); other arguments ignored

zip

5-digit zip code(s) - the unambiguous way to open EJScreen at zip code(s), via the app's ?zip= parameter: always geocoded as zips, never read as county fips (unlike a bare 5-digit wherestr). Each zip gets a pin with the report popup; one zip centers the map, several fit the view to all of them (or use combined = FALSE, the default, for one URL per zip). Used only if sitepoints (or lat,lon), shapefile, and fips are not provided; takes precedence over wherestr. A zip passed as a number gets its leading zeroes restored.

radius

optional buffer distance in miles for the EJScreen report around each point (or polygon). When provided, point links use the app's ?lat=&lon=&radius= parameters (instead of ?wherestr=lat,lon) so the report buffer is prefilled. Must be a single number greater than zero: zero (or a negative or non-numeric value) means no buffer is prefilled, so it is left out of the URL, which EJScreen treats the same way (its deep links only apply a radius= that is greater than zero).

combined

set TRUE to get ONE URL that loads ALL of the sites together in a single EJScreen session (drawn on the map and accumulated into the app's Multisite list, ready for a Multisite Report or Send to EJAM), instead of the default of one URL per site. Works when all sites are county/tract/blockgroup fips, or all are points, or all are zip codes, or all are small polygons. If the combined URL would be too long to be reliable (over roughly 1900 characters), it falls back to one URL per site, with a warning.

shape, shp

aliases (synonyms) for shapefile

Value

URL(s), or a single URL if combined = TRUE

Details

These are deep links into the EJScreen map app. For county, tract, or blockgroup FIPS codes, for points (with a radius), and for small polygons, the URL makes EJScreen actually draw and select the place(s) for analysis (boundary drawn, report popup or multisite list ready), using the ?fips=, ?lat=&lon=&radius=, and ?polygon= parameters of the app.

Note the selection-drawing parameters require the version of the EJScreen app that supports deep links (PEDP EJScreen as of mid-2026 or later); older deployments ignore them and just open the map. The wherestr= style links (the default for points when no radius is given, and the fallback for state or city/CDP FIPS) work on all versions of the app.

Examples

url_ejscreenmap(fips = "10001") # county FIPS 10001 = Kent County, DE
url_ejscreenmap(zip = "10001")  # zip code 10001 = Manhattan, NY
url_ejscreenmap(fips = c("10001", "10003"))
url_ejscreenmap(fips = c("10001", "10003"), combined = TRUE)
url_ejscreenmap(lat = c(39, 39.7), lon = c(-75.5, -75.6), radius = 3, combined = TRUE)
# browseURL(url_ejscreenmap(fips = '10001'))
# browseURL(url_ejscreenmap(sitepoints = testpoints_10[1,]))
# shp = shapefile_from_any(  testdata("portland.*zip")[1])[1, ]
shp = testinput_shapes_2[1,]
 url_ejscreenmap(shapefile = shp)