Runs working.spatial_join_from_catalog(): joins every loaded location interval to the geometries of one variable in space (the spatial operator) and in time (the variable's periods), and writes one working.external_exposure row per person, location, exposure concept and interval overlap.
Usage
spatialJoin(
connection,
variableName,
tableId = NULL,
spatialOperator = "ST_Within",
bufferMeters = 0,
exposureTypeConceptId = 0
)Arguments
- connection
A connection from
connectGaia().- variableName
Variable to join (a
variable_nameoflistVariables()).- tableId
Catalog identifier of the dataset the variable belongs to. Needed when the same variable name exists in several datasets.
- spatialOperator
PostGIS predicate relating the location to the geometry:
"ST_Within"(point in polygon, the default),"ST_Intersects","ST_Overlaps"or"ST_Touches". The operator is stored verbatim inexposure_relationship_source_valueand mapped to an OMOP GIS geometry relationship concept.- bufferMeters
Buffer around the geometry, in metres, or 0.
- exposureTypeConceptId
Concept of the kind of data source (an "Exposure Type Concept", for example 2052499878, Air Quality Database), stored in
exposure_type_concept_id. Gaia cannot infer it. 0 if unknown.