Venue Maps API Developer's Guide

Display the Union Station Chicago using Models Full

This use case is a step-by-step guide to displaying Union Train Station in Chicago, IL, USA, using the models-full resource.

Discover Venues in Chicago,IL, USA

To discover what venues are available in the city of Chicago, IL in United States of America, we're going to use HERE Geocoder API. Before we can search for venues, we need to define a bounding box or geographical area that fully encloses the city of Chicago. The HERE Geocoder API can give us the coordinates for this bounding box. The coordinates come as two sets of longitude and latitude which define the top left and the bottom right corners of the bounding box

Figure 1. An illustration of the Bounding Box/Geographical Area of Chicago, IL, USA

Here's the request to the Geocoder API for a geographical bounding box of Chicago, IL, USA

http://geocoder.api.here.com/6.2/geocode.xml?
        &app_id={YOUR_APP_ID}
        &app_code={YOUR_APP_CODE}
        &gen=8
        &searchtext=Chicago+USA

Based on the response, under the MapView Element, The bounding box of Chicago is as follows:

In the response, we look for the MapView element. According to this element, the bounding box of Chicago is as follows:

<MapView>
        <TopLeft>
          <Latitude>42.02295</Latitude>
          <Longitude>-87.93948</Longitude>
        </TopLeft>
        <BottomRight>
          <Latitude>41.64459</Latitude>
          <Longitude>-87.52444</Longitude>
        </BottomRight>
</MapView>
      

We send these bounding box values to the Venue Maps API Discovery Service to discover the venues available in Chicago:

https://indoor-discovery.venue.maps.api.here.com/venues/discovery/v1
        ?app_id={YOUR_APP_ID}
        &app_code={YOUR_APP_CODE}
        &at=42.02295,-87.93948,41.64459,-87.52444
      

The result shows a large number of venues available:

