Points of Interest Repositories
  • 18 Mar 2024
  • 4 Minutes to read
  • Dark
    Light
  • PDF

Points of Interest Repositories

  • Dark
    Light
  • PDF

Article summary

The Point of Interest (POI) data domain contains three sub-domains that are relationally associated:

POI_repo
  1. PoiTypeGroupRepository: A POI type group is used to create a set of POI types. User permissions can be configured for the POI types within the group.

  2. PoiTypeRepository: A POI type is used to categorize POIs. POI icons and their zoom-level visibility can also be configured here.

  3. PoiRepository: POIs are points defined in the 3D coordinate system of a NavVis IVION Site that have additional information attached to them. In addition to basic information (e.g. title and body text) you can add a unique icon and custom data and customize user permissions.

Creating a Custom POI Type Group

Procedure

Note: Make sure that you are logged into NavVis IVION with admin rights.

  1. To generate an empty POI type group object, set its name (here: "Utilities"), and persist the object to the database, run:

    let utilitiesGroup: PoiTypeGroupInterface = api.poi.poiTypeGroupRepository.create();
    utilitiesGroup.name = {"en": "Utilities"};
    api.poi.poiTypeGroupRepository.save(utilitiesGroup);

Creating Custom POI Types

Procedure

Note: We are using "Electricity" and "Networking" as examples here.

  1. Run the following to create the "Electricity" POI type. For this type a data URI is used to store the icon in the NavVis IVION database:

    let electricityType: PoiTypeInterface = api.poi.poiTypeRepository.create();
    electricityType.name = {"en": "Electricity"};
    electricityType.icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4wISCjIRVoP+rQAADNRJREFUeNrNm1uMXVUZx/9r7b3PZZ8pTgttKdXYDkXC3abRWAqdM9M9pbQQSwKJXB4aExNjRI23EJHEBIpGLgaiLyY+GKMv+GBTa+rMnpnTkZomCoJgKhdpCpQ6kF6mM+e2z157+cBax29W1z63uUATkjbs7G/997fWb33r/63DgqDoAPDCsFQLgmIWgAjDUhwExTyAGj78kwNQBeAB4GFYqgdBMQcgCsNSQp5lALJhWKoGQTEDQIZhqaGfBZAA8AFUAHQT1wXg6LhhWKoB2HT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TPFPl8jh88ePhGx3H+RsULId4F8CnSnjPj1i0luFnbN4y4fopV37DwIacrQbNBaruESI2Rrn17zvlbUsqNRLz0PG/N4OC2qno2rbancbPkvtJC+gXNZ3nKdZhWjgrt0pqZNx0kJwxLtf7+/k9q8cTpeYiId1OuvdK4lEvt4rop3eGK+aHM7vCi0J6C5+GHv+s+/vhTX5NSPvP/gw/+nCRyt2qDLQvtO+kOyw7v22dTGqS+rTusfqkhqfGxadPAqjfffOtcypnCHHCmi+4wpX1k+Q2EtTvsLRLtK2TaN4KgmI+iRgRgG7W58/lcoMR7ho21pLRv1R1mZm1vlJkta/uULm0OQDQ1dVS4rvt14g3+qlqtjVtq+1oK7Tut7T0j8510h/O0O7xotKfU3bLlpkteeOHlGeUEzwghVg4Pb3c558tO+066wz3V9mk3MDlnhdHRya8CeFJte6tuu23HrBBiUc4UtriW6/h+p93hZKG0N7u06kbIPx3HuUEI8WQQFB9aBtr33B3uprbPWy4k0WspfQDmOOcblfgXAXxvGWr7vl67w/mF0p5sOQUAc5s33yQZYz8XQuDSS1ftHB7e7i0D7Vs5SL6lO8x0d7jaIe39NNqb1H3iiWcghNjhuu4DIyPFCxMTU61on10O2lu6wzlbd3jBd3IYY7mxsclBzvk3kyTZ1WaXWTbap/wMIMP0j5F7pT3pFzQHwRg7vW7dms+89970rEldUlmm0b7aok/RM+1J3Hm/gbBdlOyK9qaDtH79uvy5c+cvrVSq73Z4plgW2qf8uFswXWOr/7q5+UmfzYVhqbpnz23ukSNHV8/NzZ3W4GlX2xtx6Zo3b342LGPMpRzk2sXVy63wPwvJWvkV77o8AAAAAElFTkSuQmCC";
    electricityType.poiTypeGroup = utilitiesGroup;
  2. Run the following to create the "Networking" POI type. For this type a URL is used to reference the icon from an external source:

    let networkingType: PoiTypeInterface = api.poi.poiTypeRepository.create();
    networkingType.name = {"en": "Networking"};
    networkingType.icon = "/poi/image/icon-51c5e498-f155-437b-b68c-52ae5012ba82.png";
    networkingType.poiTypeGroup = utilitiesGroup;
  3. Add the POI types to the database:

    api.poi.poiTypeRepository.save([electricityType, networkingType]);

