telefonicaid/fiware-here-adaptor

Name: fiware-here-adaptor

Owner: Telefónica I+D

Description: Backend implementation of the integration between FIWARE and HERE Maps

Created: 2015-11-16 15:56:14.0

Updated: 2016-01-21 10:07:44.0

Pushed: 2016-02-16 16:28:46.0

Homepage: null

Size: 36

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Fiware HERE Adaptor

Adaptor component for the FIWARE-NGSI-HERE integration for Smarter car navigation through cities.

How to install and run

The following instructions are for development setups:

Prerequisites:

Download the source code from git repository:

git clone https://github.com/telefonicaid/fiware-here-adaptor.git

Install dependencies:

npm install

When npm process finishes the dependencies installation, you could run the fiware-here-adaptor executing this command:

NFIG_DIR={path_to_config_folder} ./bin/fiware-here-adaptor

CONFIG_DIR environment variable is optional. The default configuration has the following aspect:


 Port where fiware-here-adaptor is available
erverPort": 7007,

ogLevel": "INFO",

 Log format: "json", "pipe", or "dev"
ogFormat": "json",

 If true, disable unauthorized SSL (NODE_TLS_REJECT_UNAUTHORIZED = 0)
entleSsl": true,

Global city broker directory configuration
ontextBroker": {
"cityContextBrokerDirectoryName": "CityBrokerFHA",
"maxDistanceCityDirectory": 10,
"cityBrokerDirectoryConfig": {
  // Global city broker endpoint
  "url": "http://{contextBrokerIp}:1026/v1",
  "userAgent": "fiware-here-adapter"
}


 HERE configuration to consume the API
ere": {
"geocodingUrl": "http://geocoder.cit.api.here.com",
"reverseGeocodingUrl": "http://reverse.geocoder.cit.api.here.com",
// You can obtain your API keys in HERE service.
"appId": "myAppId",
"appCode": "myAppCode"


The internal config is stored in '{installation_path}/lib/config/config.json' but you can use the environment variable CONFIG_DIR to set a folder that merges the configs obtained from json files against the internal config file.

Example taking into account the internal config file above included:

CONFIG_DIR=/opt/fiware-here-adaptor

File /opt/fiware-here-adaptor/config.json:


erverPort": 8080,
ere": {
"geocodingUrl": "http://geocoder.cit.api.here.com",
"reverseGeocodingUrl": "http://reverse.geocoder.cit.api.here.com",
// You can obtain your API keys in HERE service.
"appId": "534g23df325df23gf4",
"appCode": "63gdsgv23d78ads5bgv"


The server will merge /opt/fiware-here-adaptor/config.json into {installation_path}/lib/config/config.json in order to get the following final configuration:


 Port where fiware-here-adaptor is available
erverPort": 8080,

ogLevel": "INFO",

 Log format: "json", "pipe", or "dev"
ogFormat": "json",

 If true, disable unauthorized SSL (NODE_TLS_REJECT_UNAUTHORIZED = 0)
entleSsl": true,

Global city broker directory configuration
ontextBroker": {
"cityContextBrokerDirectoryName": "CityBrokerFHA",
"maxDistanceCityDirectory": 10,
"cityBrokerDirectoryConfig": {
  // Global city broker endpoint
  "url": "http://{contextBrokerIp}:1026/v1",
  "userAgent": "fiware-here-adapter"
}


 HERE configuration to consume the API
ere": {
"geocodingUrl": "http://geocoder.cit.api.here.com",
"reverseGeocodingUrl": "http://reverse.geocoder.cit.api.here.com",
// You can obtain your API keys in HERE service.
"appId": "534g23df325df23gf4",
"appCode": "63gdsgv23d78ads5bgv"


Other commands:
Contribute
Server

The source code files are found in 'lib' folder.

Main files:

Object adaptations:

The object adaptations are based on a JSON pointer rule system. Using this way it is very simple to change the outcoming data. Files:

Object adaptation example:
Context Broker provisioner script

This script contains examples to set the context information about the cities. This information contains the URLs where the city context broker is.

 cbProvisioner
de --harmony index.js

It supports arguments to set information of a certain city. Arguments supported: madrid, oporto, guadalajara, aveiro, amsterdam

Example:

 cbProvisioner
de --harmony index.js oporto madrid
Deployment

Generate a tgz file with the code content.

m pack

Copy it to server using scp or other methods. Extract content:

r -xvzf fiware-here-adaptor-1.0.0.tgz

Go to package folder and install all dependencies:

 package
m install

Launch the server:

IG_DIR={path_to_config_folder} ./bin/fiware-here-adaptor

Or launch it using nohup:

IG_DIR={path_to_config_folder} nohup ./bin/fiware-here-adaptor &
Server Features:
Documentation

HERE API doc

Smart Parking Data Models


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.