Skip to content

GtfsCatalogItem

Creates one catalog item from url that points to a gtfs service.

Note:

  • You need to obtain a valid api key for the NSW transport api.
  • When the camera is less than maximumDistance (500m) away, bus 3d models (scene.gltf) will be rendered.
  • Example usage

    {
      "type": "gtfs",
      "url": "https://api.transport.nsw.gov.au/v1/gtfs/vehiclepos/buses",
      "image": "https://tiles.terria.io/terriajs-examples/gtfs/TfNSW_B.png",
      "name": "NSW Live Transport - Buses",
      "headers": [
        {
          "name": "Authorization",
          "value": "apikey put-a-real-api-key-here"
        }
      ],
      "refreshInterval": 60,
      "featureInfoTemplate": {
        "name": "{{vehicle_trip_bus_number}}",
        "template": "<b>Bus:</b> {{route_short_name}}<br><b>Occupancy:</b> {{occupancy_status_str}}<br><b>Speed:</b> {{speed_km}} km/h<br><b style='padding-right: 5px'>Direction:</b> <span style='transform: rotate({{bearing}}deg); width: 10px; display: inline-block' aria-label='{{bearing}} degrees' role='img' title='{{bearing}} degrees'>&#x2B06;</div>"
      },
      "model": {
        "url": "https://tiles.terria.io/terriajs-examples/gtfs/lowpoly_bus/scene.gltf",
        "scale": 0.3048,
        "maximumDistance": 500
      },
      "id": "some unique id"
    }
    

    GtfsCatalogItemTraits

    Trait Type Default Description
    headers HeadersTraits[]

    Extra headers to attach to queries to the GTFS endpoint

    image string

    Url for the image to use to represent a vehicle. Recommended size 32x32 pixels.

    scaleImageByDistance ScaleByDistanceTraits

    Describes how marker images are scaled by distance from the viewer.

    model GtfsModelTraits

    3D model to use to represent a vehicle.

    AttributionTraits
    attribution string

    The attribution to display with the data.

    AutoRefreshingTraits
    refreshInterval number

    How often the data in this model is refreshed, in seconds

    refreshEnabled boolean true

    Toggle for enabling auto refresh.

    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

    isOpenInWorkbench boolean true

    Whether the item in the workbench open or collapsed.

    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.

    LayerOrderingTraits
    keepOnTop boolean

    Keeps the layer on top of all other imagery layers.

    supportsReordering boolean true

    Does this layer support reordering in the workbench.

    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.

    MappableTraits
    rectangle RectangleTraits

    The bounding box rectangle that contains all the data in this catalog item.

    idealZoom IdealZoomTraits

    Override default ideal zoom if the given values are valid.

    disablePreview boolean

    Disables the preview on the Add Data panel. This is useful when the preview will be very slow to load.

    disableZoomTo boolean

    Disables the zoom to (aka 'Ideal Zoom') button in the workbench.

    zoomOnAddToWorkbench boolean

    Zoom to dataset when added to workbench. Doesn't work if disableZoomTo is true.

    show boolean true

    Show or hide a workbench item. When show is false, a mappable item is removed from the map and a chartable item is removed from the chart panel.

    initialMessage InitialMessageTraits

    A message to show when the user adds the catalog item to the workbench. Useful for showing disclaimers.

    featureInfoTemplate FeatureInfoTemplateTraits

    A template object for formatting content in feature info panel

    showStringIfPropertyValueIsNull string

    If the value of a property is null or undefined, show the specified string as the value of the property. Otherwise, the property name will not be listed at all.

    maximumShownFeatureInfos number

    The maximum number of "feature infos" that can be displayed in feature info panel.

    OpacityTraits
    opacity number 0.8

    The opacity of the item.

    disableOpacityControl boolean

    When true, the user will be unable to change the opacity of the item

    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

    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).

    HeadersTraits

    Trait Type Default Description
    name string

    The header name

    value string

    The header value

    ScaleByDistanceTraits

    Trait Type Default Description
    near number

    The lower bound of the camera distance range.

    nearValue number 1

    The scale value to use when the camera is at the Near distance (or closer). A value greater than 1.0 enlarges the image while a scale less than 1.0 shrinks it.

    far number 1

    The upper bound of the camera distance range.

    farValue number 1

    The scale value to use when the camera is at the Far distance (or farther). A value greater than 1.0 enlarges the image while a scale less than 1.0 shrinks it.

    GtfsModelTraits

    Trait Type Default Description
    maximumDistance number

    The farthest distance from the camera that the model will still be drawn

    maximumScale number

    The maximum scale size of a model. This property is used as an upper limit for scaling due to minimumPixelSize

    minimumPixelSize number

    The minimum pixel size of the model regardless of zoom. This can be used to ensure that a model is visible even when the viewer zooms out. When 0.0, no minimum size is enforced

    colorModelsByProperty ColorModelsByPropertyTraits

    Color entity models by reguler expression match of a property of an entity

    AttributionTraits
    attribution string

    The attribution to display with the data.

    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

    isOpenInWorkbench boolean true

    Whether the item in the workbench open or collapsed.

    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.

    GltfTraits
    upAxis string

    The model's up-axis. By default models are y-up according to the glTF spec, however geo-referenced models will typically be z-up. Valid values are 'X', 'Y', or 'Z'.

    forwardAxis string

    The model's forward axis. By default, glTF 2.0 models are Z-forward according to the glTF spec, however older glTF (1.0, 0.8) models used X-forward. Valid values are 'X' or 'Z'.

    heightReference string NONE

    Position relative to the ground. Accepted values are NONE, CLAMP_TO_GROUND & RELATIVE_TO_GROUND as described in the cesium doc - https://cesium.com/docs/cesiumjs-ref-doc/global.html#HeightReference

    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.

    MappableTraits
    rectangle RectangleTraits

    The bounding box rectangle that contains all the data in this catalog item.

    idealZoom IdealZoomTraits

    Override default ideal zoom if the given values are valid.

    disablePreview boolean

    Disables the preview on the Add Data panel. This is useful when the preview will be very slow to load.

    disableZoomTo boolean

    Disables the zoom to (aka 'Ideal Zoom') button in the workbench.

    zoomOnAddToWorkbench boolean

    Zoom to dataset when added to workbench. Doesn't work if disableZoomTo is true.

    show boolean true

    Show or hide a workbench item. When show is false, a mappable item is removed from the map and a chartable item is removed from the chart panel.

    initialMessage InitialMessageTraits

    A message to show when the user adds the catalog item to the workbench. Useful for showing disclaimers.

    featureInfoTemplate FeatureInfoTemplateTraits

    A template object for formatting content in feature info panel

    showStringIfPropertyValueIsNull string

    If the value of a property is null or undefined, show the specified string as the value of the property. Otherwise, the property name will not be listed at all.

    maximumShownFeatureInfos number

    The maximum number of "feature infos" that can be displayed in feature info panel.

    ShadowTraits
    shadows string NONE

    Determines whether the tileset casts or receives shadows from each light source.

    showShadowUi boolean true

    Determines whether the shadow UI component will be shown on the workbench item

    TransformationTraits
    origin LatLonHeightTraits

    The origin of the model, expressed as a longitude and latitude in degrees and a height in meters. If this property is specified, the model's axes will have X pointing East, Y pointing North, and Z pointing Up. If not specified, the model is located in the Earth-Centered Earth-Fixed frame.

    rotation HeadingPitchRollTraits

    The rotation of the model expressed as heading, pitch and roll in the local frame of reference. Defaults to zero rotation.

    scale number

    The scale factor to apply to the model

    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

    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).

    ColorModelsByPropertyTraits

    Trait Type Default Description
    property string

    Path to the property used to choose the color

    colorGroups ColorGroupTraits[]

    ColorGroupTraits

    Trait Type Default Description
    color string

    CSS color string

    regExp string

    Regular expression to match on the specified property

    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)

    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.

    RectangleTraits

    Trait Type Default Description
    west number

    The westernmost longitude in degrees.

    south number

    The southernmost longitude in degrees.

    east number

    The easternmost longitude in degrees.

    north number

    The northernmost longitude in degrees.

    CameraTraits
    position VectorTraits

    Position of the camera in the Earth-centered Fixed frame in meters.

    direction VectorTraits

    The look direction of the camera in the Earth-centered Fixed frame.

    up VectorTraits

    The up vector direction of the camera in the Earth-centered Fixed frame.

    VectorTraits

    Trait Type Default Description
    x number

    X component of vector in the Earth-centered Fixed frame.

    y number

    Y component of vector in the Earth-centered Fixed frame.

    z number

    Z component of vector in the Earth-centered Fixed frame.

    IdealZoomTraits

    Trait Type Default Description
    lookAt LookAtTraits

    Parameters for camera to look at a target.

    camera CameraTraits

    Use camera position, direction and up if fully defined. Otherwise use rectangle if fully defined.

    LookAtTraits

    Trait Type Default Description
    targetLongitude number

    Target longitude on the WGS84 ellipsoid in degrees

    targetLatitude number

    Target latitude on the WGS84 ellipsoid in degrees

    targetHeight number 100

    Target height in meters. Treat it as camera height. A positive value is above the WGS84 ellipsoid. Default to 100 meters.

    heading number

    Heading in degrees. Treat it as camera bearing. North is 0. A positive value rotates clockwise, negative anti-clockwise. Default to 0.

    pitch number 45

    Pitch in degrees. Treat it as camera pitch. A positive value is to look down, negative up. Default to 45.

    range number 500

    The range in meters. It is the distance between the target position and camera position projected onto the local plane. Not negative and default to 500.

    CameraTraits

    Trait Type Default Description
    position VectorTraits

    Position of the camera in the Earth-centered Fixed frame in meters.

    direction VectorTraits

    The look direction of the camera in the Earth-centered Fixed frame.

    up VectorTraits

    The up vector direction of the camera in the Earth-centered Fixed frame.

    RectangleTraits
    west number

    The westernmost longitude in degrees.

    south number

    The southernmost longitude in degrees.

    east number

    The easternmost longitude in degrees.

    north number

    The northernmost longitude in degrees.

    InitialMessageTraits

    Trait Type Default Description
    title string

    The title of the message.

    content string

    The content of the message.

    key string

    Identifier. If multiple messages with the same key are triggered, only the first will be displayed.

    confirmation boolean

    Whether the message requires confirmation.

    confirmText string

    If confirmation is true, the text to put on the confirmation button.

    width number

    Width of the message.

    height number

    Height of the message.

    FeatureInfoTemplateTraits

    Trait Type Default Description
    name string

    A mustache template string for formatting name

    template string

    A Mustache template string for formatting description

    showFeatureInfoDownloadWithTemplate boolean

    Show feature info download if a template has been provided. If no template is provided, then download will always show.

    partials any

    An object, mapping partial names to a template string. Defines the partials used in Template.

    formats any

    An object, mapping field names to formatting options.

    LatLonHeightTraits

    Trait Type Default Description
    latitude number

    Latitude in degrees

    longitude number

    Longitude in degrees

    height number

    Height above ellipsoid in metres

    HeadingPitchRollTraits

    Trait Type Default Description
    heading number

    Heading in degrees

    pitch number

    Pitch in degrees

    roll number

    Roll in degrees