Coder Social home page Coder Social logo

meggsimum / here-json2geojson Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 3.0 73 KB

JavaScript library to transform HERE JSON objects to GeoJSON

License: BSD 2-Clause "Simplified" License

JavaScript 99.37% HTML 0.63%
heremaps json geojson converter javascript-library

here-json2geojson's Introduction

HERE JSON to GeoJSON

JavaScript library to transform HERE JSON objects to GeoJSON.

Build Status dependencies Status devDependencies Status

At the moment only a subset of the JSON response types provided by the HERE REST APIs is supported. This will be extended from time to time.

Disclaimer

This is not an official HERE product!

Be sure to respect the HERE Service Terms when using their API.

Usage

To use this library in an HTML-web-application just include the JavaScript-file at dist/hj2gj.js into your HTML-page. Otherwise just import this library as module like in the snippet below:

import {readIsolines} from 'here-json2geojson';

var hereIsolineResponse = // The response of the HERE REST API call
var isolineFeatColl = readIsolines(hereIsolineResponse);

Build the library on your own

> npm install
> npm run dist

Afterwards the single-file-build of the library is available under dist/hj2gj.js

API

readRoute

Reads route-response object delivered by the HERE API and converts it to a GeoJSON FeatureCollection holding the route legs as line features.

Parameters

  • hereRouteResponse Object HERE JSON for a route

Returns Object GeoJSON FeatureCollection

readWeatherConditions

Reads HERE traffic weather conditions and transforms them to a GeoJSON FeatureCollection containing point features with weather info as attributes.

Parameters

  • weatherConditionsResponse Object HERE JSON for weather conditions

Returns Object GeoJSON FeatureCollection

readPlaces

Reads places-response object delivered by the HERE API and converts it to a GeoJSON FeatureCollection holding the places as point features.

Parameters

  • herePlacesResponse Object HERE JSON for a place

Returns Object GeoJSON FeatureCollection

readTrafficIncidents

Reads HERE traffic incidents and transforms them to a GeoJSON FeatureCollection containing point features.

Parameters

  • trafficIncidentsResponse Object HERE JSON for traffic incidents
  • addEndPoints Boolean Should possible end points of incident be added to the FeatureCollection

Returns Object GeoJSON FeatureCollection

readIsolines

Reads isolines-response object delivered by the HERE API and converts it to a GeoJSON FeatureCollection.

Parameters

  • hereIsolineResponse Object HERE JSON for isolines

Returns Object GeoJSON FeatureCollection

Credits

The initial development of this project has been sponsored by geomer GmbH from Heidelberg, Germany

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.