Skip to content

CkanCatalogGroup

Creates a group with members from Ckan server.

Note:
The following example will

  • Request datasets of specific types only.
  • Organise members in subgroups according to their organisations.
  • For any wms type item, use ESPG:3857 as crs.
  • Example usage

    {
      "url": "https://discover.data.vic.gov.au/",
      "type": "ckan-group",
      "name": "DataVic Open Data Portal",
      "filterQuery": [
        {
          "fq": "+(res_format:(wms OR WMS OR shapefile OR Shapefile OR \"zip (shp)\" OR shp OR SHP OR kmz OR GeoJSON OR geojson OR csv-geo-au OR aus-geo-csv))"
        }
      ],
      "groupBy": "organization",
      "supportedResourceFormats": [
        {
          "id": "WMS",
          "urlRegex": "^((?!data.gov.au/geoserver).)*$"
        },
        {
          "id": "Kml",
          "onlyUseIfSoleResource": true
        },
        {
          "id": "Shapefile",
          "onlyUseIfSoleResource": true
        }
      ],
      "ungroupedTitle": "Organisation not declared",
      "itemPropertiesByType": [
        {
          "type": "wms",
          "itemProperties": {
            "crs": "EPSG:3857"
          }
        }
      ],
      "resourceIdTemplate": "{{resource.name}}-{{resource.format}}",
      "restrictResourceIdTemplateToOrgsWithNames": [
        "department-of-energy-environment-climate-action",
        "department-of-jobs-skills-industry-regions",
        "department-of-transport-and-planning",
        "victorian-electoral-commission"
      ],
      "id": "some id"
    }
    

    CkanCatalogGroupTraits

    Trait Type Default Description
    filterQuery any [object Object]

    Gets or sets the filter query to pass to CKAN when querying the available data sources and their groups. Each item in the array causes an independent request to the CKAN, and the results are concatenated. The search string is equivalent to what would be in the parameters segment of the url calling the CKAN search api. See the Solr documentation for information about filter queries. Each item is an object ({ fq: 'res_format:wms' }). For robustness sake, a query string is also allowed. E.g. "fq=(res_format:wms OR res_format:WMS)" and "fq=+(res_format%3Awms%20OR%20res_format%3AWMS)" are allowed.

  • To get all the datasets with wms resources: [{ fq: 'res_format%3awms' }]
  • To get all wms/WMS datasets in the Surface Water group: [{q: 'groups=Surface Water', fq: 'res_format:WMS' }]
  • To get both wms and esri-mapService datasets: [{q: 'res_format:WMS'}, {q: 'res_format:"Esri REST"' }]
  • To get all datasets with no filter, you can use ['']
  • groupBy string organization

    Gets or sets a value indicating how datasets should be grouped. Valid values are: * none - Datasets are put in a flat list; they are not grouped at all. * group - Datasets are grouped according to their CKAN group. Datasets that are not in any groups are put at the top level. * organization - Datasets are grouped by their CKAN organization. Datasets that are not associated with an organization are put at the top level.

    ungroupedTitle string No group

    A title for the group holding all items that don't have a group in CKAN. If the value is a blank string or undefined, these items will be left at the top level, not grouped.

    allowEntireWmsServers boolean true

    True to allow entire WMS servers (that is, WMS resources without a clearly-defined layer) to be added to the catalog; otherwise, false.

    excludeInactiveDatasets boolean true

    True to remove inactive datasets. Where state = "deleted" (CKAN official), state === "draft" (CKAN official) or data_state === "inactive" (Data.gov.au CKAN).

    resourceIdTemplate string

    A Mustache formatted template string for generating a custom resource id from resource description. By default we use resource.id as the ID of the CKAN item but some CKAN services change their resource IDs frequently which can break terria features link share links or catalog search indexing. You can use customResourceIdTemplate to instruct terria to construct a different ID instead of the default resource.id. The template string will receive the entire resource as a template variable. Example usage: '{{resource.name}}-{{resource.format}}'.

    restrictResourceIdTemplateToOrgsWithNames string[]

    Names of organisations for which customResourceIdTemplate should be used.

    CatalogMemberTraits
    name string

    The name of the catalog item.

    description string

    The description of the catalog item. Markdown and HTML may be used.

    hideDefaultDescription boolean

    If true, then no generic default description will be displayed if description is undefined.

    nameInCatalog string

    The name of the item to be displayed in the catalog, if it is different from the one to display in the workbench.

    info InfoSectionTraits[]

    Human-readable information about this dataset.

    infoSectionOrder string[]

    An array of section titles defining the display order of info sections. If this property is not defined, {@link DataPreviewSections}'s DEFAULT_SECTION_ORDER is used

    shortReport string

    A short report to show on the now viewing tab.

    shortReportSections ShortReportTraits[]

    A list of collapsible sections of the short report

    isExperiencingIssues boolean

    Whether the catalog item is experiencing issues which may cause its data to be unavailable

    hideSource boolean

    Indicates that the source of this data should be hidden from the UI (obviously this isn't super-secure as you can just look at the network requests).

    metadataUrls MetadataUrlTraits[]

    Metadata URLs to show in data catalog.

    dataUrls DataUrlTraits[]

    Data URLs to show in data catalog.

    dataCustodian string

    Gets or sets a description of the custodian of this data item.

    modelDimensions EnumDimensionTraits[]

    This provides ability to set model JSON through SelectableDimensions (a dropdown). When an option is selected, the value property will be used to call updateModelFromJson(). All string properties support Mustache templates (with the catalog member as context)

    disableAboutData boolean

    Disables the 'About Data' button in the workbench.

    shareable boolean true

    True (default) if this catalog member may be included in share links. False to exclude it from share links.

    CkanSharedTraits
    useResourceName boolean

    True to use the name of the resource for the name of the catalog item; false to use the name of the dataset.

    useDatasetNameAndFormatWhereMultipleResources boolean true

    Use a combination of the name and the resource format and dataset where there are multiple resources for a single dataset.

    useCombinationNameWhereMultipleResources boolean

    Use a combination of the name and the resource and dataset name where there are multiple resources for a single dataset.

    supportedResourceFormats CkanResourceFormatTraits[]

    The supported distribution formats and their mapping to Terria types. These are listed in order of preference.

    useSingleResource boolean

    Only use a single resource for each dataset. If multiple resources exist, the highest match from supportedResourceFormats will be used. If this is true, then useDatasetNameAndFormatWhereMultipleResources and useCombinationNameWhereMultipleResources will be ignored

    GroupTraits
    excludeMembers string[]

    An array of strings of excluded group and item names (or ids). A group or item name (or id) that appears in this list will not be shown to the user. This is case-insensitive and will also apply to all child/nested groups

    includeMembersRegex string

    A regular expression that is matched against the member names and ids. Only members (groups and items) that match against the regular expression will be shown to the user. This is case-insensitive and will only apply to the first level of members (not in nested groups). This is applied before excludeMembers.

    isOpen boolean

    True if this group is open and its contents are visible; otherwise, false.

    mergeGroupsByName boolean

    Merge member groups by name.

    sortMembersBy string

    Sort members by the given property/trait. For example name, will sort all members by alphabetically

    members ModelReference

    The members of this group.

    displayGroup boolean

    Allow adding all members to the workbench with one click. Show Add All / Remove All button

    ItemPropertiesTraits
    itemProperties any

    Sets traits on group member items (note - will not set traits to sub-groups). This applies to all nested group members (eg members in sub-groups). Also see itemPropertiesByType and itemPropertiesByIds.

    Item properties will be set in the following order (highest to lowest priority) itemPropertiesByIds, itemPropertiesByType, itemProperties.

    itemPropertiesByType ItemPropertiesByTypeTraits[]

    Sets traits on group member items by model type (eg csv or geojson). This applies to all nested group members (eg members in sub-groups). Only one itemProperties can be specified per type.

    Item properties will be set in the following order (highest to lowest priority) itemPropertiesByIds, itemPropertiesByType, itemProperties.

    itemPropertiesByIds ItemPropertiesByIdTraits[]

    Sets traits on group member items by model ID. This applies to all nested group members (eg members in sub-groups). Only one itemProperties can be specified per id.

    Item properties will be set in the following order (highest to lowest priority) itemPropertiesByIds, itemPropertiesByType, itemProperties.

    LegendOwnerTraits
    legends LegendTraits[]

    The legends to display on the workbench.

    legendBackgroundColor string

    Apply background color to all legends. This can be useful if legends are transparent and clash with Terria colours

    hideLegendInWorkbench boolean

    Whether the legend is hidden in the workbench for this catalog member.

    ReferenceTraits
    isOpenInWorkbench boolean true

    Whether the item in the workbench open or collapsed.

    UrlTraits
    url string

    The base URL of the file or service.

    forceProxy boolean

    Force the default proxy to be used for all network requests.

    cacheDuration string 1d

    The cache duration to use for proxied URLs for this catalog member. If undefined, proxied URLs are effectively cachable forever. The duration is expressed as a Varnish-like duration string, such as '1d' (one day) or '10000s' (ten thousand seconds).

    InfoSectionTraits

    Trait Type Default Description
    name string

    The name of the section.

    content string

    The content of the section, in Markdown and HTML format. Set this property to null to remove this section entirely.

    contentAsObject any

    The content of the section which is a JSON object. Set this property to null to remove this section entirely.

    show boolean true

    Indicates if this info section showing (not collapsed).

    ShortReportTraits

    Trait Type Default Description
    name string

    The name of the section.

    content string

    The content of the section.

    show boolean true

    Indicates if this short report section showing.

    MetadataUrlTraits

    Trait Type Default Description
    url string

    The metadata URL of the file or service.

    title string

    Title used for metadata URL button.

    DataUrlTraits

    Trait Type Default Description
    type string

    Type of data URL. This value will be used to provide context or instruction on how to use the data URL. For example wcs will provide a link to WCS docs. Current supported values are: - wfs = A Web Feature Service (WFS) base URL - wcs = A Web Coverage Service (WCS) base URL - wfs-complete = A complete, ready-to-use link to download features from a WCS server - wcs-complete = A complete, ready-to-use link to download features from a WFS server - direct = Direct URL to dataset (this is the default if no type is specified) - none = Hide data URL

    MetadataUrlTraits
    url string

    The metadata URL of the file or service.

    title string

    Title used for metadata URL button.

    EnumDimensionTraits

    Trait Type Default Description
    id string

    Dimension ID

    name string

    Dimension name (human-readable)

    options DimensionOptionTraits[]

    Dimension options

    selectedId string

    Selected Option's ID

    allowUndefined boolean

    Allow dimension to be undefined

    disable boolean

    Hides dimension

    DimensionOptionTraits

    Trait Type Default Description
    id string

    Option ID

    name string

    Option name (human-readable)

    value any

    Value (if this is undefined, id will be used)

    CkanResourceFormatTraits

    Trait Type Default Description
    id string

    The ID of this distribution format.

    formatRegex string

    A regular expression that is matched against the distribution's format. This must be defined for this format to be used

    urlRegex string

    A regular expression that is matched against the url, this will only be used if formatRegex matches.

    maxFileSize number

    The maximum allowed file size for this format (in megabytes).

    onlyUseIfSoleResource boolean

    This resource will only match if no other resource types match for a given dataset. Like a "last-resort" resource. This will be ignored if useSingleResource is used

    removeDuplicates boolean true

    Remove resources if they have the same name. If duplicates are found, then the newest resource will be used (according to created property). This is applied per format

    definition any

    The catalog member definition to use when the URL and Format regular expressions match. The URL property will also be set.

    ItemPropertiesByTypeTraits

    Trait Type Default Description
    type string

    The type of model to apply itemProperties to. This must be defined.

    itemProperties any

    Sets traits on group member items of specified type. This applies to all nested group members (eg members in sub-groups)

    ItemPropertiesByIdTraits

    Trait Type Default Description
    ids string[]

    The IDs of models to apply itemProperties to.

    itemProperties any

    Sets traits on group member items of specified id. This applies to all nested group members (eg members in sub-groups)

    LegendTraits

    Trait Type Default Description
    title string

    A title to be displayed above the legend.

    url string

    The URL of the legend image. If the URL suffix isn't one of the following png|jpg|jpeg|gif|svg, then urlMimeType must be defined - otherwise a hyperlink will be shown.

    imageScaling number 1

    Scaling of the legend. For example, a high DPI legend may have scaling = 0.5, so it will be scaled down 50%

    urlMimeType string

    The MIME type of the URL legend image. For example "image/png"

    items LegendItemTraits[]
    backgroundColor string

    Apply background color to entire legend. This can be useful if legend is transparent and clashes with Terria colours. This will override legendBackgroundColor.

    LegendItemTraits

    Trait Type Default Description
    title string

    The title to display next to this legend item.

    multipleTitles string

    Multiple titles to display next to this legend item.

    maxMultipleTitlesShowed string 10

    Maximum number of multiple titles to display next to this legend item. (Default is 10)

    titleAbove string

    The title to display above this legend item, i.e. marking the top of a box on the legend.

    titleBelow string

    The title to display below this legend item, i.e. marking the bottom of a box on the legend.

    color string

    The CSS color to display for this item. This property is ignored if Legend URL is specified.

    outlineColor string

    The CSS color with which to outline this item.

    outlineWidth number

    The width of outline in pixels

    multipleColors string[]

    Multiple colors to show with this item in a grid arrangement.

    imageUrl string

    The URL of an image to display with this item.

    marker string

    Maki marker ID to display with this item (eg "circle").

    rotation number

    The degrees to rotate legend item.

    addSpacingAbove boolean

    True to add a bit of extra spacing above this item in order to separate it visually from the rest of the legend.

    imageHeight number 20

    The height of the legend image.

    imageWidth number 20

    The width of the legend image.