ojp-sdk
    Preparing search index...

    Class OJPv1_LocationInformationRequest

    LocationInformationRequest (LIR) class for OJP 1.0

    Instances are created via static methods below. Direct construction is intentionally disabled.

    • initWithLocationName - use location name, i.e. Bern
    • initWithPlaceRef - use place ref or literal coordinates (lat, lng)
    • initWithBBOX - use bounding box to filter locations

    Hierarchy

    Index

    Initialization

    • Inits LIR with bounding box

      Parameters

      • bboxData: string | number[]

        bounding box data as string ("minLon,minLat,maxLon,maxLat") or array [minLon, minLat, maxLon, maxLat]

      • placeTypes: ("location" | "stop" | "address" | "poi" | "topographicPlace")[] = []

        OJP_Types.PlaceTypeEnum "stop" | "address" | "poi" | "location" | "topographicPlace"

      • numberOfResults: number = 10

        maximum number of results to return (default: 10)

      Returns OJPv1_LocationInformationRequest

    • Inits LIR with location name

      Parameters

      • name: string

        string, location name

      • placeTypes: ("location" | "stop" | "address" | "poi" | "topographicPlace")[] = []

        OJP_Types.PlaceTypeEnum "stop" | "address" | "poi" | "location" | "topographicPlace"

      • numberOfResults: number = 10

        maximum number of results to return (default: 10)

      Returns OJPv1_LocationInformationRequest

    • Creates a new instance of the request class with a mock request XML string

      This method is used for testing purposes to simulate API requests with predefined XML payloads. When this mock is set, the request will use the provided XML instead of building a new one.

      Type Parameters

      • T_This extends { Default(): any }

      Parameters

      • this: T_This
      • mockText: string

        The XML string to use as the mock request

      Returns ReturnType<T_This["Default"]>

      A new instance of the request class with the mock set

      const mockRequest = LocationInformationRequest.initWithRequestMock('<OJP>...</OJP>');
      
    • Creates a new instance of the request class with a mock response XML string

      This method is used for testing purposes to simulate API responses with predefined XML payloads. When this mock is set, the request will use the provided XML response instead of making actual API calls.

      Type Parameters

      • T_This extends { Default(): any }

      Parameters

      • this: T_This
      • mockText: string

        The XML string to use as the mock response

      Returns ReturnType<T_This["Default"]>

      A new instance of the request class with the mock set

      const mockRequest = LocationInformationRequest.initWithResponseMock('<OJP>...</OJP>');
      

    Constructors

    • Parameters

      • restrictions: {
            includePtModes?: boolean;
            modes?: {
                airSubmode?: string;
                busSubmode?: string;
                coachSubmode?: string;
                exclude?: boolean;
                funicularSubmode?: string;
                metroSubmode?: string;
                personalMode: (
                    | "other"
                    | "foot"
                    | "bicycle"
                    | "car"
                    | "motorcycle"
                    | "truck"
                    | "scooter"
                )[];
                ptMode: (
                    | "other"
                    | "unknown"
                    | "air"
                    | "bus"
                    | "coach"
                    | "trolleyBus"
                    | "metro"
                    | "rail"
                    | "tram"
                    | "water"
                    | "ferry"
                    | "cableway"
                    | "funicular"
                    | "lift"
                    | "telecabin"
                )[];
                railSubmode?: | "international"
                | "highSpeedRail"
                | "interregionalRail"
                | "railShuttle"
                | "local"
                | "vehicleTunnelTransportRailService";
                telecabinSubmode?: string;
                tramSubmode?: string;
                waterSubmode?: string;
            };
            numberOfResults?: number;
            pointOfInterestFilter?: {
                exclude?: boolean;
                pointOfInterestCategory: {
                    osmTag: { tag: string; value: string }[];
                    pointOfInterestClassification: string[];
                }[];
            };
            type: ("location" | "stop" | "address" | "poi" | "topographicPlace")[];
        }

      Returns OJPv1_LocationInformationRequest

    Properties

    mockRequestXML: string | null
    mockResponseXML: string | null
    payload: {
        initialInput?: {
            geoRestriction?: {
                rectangle: {
                    lowerRight: { latitude: number; longitude: number };
                    upperLeft: { latitude: number; longitude: number };
                };
            };
            locationName?: string;
        };
        placeRef?: {
            geoPosition?: { latitude: number; longitude: number };
            locationName: { text: string };
            stopPlaceRef?: string;
            stopPointRef?: string;
        };
        requestTimestamp: string;
        restrictions?: {
            includePtModes?: boolean;
            modes?: {
                airSubmode?: string;
                busSubmode?: string;
                coachSubmode?: string;
                exclude?: boolean;
                funicularSubmode?: string;
                metroSubmode?: string;
                personalMode: (
                    | "other"
                    | "foot"
                    | "bicycle"
                    | "car"
                    | "motorcycle"
                    | "truck"
                    | "scooter"
                )[];
                ptMode: (
                    | "other"
                    | "unknown"
                    | "air"
                    | "bus"
                    | "coach"
                    | "trolleyBus"
                    | "metro"
                    | "rail"
                    | "tram"
                    | "water"
                    | "ferry"
                    | "cableway"
                    | "funicular"
                    | "lift"
                    | "telecabin"
                )[];
                railSubmode?: | "international"
                | "highSpeedRail"
                | "interregionalRail"
                | "railShuttle"
                | "local"
                | "vehicleTunnelTransportRailService";
                telecabinSubmode?: string;
                tramSubmode?: string;
                waterSubmode?: string;
            };
            numberOfResults?: number;
            pointOfInterestFilter?: {
                exclude?: boolean;
                pointOfInterestCategory: {
                    osmTag: { tag: string; value: string }[];
                    pointOfInterestClassification: string[];
                }[];
            };
            type: ("location" | "stop" | "address" | "poi" | "topographicPlace")[];
        };
    }

    The payload object that gets serialized to XML for the request (OJP v1)

    requestInfo: RequestInfo

    Methods

    • Builds the XML request string for the LIR

      Parameters

      • language: Language

        The language to use for the request (e.g. "en", "de")

      • requestorRef: string

        The requestor reference identifier

      • xmlConfig: XML_Config = XML_BuilderConfigOJPv1

        XML configuration options for building the request, default XML_BuilderConfigOJPv1 OJP 1.0

      Returns string

      A formatted XML string representing the Location Information Request

    • Parameters

      • restrictions: {
            includePtModes?: boolean;
            modes?: {
                airSubmode?: string;
                busSubmode?: string;
                coachSubmode?: string;
                exclude?: boolean;
                funicularSubmode?: string;
                metroSubmode?: string;
                personalMode: (
                    | "other"
                    | "foot"
                    | "bicycle"
                    | "car"
                    | "motorcycle"
                    | "truck"
                    | "scooter"
                )[];
                ptMode: (
                    | "other"
                    | "unknown"
                    | "air"
                    | "bus"
                    | "coach"
                    | "trolleyBus"
                    | "metro"
                    | "rail"
                    | "tram"
                    | "water"
                    | "ferry"
                    | "cableway"
                    | "funicular"
                    | "lift"
                    | "telecabin"
                )[];
                railSubmode?: | "international"
                | "highSpeedRail"
                | "interregionalRail"
                | "railShuttle"
                | "local"
                | "vehicleTunnelTransportRailService";
                telecabinSubmode?: string;
                tramSubmode?: string;
                waterSubmode?: string;
            };
            numberOfResults?: number;
            pointOfInterestFilter?: {
                exclude?: boolean;
                pointOfInterestCategory: {
                    osmTag: { tag: string; value: string }[];
                    pointOfInterestClassification: string[];
                }[];
            };
            type: ("location" | "stop" | "address" | "poi" | "topographicPlace")[];
        }
      • placeTypes: ("location" | "stop" | "address" | "poi" | "topographicPlace")[]
      • numberOfResults: number

      Returns void

    • Parameters

      • bboxData: string | number[]

      Returns
          | {
              rectangle: {
                  lowerRight: { latitude: number; longitude: number };
                  upperLeft: { latitude: number; longitude: number };
              };
          }
          | null

    • Returns {
          includePtModes?: boolean;
          modes?: {
              airSubmode?: string;
              busSubmode?: string;
              coachSubmode?: string;
              exclude?: boolean;
              funicularSubmode?: string;
              metroSubmode?: string;
              personalMode: (
                  | "other"
                  | "foot"
                  | "bicycle"
                  | "car"
                  | "motorcycle"
                  | "truck"
                  | "scooter"
              )[];
              ptMode: (
                  | "other"
                  | "unknown"
                  | "air"
                  | "bus"
                  | "coach"
                  | "trolleyBus"
                  | "metro"
                  | "rail"
                  | "tram"
                  | "water"
                  | "ferry"
                  | "cableway"
                  | "funicular"
                  | "lift"
                  | "telecabin"
              )[];
              railSubmode?: | "international"
              | "highSpeedRail"
              | "interregionalRail"
              | "railShuttle"
              | "local"
              | "vehicleTunnelTransportRailService";
              telecabinSubmode?: string;
              tramSubmode?: string;
              waterSubmode?: string;
          };
          numberOfResults?: number;
          pointOfInterestFilter?: {
              exclude?: boolean;
              pointOfInterestCategory: {
                  osmTag: { tag: string; value: string }[];
                  pointOfInterestClassification: string[];
              }[];
          };
          type: ("location" | "stop" | "address" | "poi" | "topographicPlace")[];
      }