Skip to content

Access the API of NVDB from the Norwegian Public Roads Administration (Statens vegvesen)

License

Notifications You must be signed in to change notification settings

anderser/node-nvdb-client

Repository files navigation

node-nvdb-client

Access the NVDB API v2 and return results as GeoJSON

Work in progress. Use at own risk.

Install

$ install git://github.com/anderser/node-nvdb-client.git

Usage

See NVDB API Docs for examples: https://www.vegvesen.no/nvdb/apidokumentasjon/#/

var NVDBClient = require('node-nvdb-client')

var nvdb = NVDBClient();

nvdb.connect(function() {
    nvdb.fetch('Vegobjekter',{
            path: {
                type: 67, //tunnelløp
                id: '' // må være tom dersom ikke spesifit vegobjekt skal hentes
            },
            parameters: {
                antall: 10000,
                inkluder: 'geometri,egenskaper',
                srid: 4326,
                vegreferanse: 'Ev16',
                kartutsnitt: '5.464603900909424,60.41706227453995,6.400566101074218,60.658040943395704'
                //overlapp: '532(4568=16)'
            }
        },
        function(data, response) {
            // data contains GeoJson structured data returned from NVDB API
            console.log(JSON.stringify(data));

        });
});

Returns geojson string which can be sendt to a file. node myscript.js > mydata.geojson

Egenskaper in NVDB response are parsed into key value properties. (only navn and verdi) are used as of now.

License

MIT © Anders Eriksen

All data returned from NVDB API uses "Norsk lisens for offentlige data"

About

Access the API of NVDB from the Norwegian Public Roads Administration (Statens vegvesen)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published