here-apiheremaps

Is it possible to retrieve full (structured) addresses for the specific POINT_ADDRESS tile using HERE Map Attributes API v8?


I'm trying to use HERE Map Attributes API to retrieve the addresses for some map area. As far as I understood the layer I need is the POINT_ADDRESS layer (check the docs). The problem is that the layer contains coordinates and identifiers only, but not the structured addresses:

[
    {
      "ADDRESS_POINT_ID": "334030589",
      "LINK_ID": "1286528309",
      "SIDE": "R",
      "ADDRESSES": "ENGBN682",
      "ADDRESS_TYPE": "1",
      "BUILDING_NAMES": "ENGBNnull",
      "DISPLAY_LAT": "-2751772",
      "DISPLAY_LON": "15307500",
      "ARRIVAL_LINK_ID": null,
      "ARRIVAL_SIDE": null,
      "LAT": "-2751797",
      "LON": "15307488",
      "TOPOLOGY_ID": "215602187",
      "START_OFFSET": "8043"
    },
    ...
]

So the question is: how to retrieve the structured address for every point from the POINT_ADDRESS layer? Should I use HERE Batch Geocoder API and perform reverse geocoding for these points? Or it's still possible to achieve that with Map Attributes API only?


Solution

  • On this link https://developer.here.com/documentation/content-map-attributes/dev_guide/topics/here-map-content.html are not all layers in the list.

    Please see all layers on https://demo.support.here.com/pde . In the weu region on https://demo.support.here.com/pde/layers?region=WEU&release=latest&url_root=pde.api.here.com

    To retrieve the structured address you need additional layers ROAD_ADMIN_NAMES and ROAD_NAME

    Then you request will be like: https://smap.hereapi.com/v8/maps/attributes.json?in=proximity:-27.51772,153.075001;r=100&layers=ROAD_NAME_FCn,ROAD_ADMIN_NAMES_FCn,POINT_ADDRESS&apikey=

    Regarding docs on https://developer.here.com/documentation/content-map-attributes/api-reference.html

    The parameter 'in' could be: proximity or bbox or corridor - for these in case for big areas you can get limitations due big data. Therefore some times it could be better use in=tile:...

    Tile Ids you can get by these formulas:

          tile size = 180° / 2^level [degree]
          tileY = trunc((latitude  +  90°) / tile size)
          tileX = trunc((longitude + 180°) / tile size)
          tileID = tileY * 2 * (2^level) + tileX
    

    Or you can read this documentation https://demo.support.here.com/pde/indexes?region=WEU&release=latest&url_root=pde.api.here.com How to get tileid by some index like:

    https://smap.hereapi.com/v8/maps/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1286528309,130742823

    Then by tile request will be like:

    https://smap.hereapi.com/v8/maps/attributes?apikey=&layers=POINT_ADDRESS,ROAD_NAME_FC4,ROAD_NAME_FC5,ROAD_ADMIN_NAMES_FC4,ROAD_ADMIN_NAMES_FC5&in=tile:46594870,11648411,46594870,11648411,46594870