Skip to content

Data Model and Join Keys

The Snowflake listing is designed around a small set of shared identifiers, audit context fields, and spatial outputs.

KeyUse
SiteGuidStable place identifier used across almost every dataset
AuditGuidStable audit identifier used to group records into one audit
PlanIdGeoreferenced plan identifier used where mapped observations rely on a plan

These fields appear across much of the listing:

FieldMeaning
SiteNameHuman-readable site name
AuditDateLocalLocal audit date
EventLocalHourLocal event hour where available
TimeOfDayTime bucket such as 7-8 or 8-9
Latitude, LongitudeRepresentative point for the row
GeometryWktWKT geometry suitable for TRY_TO_GEOGRAPHY()
GeometryGeoJsonGeoJSON geometry representation
GeometryMethodMethod used to derive geometry
GeometryIsApproximateFlag for derived or approximate geometry
TableTypical grain
SITE_METADATAOne row per site
AUDIT_METADATAOne row per audit
PLAN_METADATAOne row per plan
MOVEMENT_COUNTSOne row per count record or category within an audit shift
DWELL_OBSERVATIONSOne row per observed stay event
TRACE_PATHSOne row per observed movement trace
SITE_INVENTORYOne row per mapped inventory item
FACADE_QUALITYOne row per facade drawing or trace set
INTERCEPT_RESPONSESOne row per intercept response
OBSERVATIONSOne row per diary or observation entry

Join on SiteGuid when you want to compare datasets at the place level:

SELECT
s.SiteName,
COUNT(DISTINCT a.AuditGuid) AS audit_count
FROM LISTING.SITE_METADATA s
LEFT JOIN LISTING.AUDIT_METADATA a
ON s.SiteGuid = a.SiteGuid
GROUP BY 1;

Join on AuditGuid when you want all records from a specific audit:

SELECT
a.SiteName,
a.AuditDateLocal,
SUM(c.Number) AS total_people
FROM LISTING.AUDIT_METADATA a
JOIN LISTING.MOVEMENT_COUNTS c
ON a.AuditGuid = c.AuditGuid
GROUP BY 1, 2;

Use PlanId when mapped observations depend on a plan image:

SELECT
p.PlanId,
p.PlanType,
COUNT(*) AS stay_points
FROM LISTING.PLAN_METADATA p
JOIN LISTING.DWELL_OBSERVATIONS d
ON p.PlanId = d.PlanId
GROUP BY 1, 2;

For direct spatial work in Snowflake, use:

TRY_TO_GEOGRAPHY(GeometryWkt)

This is the cleanest common path across the listing.

TRACE_PATHS and FACADE_QUALITY should be understood as derived geometry built from SVG source paths and georeferenced plans. They are analytically useful, but they are not native GIS capture.