# 'What's Here' and Other Child Datasets

# Child Datasets

  • "title": use singular name where practical
  • "showInLayerControl": set to false to prevent dataset from being listed in the layer panel.
  • "group": leave blank or undefined

# Lookups

A child dataset can be used to fetch data about a selected feature from a separate source such as a database or web service. This enables Pozi to return one or more (or none) records that are associated with the selected feature.

Use cases:

  • property owner
  • inspections
  • defects
  • maintenance
  • photos

The child dataset's url will contain a request to a dataset, plus a filter parameter for selecting related rows from the source dataset.

There is no special configuration required for the parent dataset in order for it to support a child dataset.

# Filters

  • WFS OGC: FILTER=<Filter><PropertyIsEqualTo><PropertyName> ChildDatasetIDField </PropertyName><Literal>[ ParentDatasetIDField ]</Literal></PropertyIsEqualTo></Filter>
  • VRT: &options=-where| ChildDatasetIDField in ('[ ParentDatasetIDField ]')
  • WFS CQL
  • CKAN

This example uses the selected bridge's AssetID value to do a lookup on a table of associated records in a defect table. The defect table is registered as a WFS endpoint in QGIS.

{
  "title": "Bridge Defects",
  "parent": "Bridges",
  "type": "GeoJSON",
  "localDataSource": true,
  "showInLayerControl": false,
  "config": {
    "spatial": {
      "loader": "geojson",
      "url": "https://bs-gis.pozi.com/iis/qgisserver?MAP=//bs-intra/GIS/System/POZI/QGIS%20Projects/Child%20Datasets.qgs&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&OUTPUTFORMAT=application%2Fjson&TYPENAME=POZI_BridgeDefects&FILTER=<Filter><PropertyIsEqualTo><PropertyName>AssetID</PropertyName><Literal>[AssetID]</Literal></PropertyIsEqualTo></Filter>",
      "id": "AssetID",
      "label": "DefectDescription"
    }
  }
}

# Spatial Intersection

When a dataset is configured with the "pointOnSurface": true transformer function, Pozi filters the dataset to only those records that intersect with the parent geometry.

  "config": {
    "transformer": {
      "pointOnSurface": true
    }
  }

The pointOnSurface calculation is done in the browser after it has fetched all the records from the source. This can cause inefficiencies if the source data contains a lot of records.

# What's Here Datasets

What's Here is a special case of a child dataset whose "parent" is the geometry generated by the user's map click (or polygon drawn from the Select by region tool).

  "parent": "Whats Here",

Notes:

  • the "Whats Here" value in the config does NOT contain an apostrophe
  • setting the parent to "Whats Here" is also currently used as a hack for WMS layers to force the results of any GetFeatureInfo request to appear in the info panel (however there is a plan to avoid the need for this hack)

# Static Datasets

If the dataset is a static GeoJSON, the configuration requires the "pointOnSurface": true transformer function.

To do: add example

# Dynamic Datasets

If the dataset is an API source such as WFS, CKAN or Street View, the request URL needs to include parameter(s) which describes the What's Here geometry:

  • $cqlgeometry
  • $wkt
  • $esriGeometry & $esriGeometryType
  • $longitude & $latitude

A complete list of geometry parameters is available here.

To do: add example