{
  "hostname" : "ip-10-96-40-53.eu-west-1.compute.internal",
  "totalHits" : 43,
  "forecastedHits" : 0,
  "bboxDiameter" : 54,
  "status" : {
    "code" : "200",
    "message" : "Ok"
  },
  "type" : "venues",
  "results" : {
    "items" : [{
        "id" : "DM_12886",
        "title" : "The Home Depot",
        "address" : {
          "countryCode" : "USA",
          "city" : "Chicago",
          "postalCode" : "60609",
          "street" : "S Western Blvd",
          "house" : "4555"
        },
        "position" : [-87.6828677, 41.8109771],
        "distance" : "4.798284499244405",
        "type" : "urn:nlp-types:venue",
        "vicinity" : "S Western Blvd 4555,60609,Chicago,USA",
        "size" : 1,
        "level" : "13",
        "minFloor" : 0,
        "maxFloor" : 0
      },  {
        "id" : "DM_12321",
        "title" : "Union Station Chicago",
        "address" : {
          "countryCode" : "USA",
          "city" : "Chicago",
          "postalCode" : "60661",
          "street" : "S Canal St",
          "house" : "225"
        },
        "position" : [-87.63970155, 41.87868805],
        "distance" : "9.138733185135166",
        "type" : "urn:nlp-types:venue",
        "vicinity" : "S Canal St 225,60661,Chicago,USA",
        "size" : 1,
        "level" : "13",
        "minFloor" : 0,
        "maxFloor" : 1
      }, ...
                 == CONTENT TRUNCATED ==
}
      

To simplify the process, we're going to take Union Train Station as an example to proceed with. The steps explained starting from this point should be repeated for each venue.

Retrieving Full Model for Union Train Station

Based on the response of the discovery service, Union Train Station has a Venue ID of DM_12321, which we are going to use to send a request to models-full resource to retrieve all information for the venue.

http://static-3.venue.maps.api.here.com/1/models-full/DM_12321.json?
        Policy={YOUR_GENERATED_POLICY}
        &Signature={YOUR_GENERATED_SIGNATURE}
        &Key-Pair-Id={YOUR_GENERATED_KEY_PAIR_ID}
        &app_id={YOUR_APP_ID}
        &app_code={YOUR_APP_CODE}

The result should be as follows:

{
  "content" : {
    "category" : {
      "id" : "public-transport",
      "nt" : "9707"
    },
    "placeId" : "",
    "names" : {
      "ENG" : "Union Station Chicago"
    },
    "addresses" : {
      "ENG" : {
        "postalCode" : "60661",
        "countryCode" : "USA",
        "houseNumber" : "225",
        "streetName" : "S Canal St",
        "district" : "IL",
        "city" : "Chicago"
      }
    },
    "type" : 1,
    "contentId" : "1177729"
  },
  "connectors" : [{
      "destination2" : "Lv25710Ds_1936574",
      "connectorClass" : "ESCALATOR",
      "destination1" : "Lv25711Ds_1936575"
    },.... == CONTENT TRUNCATED == 
  ],
  "ownerID" : "DM_Q4",
  "address" : ",USA,,,Chicago,IL,S Canal St,225,,60661,Union Station Chicago,,,",
  "levels" : [{
      "outerAreas" : [{
          "polygon" : [[41.87825912317281, -87.63950829994175], [41.87826168678344, -87.63931104493098],  ... ]],
          "spaces" : [{
              "content" : {
                "category" : {
                  "id" : "facility",
                  "source" : "36"
                },
                "searchTags" : ["Adams St exit", "Canal St exit", "Clinton St exit", "Jackson St exit", "mail box", "phones", "postage", "waiting area", "seating", "baggage lockers"],
                "placeId" : "",
                "names" : {
                  "ENG" : "Great Hall"
                },
                "addresses" : {},
                "contentId" : "1174701"
              },
              "polygon" : [[41.879020162825505, -87.6404487849516], [41.87900783828652, -87.64044849602021],.... ]],
              "accessorRefs" : [{
                  "direction" : "ENTER-EXIT",
                  "gml:id" : "acc25710_1614207"
                }, ....
              ],
              "gml:id" : "Lv25710Ds_1908894",
              "spaceId" : "Great Hall_Lv25710Ds_1908894",
              "routingGraph" : {
                "nodes" : [{
                    "point" : [41.87867133054623, -87.64024126138176],
                    "name" : "P1908894_17"
                  }, .... 
                ],
                "links" : [{
                    "link" : ["P1908894_1", "P1908894_acc25710_1614206"],
                    "gml:id" : "L1908894_0"
                  }, .... 
                ]
              },
              "accessorDistances" : [{
                  "distance" : 46,
                  "accessorRef" : "acc25710_1621520"
                }, ... 
              ],
              "isClosed" : false,
              "centroid" : [41.87866689755419, -87.64036876393982]
            }, ...
      "tiles" : [[269016, 389725], [269016, 389726], [269016, 389723], [269016, 389724], [269016, 389722], [269018, 389724], [269018, 389723], [269018, 389722], [269020, 389726], [269020, 389725], [269020, 389724], [269018, 389726], [269020, 389723], [269018, 389725], [269022, 389725], [269021, 389722], [269022, 389726], [269021, 389723], [269017, 389724], [269017, 389725], [269017, 389726], [269015, 389722], [269015, 389723], [269017, 389722], [269015, 389724], [269017, 389723], [269015, 389725], [269015, 389726], [269019, 389723], [269019, 389722], [269019, 389725], [269019, 389724], [269021, 389725], [269021, 389724], [269021, 389726], [269022, 389722], [269022, 389723], [269022, 389724], [269020, 389722]]
    }, {
      "outerAreas" : [{
          "polygon" : [[41.879180663132324,  .... 
      ],
      "tiles" : [[269019, 389723], [269019, 389722],  .... 
    }
  ],
  "groundLevel" : 0,
  "gml:id" : "DM_12321",
  "accessors" : [{
      "polygon" : [[41.87881543615436, -87.6387313914614], [41.87872023905603, -87.63873099947658]],
      "gml:id" : "acc25710_1614190",
      "preferred" : "false"
    }, .... 
  ],
  "centroid" : [41.878687949989924, -87.63970150019898]
}
      

Displaying Union Train Station

The Full Model contains all the information that you need to draw the venue with another technology or platform. This information includes data about points of interest and routing options within the venue so that you can provide a rich user experience.

You can retrieve all Venue Maps API models the JSON format which is completely language-independent.