Selecting POIs and Assigning POI Types

Procedure

Note: As an example, we are:

  • Selecting10 POIs starting from the 8th row of the database.

  • Assigning the first 5 POIs to the "Electricity" type and the last 5 to the "Networking" type

  1. Build a POI filter query using the POI filter builder:

    const poiFilterBuilder: PoiFilterInterface = api.poi.repository.createFilterBuilder();
    const poiFilter: RestFilterInterface = poiFilterBuilder.offset(8).limit(10).build();
  2. Use your POI filter to define a set of POIs for each POI type ("Electricity" and "Networking"), and to assign POIs to the respective POI type:

    api.poi.repository.filter(poiFilter)
      .then((pois: PoiInterface[]) => {
        if (pois.length === 10) {
          const electricSet = pois.slice(0,5);
          const networkSet = pois.slice(5,10);
    
          electricSet.forEach((poi: PoiInterface) => {
            poi.poiType = electricityType;
          });
    
          networkSet.forEach((poi: PoiInterface) => {
            poi.poiType = networkingType;
          });
    
          api.poi.repository.save(electricSet.concat(networkSet));
        }
        else {
          console.log("At least 18 POIs for the example to work.");
        }
      });

Getting POIs of a Specific Type

Procedure

  1. You can retrieve POIs of a specific type by using a POI filter to build a query. Pass an array of POI types to the filter:

    const electricityType: PoiTypeInterface = getElectricityType();
    
    const poiFilterBuilder: PoiFilterInterface = api.poi.repository.createFilterBuilder();
    const poiFilter: RestFilterInterface = poiFilterBuilder.poiType([electricityType]).build();
    
    api.poi.repository.filter(poiFilter)
      .then((electricityPois: PoiInterface[]) => {
        // Perform some action
      });

Getting POIs Using Geofencing

This example shows how to retrieve POIs by geofencing. There are two steps:

  1. Filter your POIs using a bounding box.

  2. Narrow the results, e.g. to a specific floor within the Site Model.

A bounding box is a 2-dimensional outline with a 3rd dimension that is infinite. It is defined by a min and max set of coordinates. On the 2D map in NavVis IVION:

  • The min coordinate is the upper-left point.

  • The max coordinate is the lower-right point.

Once a bounding box has been used to pre-filter POIs, the results can be narrowed by vertical space (the third dimension) by using the site model to set vertical boundaries. For this purpose, the site model must already be correctly generated in NavVis IVION.

repo-poi-geofence

Procedure

  1. Define the coordinates for your bounding box and the Site Model in the site coordinate system:

    // Site coordinates for geofencing
    const min = {10, 10, 10};
    const max = {20, 20, 20};
    const siteModelEntity = await api.siteModel.repository.findOne(2); // arbitrary site model entityee
  2. Once these limits have been defined, you can build the filter query:

    const poiFilterBuilder: PoiFilterInterface = api.poi.repository.createFilterBuilder();
          poiFilterBuilder.boundingBox(min.x, min.y, max.x, max.y);
          poiFilterBuilder.siteModel(siteModelEntity);
    
    const poiFilter: RestFilterInterface = poiFilterBuilder.build();
  3. Run your query:

    api.poi.repository.filter(poiFilter)
      .then((geofencedPois: PoiInterface[]) => {
        // Perform actions on geofenced POIs
      });


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.